/* Generated by Cython 0.24.1 */

#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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_24_1"
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#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 !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
  #define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#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_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#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_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#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
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

#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

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


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

#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

#define __PYX_HAVE__bcolz__carray_ext
#define __PYX_HAVE_API__bcolz__carray_ext
#include "string.h"
#include "stdio.h"
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "time.h"
#include "PythonHelper.h"
#include "check_blosc_version.h"
#include "blosc.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

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


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

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

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


static const char *__pyx_f[] = {
  "bcolz/carray_ext.pyx",
  "bcolz/carray_ext.pxd",
  "__init__.pxd",
  "type.pxd",
};

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725
 * # 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726
 * 
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732
 * #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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733
 * 
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739
 * #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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740
 * 
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749
 * # 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750
 * # 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762
 * 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;
/* None.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif

/* None.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif


/*--- Type declarations ---*/
struct __pyx_obj_5bcolz_10carray_ext_chunk;
struct __pyx_obj_5bcolz_10carray_ext_chunks;
struct __pyx_obj_5bcolz_10carray_ext_carray;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766
 * 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;

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768
 * 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_5bcolz_10carray_ext_create_bloscpack_header;

/* "bcolz/carray_ext.pyx":598
 * 
 * 
 * cdef create_bloscpack_header(nchunks=None, format_version=FORMAT_VERSION):             # <<<<<<<<<<<<<<
 *     """Create the bloscpack header string.
 * 
 */
struct __pyx_opt_args_5bcolz_10carray_ext_create_bloscpack_header {
  int __pyx_n;
  PyObject *nchunks;
  PyObject *format_version;
};

/* "bcolz/carray_ext.pxd":3
 * from numpy cimport ndarray, dtype, npy_intp
 * 
 * cdef class chunk:             # <<<<<<<<<<<<<<
 *     cdef public int atomsize, itemsize, blocksize
 *     cdef public int nbytes, cbytes
 */
struct __pyx_obj_5bcolz_10carray_ext_chunk {
  PyObject_HEAD
  struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk *__pyx_vtab;
  int atomsize;
  int itemsize;
  int blocksize;
  int nbytes;
  int cbytes;
  PyObject *dobject;
  char typekind;
  char isconstant;
  int true_count;
  PyObject *atom;
  PyObject *constant;
};


/* "bcolz/carray_ext.pxd":18
 * 
 * 
 * cdef class chunks(object):             # <<<<<<<<<<<<<<
 *     cdef object _rootdir, _mode
 *     cdef object dtype, cparams, lastchunkarr
 */
struct __pyx_obj_5bcolz_10carray_ext_chunks {
  PyObject_HEAD
  struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks *__pyx_vtab;
  PyObject *_rootdir;
  PyObject *_mode;
  PyObject *dtype;
  PyObject *cparams;
  PyObject *lastchunkarr;
  PyObject *chunk_cached;
  npy_intp nchunks;
  npy_intp nchunk_cached;
  npy_intp len;
  int _iter_count;
};


/* "bcolz/carray_ext.pxd":29
 *     cdef _chunk_file_name(self, nchunk)
 * 
 * cdef class carray:             # <<<<<<<<<<<<<<
 *     cdef public int itemsize, atomsize
 *     cdef int _chunksize, _chunklen, leftover
 */
struct __pyx_obj_5bcolz_10carray_ext_carray {
  PyObject_HEAD
  struct __pyx_vtabstruct_5bcolz_10carray_ext_carray *__pyx_vtab;
  int itemsize;
  int atomsize;
  int _chunksize;
  int _chunklen;
  int leftover;
  int nrowsinbuf;
  int _row;
  int sss_mode;
  int wheretrue_mode;
  int where_mode;
  npy_intp startb;
  npy_intp stopb;
  npy_intp start;
  npy_intp stop;
  npy_intp step;
  npy_intp nextelement;
  npy_intp _nrow;
  npy_intp nrowsread;
  npy_intp _nbytes;
  npy_intp _cbytes;
  npy_intp nhits;
  npy_intp limit;
  npy_intp skip;
  npy_intp expectedlen;
  char *lastchunk;
  PyObject *lastchunkarr;
  PyObject *where_arr;
  PyObject *arr1;
  PyObject *_cparams;
  PyObject *_dflt;
  PyObject *_dtype;
  PyObject *_safe;
  PyObject *chunks;
  PyObject *_rootdir;
  PyObject *datadir;
  PyObject *metadir;
  PyObject *_mode;
  PyObject *_attrs;
  PyObject *iter_exhausted;
  PyArrayObject *iobuf;
  PyArrayObject *where_buf;
  int idxcache;
  PyArrayObject *blockcache;
  char *datacache;
};



/* "bcolz/carray_ext.pyx":330
 * 
 * 
 * cdef class chunk:             # <<<<<<<<<<<<<<
 *     """
 *     chunk(array, atom, cparams)
 */

struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk {
  void (*_getitem)(struct __pyx_obj_5bcolz_10carray_ext_chunk *, int, int, char *);
  PyObject *(*compress_data)(struct __pyx_obj_5bcolz_10carray_ext_chunk *, char *, size_t, size_t, PyObject *);
  PyObject *(*compress_arrdata)(struct __pyx_obj_5bcolz_10carray_ext_chunk *, PyArrayObject *, int, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk *__pyx_vtabptr_5bcolz_10carray_ext_chunk;


/* "bcolz/carray_ext.pyx":699
 * 
 * 
 * cdef class chunks(object):             # <<<<<<<<<<<<<<
 *     """Store the different carray chunks in a directory on-disk."""
 *     property mode:
 */

struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks {
  PyObject *(*read_chunk)(struct __pyx_obj_5bcolz_10carray_ext_chunks *, PyObject *);
  PyObject *(*_save)(struct __pyx_obj_5bcolz_10carray_ext_chunks *, PyObject *, PyObject *);
  PyObject *(*_chunk_file_name)(struct __pyx_obj_5bcolz_10carray_ext_chunks *, PyObject *);
};
static struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks *__pyx_vtabptr_5bcolz_10carray_ext_chunks;


/* "bcolz/carray_ext.pyx":864
 * 
 * 
 * cdef class carray:             # <<<<<<<<<<<<<<
 *     """
 *     carray(array, cparams=None, dtype=None, dflt=None, expectedlen=None,
 */

struct __pyx_vtabstruct_5bcolz_10carray_ext_carray {
  void (*bool_update)(struct __pyx_obj_5bcolz_10carray_ext_carray *, PyObject *, PyObject *);
  int (*getitem_cache)(struct __pyx_obj_5bcolz_10carray_ext_carray *, npy_intp, char *);
  PyObject *(*reset_iter_sentinels)(struct __pyx_obj_5bcolz_10carray_ext_carray *);
  int (*check_zeros)(struct __pyx_obj_5bcolz_10carray_ext_carray *, PyObject *);
  PyObject *(*_adapt_dtype)(struct __pyx_obj_5bcolz_10carray_ext_carray *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_5bcolz_10carray_ext_carray *__pyx_vtabptr_5bcolz_10carray_ext_carray;

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

/* PyObjectGetAttrStr.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

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

/* Profile.proto */
#ifndef CYTHON_PROFILE
#if CYTHON_COMPILING_IN_PYPY
  #define CYTHON_PROFILE 0
#else
  #define CYTHON_PROFILE 1
#endif
#endif
#ifndef CYTHON_TRACE_NOGIL
  #define CYTHON_TRACE_NOGIL 0
#else
  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
    #define CYTHON_TRACE 1
  #endif
#endif
#ifndef CYTHON_TRACE
  #define CYTHON_TRACE 0
#endif
#if CYTHON_TRACE
  #undef CYTHON_PROFILE_REUSE_FRAME
#endif
#ifndef CYTHON_PROFILE_REUSE_FRAME
  #define CYTHON_PROFILE_REUSE_FRAME 0
#endif
#if CYTHON_PROFILE || CYTHON_TRACE
  #include "compile.h"
  #include "frameobject.h"
  #include "traceback.h"
  #if CYTHON_PROFILE_REUSE_FRAME
    #define CYTHON_FRAME_MODIFIER static
    #define CYTHON_FRAME_DEL(frame)
  #else
    #define CYTHON_FRAME_MODIFIER
    #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
  #endif
  #define __Pyx_TraceDeclarations\
  static PyCodeObject *__pyx_frame_code = NULL;\
  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
  int __Pyx_use_tracing = 0;
  #define __Pyx_TraceFrameInit(codeobj)\
  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
  #ifdef WITH_THREAD
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
  if (nogil) {\
      if (CYTHON_TRACE_NOGIL) {\
          PyThreadState *tstate;\
          PyGILState_STATE state = PyGILState_Ensure();\
          tstate = PyThreadState_GET();\
          if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
                  (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
              __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno);\
          }\
          PyGILState_Release(state);\
          if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
      }\
  } else {\
      PyThreadState* tstate = PyThreadState_GET();\
      if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
              (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
          __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno);\
          if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
      }\
  }
  #else
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
  {   PyThreadState* tstate = PyThreadState_GET();\
      if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
              (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
          __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno);\
          if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
      }\
  }
  #endif
  #define __Pyx_TraceException()\
  if (likely(!__Pyx_use_tracing)); else {\
      PyThreadState* tstate = PyThreadState_GET();\
      if (tstate->use_tracing &&\
              (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
          tstate->tracing++;\
          tstate->use_tracing = 0;\
          PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
          if (exc_info) {\
              if (CYTHON_TRACE && tstate->c_tracefunc)\
                  tstate->c_tracefunc(\
                      tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
              tstate->c_profilefunc(\
                  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
              Py_DECREF(exc_info);\
          }\
          tstate->use_tracing = 1;\
          tstate->tracing--;\
      }\
  }
  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
      PyObject *type, *value, *traceback;
      PyErr_Fetch(&type, &value, &traceback);
      tstate->tracing++;
      tstate->use_tracing = 0;
      if (CYTHON_TRACE && tstate->c_tracefunc)
          tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
      if (tstate->c_profilefunc)
          tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
      CYTHON_FRAME_DEL(frame);
      tstate->use_tracing = 1;
      tstate->tracing--;
      PyErr_Restore(type, value, traceback);
  }
  #ifdef WITH_THREAD
  #define __Pyx_TraceReturn(result, nogil)\
  if (likely(!__Pyx_use_tracing)); else {\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              PyThreadState *tstate;\
              PyGILState_STATE state = PyGILState_Ensure();\
              tstate = PyThreadState_GET();\
              if (tstate->use_tracing) {\
                  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
              }\
              PyGILState_Release(state);\
          }\
      } else {\
          PyThreadState* tstate = PyThreadState_GET();\
          if (tstate->use_tracing) {\
              __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
          }\
      }\
  }
  #else
  #define __Pyx_TraceReturn(result, nogil)\
  if (likely(!__Pyx_use_tracing)); else {\
      PyThreadState* tstate = PyThreadState_GET();\
      if (tstate->use_tracing) {\
          __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
      }\
  }
  #endif
  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno);
#else
  #define __Pyx_TraceDeclarations
  #define __Pyx_TraceFrameInit(codeobj)
  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)   if (1); else goto_error;
  #define __Pyx_TraceException()
  #define __Pyx_TraceReturn(result, nogil)
#endif
#if CYTHON_TRACE
  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
      int ret;
      PyObject *type, *value, *traceback;
      PyErr_Fetch(&type, &value, &traceback);
      frame->f_lineno = lineno;
      tstate->tracing++;
      tstate->use_tracing = 0;
      ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
      tstate->use_tracing = 1;
      tstate->tracing--;
      if (likely(!ret)) {
          PyErr_Restore(type, value, traceback);
      } else {
          Py_XDECREF(type);
          Py_XDECREF(value);
          Py_XDECREF(traceback);
      }
      return ret;
  }
  #ifdef WITH_THREAD
  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
  if (likely(!__Pyx_use_tracing)); else {\
      if (nogil) {\
          if (CYTHON_TRACE_NOGIL) {\
              int ret = 0;\
              PyThreadState *tstate;\
              PyGILState_STATE state = PyGILState_Ensure();\
              tstate = PyThreadState_GET();\
              if (unlikely(tstate->use_tracing && tstate->c_tracefunc)) {\
                  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
              }\
              PyGILState_Release(state);\
              if (unlikely(ret)) goto_error;\
          }\
      } else {\
          PyThreadState* tstate = PyThreadState_GET();\
          if (unlikely(tstate->use_tracing && tstate->c_tracefunc)) {\
              int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
              if (unlikely(ret)) goto_error;\
          }\
      }\
  }
  #else
  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
  if (likely(!__Pyx_use_tracing)); else {\
      PyThreadState* tstate = PyThreadState_GET();\
      if (unlikely(tstate->use_tracing && tstate->c_tracefunc)) {\
          int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
          if (unlikely(ret)) goto_error;\
      }\
  }
  #endif
#else
  #define __Pyx_TraceLine(lineno, nogil, goto_error)   if (1); else goto_error;
#endif

/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

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

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

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

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

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

/* None.proto */
static CYTHON_INLINE long __Pyx_div_long(long, long);

/* UnaryNegOverflows.proto */
#define UNARY_NEG_WOULD_OVERFLOW(x)\
        (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

/* None.proto */
static CYTHON_INLINE npy_intp __Pyx_mod_npy_intp(npy_intp, npy_intp);

/* PyThreadStateGet.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PyIntBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyIntBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

/* None.proto */
static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t);

/* PyObjectLookupSpecial.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

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

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

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

/* PyObjectSetAttrStr.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* PyIntBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
    PyObject_RichCompare(op1, op2, Py_EQ)
    #endif

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

/* SliceObject.proto */
#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
    __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

/* ListAppend.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) & likely(len > (L->allocated >> 1))) {
        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

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

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

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

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

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

/* pop.proto */
static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L);
#define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\
    __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L))
#else
#define __Pyx_PyList_Pop(L)  __Pyx__PyObject_Pop(L)
#define __Pyx_PyObject_Pop(L)  __Pyx__PyObject_Pop(L)
#endif

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

/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    ((likely((cfunc)->func)) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
             ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) : __Pyx__CallUnboundCMethod0(cfunc, self)))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* None.proto */
static CYTHON_INLINE npy_intp __Pyx_div_npy_intp(npy_intp, npy_intp);

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

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

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

/* UnpackTuple2.proto */
static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
                                             int is_tuple, int has_known_size, int decref_tuple);

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

/* MergeKeywords.proto */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping);

/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
                                               int is_list, int wraparound, int boundscheck);

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

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args))
                PyErr_SetObject(PyExc_KeyError, args);
            Py_XDECREF(args);
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

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

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

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

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

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

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

/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);

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

/* None.proto */
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

/* None.proto */
#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

/* None.proto */
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

/* None.proto */
#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

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

/* CIntFromPy.proto */
static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

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

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

/* PyIdentifierFromString.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

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

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

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

static PyObject *__pyx_f_5bcolz_10carray_ext_5chunk_compress_arrdata(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyArrayObject *__pyx_v_array, int __pyx_v_itemsize, PyObject *__pyx_v_cparams, PyObject *__pyx_v__memory); /* proto*/
static PyObject *__pyx_f_5bcolz_10carray_ext_5chunk_compress_data(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, char *__pyx_v_data, size_t __pyx_v_itemsize, size_t __pyx_v_nbytes, PyObject *__pyx_v_cparams); /* proto*/
static void __pyx_f_5bcolz_10carray_ext_5chunk__getitem(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, int __pyx_v_start, int __pyx_v_stop, char *__pyx_v_dest); /* proto*/
static PyObject *__pyx_f_5bcolz_10carray_ext_6chunks__chunk_file_name(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_nchunk); /* proto*/
static PyObject *__pyx_f_5bcolz_10carray_ext_6chunks_read_chunk(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_nchunk); /* proto*/
static PyObject *__pyx_f_5bcolz_10carray_ext_6chunks__save(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_nchunk, PyObject *__pyx_v_chunk_); /* proto*/
static PyObject *__pyx_f_5bcolz_10carray_ext_6carray__adapt_dtype(CYTHON_UNUSED struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_dtype_, PyObject *__pyx_v_shape); /* proto*/
static int __pyx_f_5bcolz_10carray_ext_6carray_getitem_cache(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, npy_intp __pyx_v_pos, char *__pyx_v_dest); /* proto*/
static void __pyx_f_5bcolz_10carray_ext_6carray_bool_update(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_boolarr, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_f_5bcolz_10carray_ext_6carray_reset_iter_sentinels(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto*/
static int __pyx_f_5bcolz_10carray_ext_6carray_check_zeros(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_barr); /* proto*/

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

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

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

/* Module declarations from '__builtin__' */

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

/* Module declarations from 'cpython' */

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

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

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

/* 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*/

/* Module declarations from 'cython' */

/* Module declarations from 'definitions' */

/* Module declarations from 'bcolz.carray_ext' */
static PyTypeObject *__pyx_ptype_5bcolz_10carray_ext_chunk = 0;
static PyTypeObject *__pyx_ptype_5bcolz_10carray_ext_chunks = 0;
static PyTypeObject *__pyx_ptype_5bcolz_10carray_ext_carray = 0;
static PyObject *__pyx_f_5bcolz_10carray_ext_get_len_of_range(npy_intp, npy_intp, npy_intp); /*proto*/
static PyObject *__pyx_f_5bcolz_10carray_ext_clip_chunk(npy_intp, npy_intp, npy_intp, npy_intp, npy_intp); /*proto*/
static int __pyx_f_5bcolz_10carray_ext_check_zeros(char *, int); /*proto*/
static int __pyx_f_5bcolz_10carray_ext_true_count(char *, int); /*proto*/
static PyObject *__pyx_f_5bcolz_10carray_ext_create_bloscpack_header(struct __pyx_opt_args_5bcolz_10carray_ext_create_bloscpack_header *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_5bcolz_10carray_ext_decode_blosc_header(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "bcolz.carray_ext"
int __pyx_module_is_main_bcolz__carray_ext = 0;

/* Implementation of 'bcolz.carray_ext' */
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_OverflowError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
static const char __pyx_k_B[] = "<B";
static const char __pyx_k_I[] = "<I";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_S[] = "S";
static const char __pyx_k_a[] = "a";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_q[] = "<q";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_KB[] = "_KB";
static const char __pyx_k_MB[] = "_MB";
static const char __pyx_k__3[] = ",";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_rb[] = "rb";
static const char __pyx_k_tb[] = "tb";
static const char __pyx_k_wb[] = "wb";
static const char __pyx_k__16[] = "\000\000\000";
static const char __pyx_k__47[] = "\n";
static const char __pyx_k_blp[] = ".blp";
static const char __pyx_k_d_s[] = "__%d%s";
static const char __pyx_k_dir[] = "dir";
static const char __pyx_k_hex[] = "hex";
static const char __pyx_k_int[] = "int_";
static const char __pyx_k_len[] = "len";
static const char __pyx_k_lst[] = "lst";
static const char __pyx_k_nan[] = "nan";
static const char __pyx_k_new[] = "_new";
static const char __pyx_k_out[] = "out";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k__112[] = "";
static const char __pyx_k_atom[] = "atom";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_blen[] = "blen";
static const char __pyx_k_blpk[] = "blpk";
static const char __pyx_k_bool[] = "bool_";
static const char __pyx_k_byte[] = "byte";
static const char __pyx_k_char[] = "char";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_date[] = "date";
static const char __pyx_k_dflt[] = "dflt";
static const char __pyx_k_eval[] = "eval";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_iter[] = "iter";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_json[] = "json";
static const char __pyx_k_kind[] = "kind";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_meta[] = "meta";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_ndim[] = "ndim";
static const char __pyx_k_next[] = "_next";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_pack[] = "pack";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_prod[] = "prod";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_safe[] = "safe";
static const char __pyx_k_seek[] = "seek";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_skip[] = "skip";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_temp[] = "__temp__";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_trim[] = "trim";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_view[] = "view";
static const char __pyx_k_MAGIC[] = "MAGIC";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_ascii[] = "ascii";
static const char __pyx_k_attrs[] = "attrs";
static const char __pyx_k_bcolz[] = "bcolz";
static const char __pyx_k_clist[] = "clist";
static const char __pyx_k_cname[] = "cname";
static const char __pyx_k_compr[] = "_compr";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_dumps[] = "dumps";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_flush[] = "flush";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_int32[] = "int32";
static const char __pyx_k_int64[] = "int64";
static const char __pyx_k_isdir[] = "isdir";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_limit[] = "limit";
static const char __pyx_k_loads[] = "loads";
static const char __pyx_k_mkdir[] = "mkdir";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_sizes[] = "sizes";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_utils[] = "utils";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_where[] = "where";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_zeros[] = "zeros";
static const char __pyx_k_MAXINT[] = "_MAXINT";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_arange[] = "arange";
static const char __pyx_k_arrlen[] = "arrlen";
static const char __pyx_k_astype[] = "astype";
static const char __pyx_k_buffer[] = "buffer";
static const char __pyx_k_cbytes[] = "cbytes";
static const char __pyx_k_clevel[] = "clevel";
static const char __pyx_k_ctypes[] = "ctypes";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_exists[] = "exists";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_maxint[] = "maxint";
static const char __pyx_k_memory[] = "_memory";
static const char __pyx_k_mkdirs[] = "_mkdirs";
static const char __pyx_k_mode_s[] = "  mode    := '%s'\n";
static const char __pyx_k_nbytes[] = "nbytes";
static const char __pyx_k_object[] = "object_";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_remove[] = "remove";
static const char __pyx_k_rename[] = "rename";
static const char __pyx_k_resize[] = "resize";
static const char __pyx_k_rmtree[] = "rmtree";
static const char __pyx_k_shutil[] = "shutil";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_suffix[] = "suffix";
static const char __pyx_k_tolist[] = "tolist";
static const char __pyx_k_unpack[] = "unpack";
static const char __pyx_k_xrange[] = "xrange";
static const char __pyx_k_IOError[] = "IOError";
static const char __pyx_k_IntType[] = "IntType";
static const char __pyx_k_blosclz[] = "blosclz";
static const char __pyx_k_boolarr[] = "boolarr";
static const char __pyx_k_cparams[] = "cparams";
static const char __pyx_k_ctbytes[] = "ctbytes";
static const char __pyx_k_datadir[] = "datadir";
static const char __pyx_k_dirname[] = "dirname";
static const char __pyx_k_dobject[] = "dobject";
static const char __pyx_k_flatten[] = "flatten";
static const char __pyx_k_getdata[] = "getdata";
static const char __pyx_k_getitem[] = "__getitem__";
static const char __pyx_k_indices[] = "indices";
static const char __pyx_k_integer[] = "integer";
static const char __pyx_k_mkdtemp[] = "mkdtemp";
static const char __pyx_k_nchunks[] = "nchunks";
static const char __pyx_k_os_path[] = "os.path";
static const char __pyx_k_reshape[] = "reshape";
static const char __pyx_k_rootdir[] = "rootdir";
static const char __pyx_k_shuffle[] = "shuffle";
static const char __pyx_k_squeeze[] = "squeeze";
static const char __pyx_k_storage[] = "storage";
static const char __pyx_k_strides[] = "strides";
static const char __pyx_k_ver_str[] = "ver_str";
static const char __pyx_k_version[] = "version";
static const char __pyx_k_xchunks[] = "xchunks";
static const char __pyx_k_DATA_DIR[] = "DATA_DIR";
static const char __pyx_k_META_DIR[] = "META_DIR";
static const char __pyx_k_SizeType[] = "SizeType";
static const char __pyx_k_chunklen[] = "chunklen";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_fourbyte[] = "fourbyte";
static const char __pyx_k_fromiter[] = "fromiter";
static const char __pyx_k_getudata[] = "getudata";
static const char __pyx_k_inttypes[] = "_inttypes";
static const char __pyx_k_itemsize[] = "itemsize";
static const char __pyx_k_metainfo[] = "metainfo";
static const char __pyx_k_nthreads[] = "nthreads";
static const char __pyx_k_quantize[] = "quantize";
static const char __pyx_k_tempfile[] = "tempfile";
static const char __pyx_k_typesize[] = "typesize";
static const char __pyx_k_ver_date[] = "ver_date";
static const char __pyx_k_EXTENSION[] = "EXTENSION";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_blocksize[] = "blocksize";
static const char __pyx_k_cparams_r[] = "  cparams := %r\n";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_hasobject[] = "hasobject";
static const char __pyx_k_init_iter[] = "_init_iter";
static const char __pyx_k_read_meta[] = "_read_meta";
static const char __pyx_k_rootdir_s[] = "  rootdir := '%s'\n";
static const char __pyx_k_store_obj[] = "_store_obj";
static const char __pyx_k_threading[] = "threading";
static const char __pyx_k_versionlz[] = "versionlz";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_MAX_CHUNKS[] = "MAX_CHUNKS";
static const char __pyx_k_MainThread[] = "MainThread";
static const char __pyx_k_SIZES_FILE[] = "SIZES_FILE";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_blosc_init[] = "_blosc_init";
static const char __pyx_k_carray_s_s[] = "carray(%s, %s)\n";
static const char __pyx_k_contiguous[] = "contiguous";
static const char __pyx_k_init_where[] = "_init_where";
static const char __pyx_k_list_compr[] = "list_compr";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_to_ndarray[] = "to_ndarray";
static const char __pyx_k_write_meta[] = "_write_meta";
static const char __pyx_k_decode_byte[] = "decode_byte";
static const char __pyx_k_expectedlen[] = "expectedlen";
static const char __pyx_k_fill_chunks[] = "_fill_chunks";
static const char __pyx_k_issubsctype[] = "issubsctype";
static const char __pyx_k_main_thread[] = "main_thread";
static const char __pyx_k_open_carray[] = "_open_carray";
static const char __pyx_k_use_threads[] = "use_threads";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_STORAGE_FILE[] = "STORAGE_FILE";
static const char __pyx_k_array2string[] = "array2string";
static const char __pyx_k_build_carray[] = "build_carray";
static const char __pyx_k_ensure_ascii[] = "ensure_ascii";
static const char __pyx_k_version_info[] = "version_info";
static const char __pyx_k_OverflowError[] = "OverflowError";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_blosc_destroy[] = "_blosc_destroy";
static const char __pyx_k_blosc_version[] = "blosc_version";
static const char __pyx_k_create_carray[] = "_create_carray";
static const char __pyx_k_decode_uint32[] = "decode_uint32";
static const char __pyx_k_free_cachemem[] = "free_cachemem";
static const char __pyx_k_i_nchunks_d_d[] = "i, nchunks: %d, %d";
static const char __pyx_k_use_threads_2[] = "_use_threads";
static const char __pyx_k_FORMAT_VERSION[] = "FORMAT_VERSION";
static const char __pyx_k_calc_chunksize[] = "calc_chunksize";
static const char __pyx_k_current_thread[] = "current_thread";
static const char __pyx_k_getitem_object[] = "_getitem_object";
static const char __pyx_k_init_wheretrue[] = "_init_wheretrue";
static const char __pyx_k_get_use_threads[] = "_get_use_threads";
static const char __pyx_k_HIGHEST_PROTOCOL[] = "HIGHEST_PROTOCOL";
static const char __pyx_k_bcolz_carray_ext[] = "bcolz.carray_ext";
static const char __pyx_k_key_not_suitable[] = "key not suitable:";
static const char __pyx_k_list_bytes_to_str[] = "list_bytes_to_str";
static const char __pyx_k_set_entire_carray[] = "_set_entire_carray";
static const char __pyx_k_update_disk_sizes[] = "_update_disk_sizes";
static const char __pyx_k_MAX_FORMAT_VERSION[] = "MAX_FORMAT_VERSION";
static const char __pyx_k_blosc_set_nthreads[] = "_blosc_set_nthreads";
static const char __pyx_k_index_out_of_range[] = "index out of range";
static const char __pyx_k_BLOSC_HEADER_LENGTH[] = "BLOSC_HEADER_LENGTH";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_human_readable_size[] = "human_readable_size";
static const char __pyx_k_key_not_supported_s[] = "key not supported: %s";
static const char __pyx_k_blosc_compressor_list[] = "blosc_compressor_list";
static const char __pyx_k_chunkfile_s_not_found[] = "chunkfile %s not found";
static const char __pyx_k_BLOSCPACK_HEADER_LENGTH[] = "BLOSCPACK_HEADER_LENGTH";
static const char __pyx_k_boolarr_is_not_an_array[] = "`boolarr` is not an array";
static const char __pyx_k_mode_should_be_r_w_or_a[] = "mode should be 'r', 'w' or 'a'";
static const char __pyx_k_is_not_a_supported_dtype[] = " is not a supported dtype";
static const char __pyx_k_empty_tuple_not_supported[] = "empty tuple not supported";
static const char __pyx_k_nitems_cannot_be_negative[] = "`nitems` cannot be negative";
static const char __pyx_k_nitems_must_be_an_integer[] = "`nitems` must be an integer";
static const char __pyx_k_atomic_size_cannot_be_zero[] = "atomic size cannot be zero";
static const char __pyx_k_nbytes_s_cbytes_s_ratio_2f[] = "  nbytes := %s; cbytes := %s; ratio: %.2f\n";
static const char __pyx_k_self_is_not_unidimensional[] = "`self` is not unidimensional";
static const char __pyx_k_chunk_filename_s_does_exist[] = "chunk filename %s does exist";
static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static const char __pyx_k_atomic_size_is_too_large_2_GB[] = "atomic size is too large (>= 2 GB)";
static const char __pyx_k_data_directory_does_not_exist[] = "data directory does not exist";
static const char __pyx_k_meta_directory_does_not_exist[] = "meta directory does not exist";
static const char __pyx_k_root_directory_does_not_exist[] = "root directory does not exist";
static const char __pyx_k_nchunks_must_be_in_the_range_0[] = "'nchunks' must be in the range 0 <= n <= %d, not '%s'";
static const char __pyx_k_nitems_must_be_less_than_total[] = "`nitems` must be less than total length";
static const char __pyx_k_private_tmp_bcolz_bcolz_carray[] = "/private/tmp/bcolz/bcolz/carray_ext.pyx";
static const char __pyx_k_array_dtype_does_not_match_with[] = "array dtype does not match with self";
static const char __pyx_k_boolarr_is_not_an_array_of_bool[] = "`boolarr` is not an array of booleans";
static const char __pyx_k_boolarr_must_be_of_the_same_len[] = "`boolarr` must be of the same length than ``self``";
static const char __pyx_k_boolean_array_length_must_match[] = "boolean array length must match len(self)";
static const char __pyx_k_boolean_expression_outcome_must[] = "boolean expression outcome must match len(self)";
static const char __pyx_k_cannot_modify_data_because_mode[] = "cannot modify data because mode is '%s'";
static const char __pyx_k_cannot_modify_the_rootdir_value[] = "cannot modify the rootdir value of an in-memory carray";
static const char __pyx_k_chunk_s_nbytes_d_cbytes_d_ratio[] = "chunk(%s)  nbytes: %d; cbytes: %d; ratio: %.2f\n%r";
static const char __pyx_k_chunklen_s_chunksize_s_blocksiz[] = "  chunklen := %s; chunksize: %s; blocksize: %s\n";
static const char __pyx_k_cparams_param_must_be_an_instan[] = "`cparams` param must be an instance of `cparams` class";
static const char __pyx_k_newshape_is_not_compatible_with[] = "`newshape` is not compatible with the current one";
static const char __pyx_k_only_one_shape_dimension_can_be[] = "only one shape dimension can be -1";
static const char __pyx_k_self_is_not_an_array_of_boolean[] = "`self` is not an array of booleans";
static const char __pyx_k_step_param_can_only_be_positive[] = "step param can only be positive";
static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static const char __pyx_k_Compressor_s_is_not_available_in[] = "Compressor '%s' is not available in this build";
static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static const char __pyx_k_The_size_cannot_be_larger_than_2[] = "The size cannot be larger than 2**31 on 32-bit platforms";
static const char __pyx_k_This_function_can_only_be_used_f[] = "This function can only be used for persistency";
static const char __pyx_k_You_need_at_least_to_pass_an_arr[] = "You need at least to pass an array or/and a rootdir";
static const char __pyx_k_array_trailing_dimensions_do_not[] = "array trailing dimensions do not match with self";
static const char __pyx_k_arrays_used_as_indices_must_be_i[] = "arrays used as indices must be integer (or boolean)";
static const char __pyx_k_arrays_used_as_indices_must_be_o[] = "arrays used as indices must be of integer (or boolean) type";
static const char __pyx_k_cannot_perform_reduce_with_flexi[] = "cannot perform reduce with flexible type";
static const char __pyx_k_chunklen_must_be_a_positive_inte[] = "chunklen must be a positive integer";
static const char __pyx_k_creating_carrays_from_scalar_obj[] = "creating carrays from scalar objects is not supported";
static const char __pyx_k_error_decompressing_the_last_chu[] = "error decompressing the last chunk (error code: %d)";
static const char __pyx_k_fatal_error_during_Blosc_compres[] = "fatal error during Blosc compression: %d";
static const char __pyx_k_fatal_error_during_Blosc_decompr[] = "fatal error during Blosc decompression: %d";
static const char __pyx_k_key_cannot_be_converted_to_an_ar[] = "key cannot be converted to an array of indices";
static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static const char __pyx_k_only_boolean_expressions_support[] = "only boolean expressions supported";
static const char __pyx_k_specified_rootdir_path_s_already[] = "specified rootdir path '%s' already exists and creation mode is '%s'";
static const char __pyx_k_step_in_slice_can_only_be_positi[] = "step in slice can only be positive";
static const char __pyx_k_typesize_is_d_and_bcolz_does_not[] = "typesize is %d and bcolz does not currently support data types larger than %d bytes";
static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static PyObject *__pyx_kp_s_B;
static PyObject *__pyx_n_s_BLOSCPACK_HEADER_LENGTH;
static PyObject *__pyx_n_s_BLOSC_HEADER_LENGTH;
static PyObject *__pyx_kp_s_Compressor_s_is_not_available_in;
static PyObject *__pyx_n_s_DATA_DIR;
static PyObject *__pyx_n_s_EXTENSION;
static PyObject *__pyx_n_s_FORMAT_VERSION;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
static PyObject *__pyx_n_s_HIGHEST_PROTOCOL;
static PyObject *__pyx_kp_s_I;
static PyObject *__pyx_n_s_IOError;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_n_s_IntType;
static PyObject *__pyx_n_s_KB;
static PyObject *__pyx_n_s_MAGIC;
static PyObject *__pyx_n_s_MAXINT;
static PyObject *__pyx_n_s_MAX_CHUNKS;
static PyObject *__pyx_n_s_MAX_FORMAT_VERSION;
static PyObject *__pyx_n_s_MB;
static PyObject *__pyx_n_s_META_DIR;
static PyObject *__pyx_n_s_MainThread;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_n_s_O;
static PyObject *__pyx_n_s_OverflowError;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_S;
static PyObject *__pyx_n_s_SIZES_FILE;
static PyObject *__pyx_n_s_STORAGE_FILE;
static PyObject *__pyx_n_s_SizeType;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_kp_s_The_size_cannot_be_larger_than_2;
static PyObject *__pyx_kp_s_This_function_can_only_be_used_f;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s_You_need_at_least_to_pass_an_arr;
static PyObject *__pyx_kp_s__112;
static PyObject *__pyx_kp_b__16;
static PyObject *__pyx_kp_s__3;
static PyObject *__pyx_kp_b__47;
static PyObject *__pyx_n_s_a;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_arange;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_array2string;
static PyObject *__pyx_kp_s_array_dtype_does_not_match_with;
static PyObject *__pyx_kp_s_array_trailing_dimensions_do_not;
static PyObject *__pyx_kp_s_arrays_used_as_indices_must_be_i;
static PyObject *__pyx_kp_s_arrays_used_as_indices_must_be_o;
static PyObject *__pyx_n_s_arrlen;
static PyObject *__pyx_n_s_ascii;
static PyObject *__pyx_n_s_astype;
static PyObject *__pyx_n_s_atom;
static PyObject *__pyx_kp_s_atomic_size_cannot_be_zero;
static PyObject *__pyx_kp_s_atomic_size_is_too_large_2_GB;
static PyObject *__pyx_n_s_attrs;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_bcolz;
static PyObject *__pyx_n_s_bcolz_carray_ext;
static PyObject *__pyx_n_s_blen;
static PyObject *__pyx_n_s_blocksize;
static PyObject *__pyx_n_s_blosc_compressor_list;
static PyObject *__pyx_n_s_blosc_destroy;
static PyObject *__pyx_n_s_blosc_init;
static PyObject *__pyx_n_s_blosc_set_nthreads;
static PyObject *__pyx_n_s_blosc_version;
static PyObject *__pyx_n_s_blosclz;
static PyObject *__pyx_kp_s_blp;
static PyObject *__pyx_n_b_blpk;
static PyObject *__pyx_n_s_bool;
static PyObject *__pyx_n_s_boolarr;
static PyObject *__pyx_kp_s_boolarr_is_not_an_array;
static PyObject *__pyx_kp_s_boolarr_is_not_an_array_of_bool;
static PyObject *__pyx_kp_s_boolarr_must_be_of_the_same_len;
static PyObject *__pyx_kp_s_boolean_array_length_must_match;
static PyObject *__pyx_kp_s_boolean_expression_outcome_must;
static PyObject *__pyx_n_s_buffer;
static PyObject *__pyx_n_s_build_carray;
static PyObject *__pyx_n_s_byte;
static PyObject *__pyx_n_s_calc_chunksize;
static PyObject *__pyx_kp_s_cannot_modify_data_because_mode;
static PyObject *__pyx_kp_s_cannot_modify_the_rootdir_value;
static PyObject *__pyx_kp_s_cannot_perform_reduce_with_flexi;
static PyObject *__pyx_kp_s_carray_s_s;
static PyObject *__pyx_n_s_cbytes;
static PyObject *__pyx_n_s_char;
static PyObject *__pyx_kp_s_chunk_filename_s_does_exist;
static PyObject *__pyx_kp_s_chunk_s_nbytes_d_cbytes_d_ratio;
static PyObject *__pyx_kp_s_chunkfile_s_not_found;
static PyObject *__pyx_n_s_chunklen;
static PyObject *__pyx_kp_s_chunklen_must_be_a_positive_inte;
static PyObject *__pyx_kp_s_chunklen_s_chunksize_s_blocksiz;
static PyObject *__pyx_n_s_clevel;
static PyObject *__pyx_n_s_clist;
static PyObject *__pyx_n_s_cname;
static PyObject *__pyx_n_s_compr;
static PyObject *__pyx_n_s_contiguous;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_cparams;
static PyObject *__pyx_kp_s_cparams_param_must_be_an_instan;
static PyObject *__pyx_kp_s_cparams_r;
static PyObject *__pyx_n_s_create_carray;
static PyObject *__pyx_kp_s_creating_carrays_from_scalar_obj;
static PyObject *__pyx_n_s_ctbytes;
static PyObject *__pyx_n_s_ctypes;
static PyObject *__pyx_n_s_current_thread;
static PyObject *__pyx_kp_s_d_s;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_kp_s_data_directory_does_not_exist;
static PyObject *__pyx_n_s_datadir;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_n_s_datetime;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_decode_byte;
static PyObject *__pyx_n_s_decode_uint32;
static PyObject *__pyx_n_s_dflt;
static PyObject *__pyx_n_s_dir;
static PyObject *__pyx_n_s_dirname;
static PyObject *__pyx_n_s_dobject;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dumps;
static PyObject *__pyx_n_s_empty;
static PyObject *__pyx_kp_s_empty_tuple_not_supported;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_ensure_ascii;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_kp_s_error_decompressing_the_last_chu;
static PyObject *__pyx_n_s_eval;
static PyObject *__pyx_n_s_exists;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_expectedlen;
static PyObject *__pyx_kp_s_fatal_error_during_Blosc_compres;
static PyObject *__pyx_kp_s_fatal_error_during_Blosc_decompr;
static PyObject *__pyx_n_s_fill_chunks;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_flatten;
static PyObject *__pyx_n_s_flush;
static PyObject *__pyx_n_s_fourbyte;
static PyObject *__pyx_n_s_free_cachemem;
static PyObject *__pyx_n_s_fromiter;
static PyObject *__pyx_n_s_get_use_threads;
static PyObject *__pyx_n_s_getdata;
static PyObject *__pyx_n_s_getitem;
static PyObject *__pyx_n_s_getitem_object;
static PyObject *__pyx_n_s_getudata;
static PyObject *__pyx_n_s_hasobject;
static PyObject *__pyx_n_s_hex;
static PyObject *__pyx_n_s_human_readable_size;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_kp_s_i_nchunks_d_d;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_kp_s_index_out_of_range;
static PyObject *__pyx_n_s_indices;
static PyObject *__pyx_n_s_init_iter;
static PyObject *__pyx_n_s_init_where;
static PyObject *__pyx_n_s_init_wheretrue;
static PyObject *__pyx_n_s_int;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_s_int64;
static PyObject *__pyx_n_s_integer;
static PyObject *__pyx_n_s_inttypes;
static PyObject *__pyx_kp_s_is_not_a_supported_dtype;
static PyObject *__pyx_n_s_isdir;
static PyObject *__pyx_n_s_issubsctype;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_itemsize;
static PyObject *__pyx_n_s_iter;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_json;
static PyObject *__pyx_kp_s_key_cannot_be_converted_to_an_ar;
static PyObject *__pyx_kp_s_key_not_suitable;
static PyObject *__pyx_kp_s_key_not_supported_s;
static PyObject *__pyx_n_s_kind;
static PyObject *__pyx_n_s_len;
static PyObject *__pyx_n_s_limit;
static PyObject *__pyx_n_s_list_bytes_to_str;
static PyObject *__pyx_n_s_list_compr;
static PyObject *__pyx_n_s_loads;
static PyObject *__pyx_n_s_lst;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_main_thread;
static PyObject *__pyx_n_s_maxint;
static PyObject *__pyx_n_s_memory;
static PyObject *__pyx_n_s_meta;
static PyObject *__pyx_kp_s_meta_directory_does_not_exist;
static PyObject *__pyx_n_s_metainfo;
static PyObject *__pyx_n_s_mkdir;
static PyObject *__pyx_n_s_mkdirs;
static PyObject *__pyx_n_s_mkdtemp;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_kp_s_mode_s;
static PyObject *__pyx_kp_s_mode_should_be_r_w_or_a;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_nan;
static PyObject *__pyx_n_s_nbytes;
static PyObject *__pyx_kp_s_nbytes_s_cbytes_s_ratio_2f;
static PyObject *__pyx_n_s_nchunks;
static PyObject *__pyx_kp_s_nchunks_must_be_in_the_range_0;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
static PyObject *__pyx_n_s_ndim;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_kp_s_newshape_is_not_compatible_with;
static PyObject *__pyx_n_s_next;
static PyObject *__pyx_kp_s_nitems_cannot_be_negative;
static PyObject *__pyx_kp_s_nitems_must_be_an_integer;
static PyObject *__pyx_kp_s_nitems_must_be_less_than_total;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_nthreads;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_kp_s_only_boolean_expressions_support;
static PyObject *__pyx_kp_s_only_one_shape_dimension_can_be;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_open_carray;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_os_path;
static PyObject *__pyx_n_s_out;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_kp_s_private_tmp_bcolz_bcolz_carray;
static PyObject *__pyx_n_s_prod;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_kp_s_q;
static PyObject *__pyx_n_s_quantize;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_rb;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_read_meta;
static PyObject *__pyx_n_s_remove;
static PyObject *__pyx_n_s_rename;
static PyObject *__pyx_n_s_reshape;
static PyObject *__pyx_n_s_resize;
static PyObject *__pyx_n_s_rmtree;
static PyObject *__pyx_kp_s_root_directory_does_not_exist;
static PyObject *__pyx_n_s_rootdir;
static PyObject *__pyx_kp_s_rootdir_s;
static PyObject *__pyx_n_s_safe;
static PyObject *__pyx_n_s_seek;
static PyObject *__pyx_kp_s_self_is_not_an_array_of_boolean;
static PyObject *__pyx_kp_s_self_is_not_unidimensional;
static PyObject *__pyx_n_s_set_entire_carray;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_shuffle;
static PyObject *__pyx_n_s_shutil;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_sizes;
static PyObject *__pyx_n_s_skip;
static PyObject *__pyx_kp_s_specified_rootdir_path_s_already;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_squeeze;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_kp_s_step_in_slice_can_only_be_positi;
static PyObject *__pyx_kp_s_step_param_can_only_be_positive;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_n_s_storage;
static PyObject *__pyx_n_s_store_obj;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_s_strides;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_suffix;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_tb;
static PyObject *__pyx_n_s_temp;
static PyObject *__pyx_n_s_tempfile;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_threading;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_to_ndarray;
static PyObject *__pyx_n_s_tolist;
static PyObject *__pyx_n_s_trim;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_typesize;
static PyObject *__pyx_kp_s_typesize_is_d_and_bcolz_does_not;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_n_s_unpack;
static PyObject *__pyx_n_s_update_disk_sizes;
static PyObject *__pyx_n_s_use_threads;
static PyObject *__pyx_n_s_use_threads_2;
static PyObject *__pyx_n_s_utils;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_ver_date;
static PyObject *__pyx_n_s_ver_str;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_version_info;
static PyObject *__pyx_n_s_versionlz;
static PyObject *__pyx_n_s_view;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_wb;
static PyObject *__pyx_n_s_where;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_write_meta;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xchunks;
static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_zeros;
static PyObject *__pyx_pf_5bcolz_10carray_ext_blosc_compressor_list(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_2_blosc_set_nthreads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nthreads); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_4_blosc_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6_blosc_destroy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_8blosc_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_10list_bytes_to_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lst); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_12_get_use_threads(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_5dtype___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_5chunk___cinit__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_dobject, PyObject *__pyx_v_atom, PyObject *__pyx_v_cparams, PyObject *__pyx_v__memory, PyObject *__pyx_v__compr); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_2getdata(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_4getudata(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_6__getitem__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_5chunk_8__setitem__(CYTHON_UNUSED struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_key, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_10__str__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_12__repr__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_8atomsize___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_5chunk_8atomsize_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_8itemsize___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_5chunk_8itemsize_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_9blocksize___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_5chunk_9blocksize_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_6nbytes___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_5chunk_6nbytes_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_6cbytes___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_5chunk_6cbytes_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_14decode_byte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_byte); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_16decode_byte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_byte); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_18decode_uint32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fourbyte); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_4mode___get__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6chunks_4mode_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_7rootdir___get__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6chunks_7rootdir_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_7datadir___get__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6chunks___cinit__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_rootdir, PyObject *__pyx_v_metainfo, PyObject *__pyx_v__new); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_2__iter__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_4__next__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_6__getitem__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_nchunk); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6chunks_8__setitem__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_nchunk, PyObject *__pyx_v_chunk_); /* proto */
static Py_ssize_t __pyx_pf_5bcolz_10carray_ext_6chunks_10__len__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_12free_cachemem(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_14append(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_chunk_); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_16flush(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_chunk_); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_18pop(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_12leftover_ptr___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_14leftover_array___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_14leftover_bytes___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_17leftover_elements___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_7nchunks___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_10partitions___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_5attrs___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_6cbytes___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_8chunklen___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_7cparams___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4dflt___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_5dtype___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_3len___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4mode___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6carray_4mode_2__set__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_6nbytes___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_9nleftover___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4ndim___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4safe___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_5shape___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4size___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_7rootdir___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6carray_7rootdir_2__set__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6carray___cinit__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_array, PyObject *__pyx_v_cparams, PyObject *__pyx_v_dtype, PyObject *__pyx_v_dflt, PyObject *__pyx_v_expectedlen, PyObject *__pyx_v_chunklen, PyObject *__pyx_v_rootdir, PyObject *__pyx_v_safe, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_2_create_carray(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_array, PyObject *__pyx_v_cparams, PyObject *__pyx_v_dtype, PyObject *__pyx_v_dflt, PyObject *__pyx_v_expectedlen, PyObject *__pyx_v_chunklen, PyObject *__pyx_v_rootdir, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4_open_carray(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_cparams, PyObject *__pyx_v_dtype, PyObject *__pyx_v_dflt, PyObject *__pyx_v_expectedlen, PyObject *__pyx_v_cbytes, PyObject *__pyx_v_chunklen, PyObject *__pyx_v_xchunks); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_6_fill_chunks(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_array_); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_8_mkdirs(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_rootdir, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_10_write_meta(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_12_read_meta(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_14_store_obj(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_arrobj); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_16append(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_array); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_18trim(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_nitems); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_20resize(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_nitems); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_22reshape(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_newshape); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_24copy(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_26view(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_28sum(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static Py_ssize_t __pyx_pf_5bcolz_10carray_ext_6carray_30__len__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_32__sizeof__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_34free_cachemem(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_36_getitem_object(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_38__getitem__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6carray_40__setitem__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_42_set_entire_carray(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_44_getrange(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, npy_intp __pyx_v_start, npy_intp __pyx_v_blen, PyArrayObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_46__iter__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_48iter(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip, PyObject *__pyx_v__next); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_50_init_iter(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_52wheretrue(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_54_init_wheretrue(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_56where(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_boolarr, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_58_init_where(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_boolarr, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_60__next__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_62_update_disk_sizes(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_64flush(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_66purge(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_68__str__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_70__repr__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_72__reduce__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_74__enter__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_76__exit__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_78__array__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_dtype, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_8itemsize___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6carray_8itemsize_2__set__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_8atomsize___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6carray_8atomsize_2__set__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_6chunks___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6carray_6chunks_2__set__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5bcolz_10carray_ext_6carray_6chunks_4__del__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_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 PyObject *__pyx_tp_new_5bcolz_10carray_ext_chunk(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5bcolz_10carray_ext_chunks(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5bcolz_10carray_ext_carray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0};
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_12;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_64;
static PyObject *__pyx_int_255;
static PyObject *__pyx_int_1024;
static PyObject *__pyx_int_2147483647;
static PyObject *__pyx_int_2147483648;
static PyObject *__pyx_int_9223372036854775807;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_k__15;
static PyObject *__pyx_codeobj_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_slice__14;
static PyObject *__pyx_slice__21;
static PyObject *__pyx_slice__22;
static PyObject *__pyx_slice__23;
static PyObject *__pyx_slice__30;
static PyObject *__pyx_slice__32;
static PyObject *__pyx_slice__39;
static PyObject *__pyx_slice__43;
static PyObject *__pyx_slice__57;
static PyObject *__pyx_slice__63;
static PyObject *__pyx_slice__69;
static PyObject *__pyx_slice__76;
static PyObject *__pyx_slice__80;
static PyObject *__pyx_slice__82;
static PyObject *__pyx_slice__83;
static PyObject *__pyx_slice__92;
static PyObject *__pyx_slice__94;
static PyObject *__pyx_slice__95;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_codeobj__5;
static PyObject *__pyx_codeobj__6;
static PyObject *__pyx_codeobj__7;
static PyObject *__pyx_codeobj__8;
static PyObject *__pyx_codeobj__9;
static PyObject *__pyx_slice__101;
static PyObject *__pyx_slice__102;
static PyObject *__pyx_slice__116;
static PyObject *__pyx_slice__117;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_codeobj__11;
static PyObject *__pyx_codeobj__17;
static PyObject *__pyx_codeobj__18;
static PyObject *__pyx_codeobj__20;

/* "bcolz/carray_ext.pyx":143
 * 
 * # Some utilities
 * def blosc_compressor_list():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_compressor_list()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_1blosc_compressor_list(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_blosc_compressor_list[] = "blosc_compressor_list()\n\n    blosc_compressor_list()\n\n    Returns a list of compressors available in the Blosc build.\n\n    Parameters\n    ----------\n    None\n\n    Returns\n    -------\n    out : list\n        The list of names.\n    ";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_1blosc_compressor_list = {"blosc_compressor_list", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_1blosc_compressor_list, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_blosc_compressor_list};
static PyObject *__pyx_pw_5bcolz_10carray_ext_1blosc_compressor_list(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("blosc_compressor_list (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_blosc_compressor_list(__pyx_self);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_blosc_compressor_list(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_list_compr = NULL;
  PyObject *__pyx_v_clist = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_TraceFrameInit(__pyx_codeobj_)
  __Pyx_RefNannySetupContext("blosc_compressor_list", 0);
  __Pyx_TraceCall("blosc_compressor_list", __pyx_f[0], 143, 0, __PYX_ERR(0, 143, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":158
 *         The list of names.
 *     """
 *     list_compr = blosc_list_compressors()             # <<<<<<<<<<<<<<
 *     if sys.version_info >= (3, 0):
 *         # Convert compressor names into regular strings in Python 3 (unicode)
 */
  __Pyx_TraceLine(158,0,__PYX_ERR(0, 158, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyBytes_FromString(blosc_list_compressors()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_list_compr = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":159
 *     """
 *     list_compr = blosc_list_compressors()
 *     if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *         # Convert compressor names into regular strings in Python 3 (unicode)
 *         list_compr = list_compr.decode()
 */
  __Pyx_TraceLine(159,0,__PYX_ERR(0, 159, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__2, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __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_ERR(0, 159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":161
 *     if sys.version_info >= (3, 0):
 *         # Convert compressor names into regular strings in Python 3 (unicode)
 *         list_compr = list_compr.decode()             # <<<<<<<<<<<<<<
 *     clist = list_compr.split(',')
 *     return clist
 */
    __Pyx_TraceLine(161,0,__PYX_ERR(0, 161, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_list_compr, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_list_compr, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":159
 *     """
 *     list_compr = blosc_list_compressors()
 *     if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *         # Convert compressor names into regular strings in Python 3 (unicode)
 *         list_compr = list_compr.decode()
 */
  }

  /* "bcolz/carray_ext.pyx":162
 *         # Convert compressor names into regular strings in Python 3 (unicode)
 *         list_compr = list_compr.decode()
 *     clist = list_compr.split(',')             # <<<<<<<<<<<<<<
 *     return clist
 * 
 */
  __Pyx_TraceLine(162,0,__PYX_ERR(0, 162, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_list_compr, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_clist = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":163
 *         list_compr = list_compr.decode()
 *     clist = list_compr.split(',')
 *     return clist             # <<<<<<<<<<<<<<
 * 
 * def _blosc_set_nthreads(nthreads):
 */
  __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_clist);
  __pyx_r = __pyx_v_clist;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":143
 * 
 * # Some utilities
 * def blosc_compressor_list():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_compressor_list()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bcolz.carray_ext.blosc_compressor_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_list_compr);
  __Pyx_XDECREF(__pyx_v_clist);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":165
 *     return clist
 * 
 * def _blosc_set_nthreads(nthreads):             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_set_nthreads(nthreads)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_3_blosc_set_nthreads(PyObject *__pyx_self, PyObject *__pyx_v_nthreads); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_2_blosc_set_nthreads[] = "_blosc_set_nthreads(nthreads)\n\n    _blosc_set_nthreads(nthreads)\n\n    Sets the number of threads that Blosc can use.\n\n    Parameters\n    ----------\n    nthreads : int\n        The desired number of threads to use.\n\n    Returns\n    -------\n    out : int\n        The previous setting for the number of threads.\n    ";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_3_blosc_set_nthreads = {"_blosc_set_nthreads", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_3_blosc_set_nthreads, METH_O, __pyx_doc_5bcolz_10carray_ext_2_blosc_set_nthreads};
static PyObject *__pyx_pw_5bcolz_10carray_ext_3_blosc_set_nthreads(PyObject *__pyx_self, PyObject *__pyx_v_nthreads) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_blosc_set_nthreads (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_2_blosc_set_nthreads(__pyx_self, ((PyObject *)__pyx_v_nthreads));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_2_blosc_set_nthreads(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nthreads) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_TraceFrameInit(__pyx_codeobj__5)
  __Pyx_RefNannySetupContext("_blosc_set_nthreads", 0);
  __Pyx_TraceCall("_blosc_set_nthreads", __pyx_f[0], 165, 0, __PYX_ERR(0, 165, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":181
 *         The previous setting for the number of threads.
 *     """
 *     return blosc_set_nthreads(nthreads)             # <<<<<<<<<<<<<<
 * 
 * def _blosc_init():
 */
  __Pyx_TraceLine(181,0,__PYX_ERR(0, 181, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_nthreads); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_int(blosc_set_nthreads(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":165
 *     return clist
 * 
 * def _blosc_set_nthreads(nthreads):             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_set_nthreads(nthreads)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bcolz.carray_ext._blosc_set_nthreads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":183
 *     return blosc_set_nthreads(nthreads)
 * 
 * def _blosc_init():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_init()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5_blosc_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_4_blosc_init[] = "_blosc_init()\n\n    _blosc_init()\n\n    Initialize the Blosc library.\n\n    ";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_5_blosc_init = {"_blosc_init", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_5_blosc_init, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_4_blosc_init};
static PyObject *__pyx_pw_5bcolz_10carray_ext_5_blosc_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_blosc_init (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_4_blosc_init(__pyx_self);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_4_blosc_init(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_TraceFrameInit(__pyx_codeobj__6)
  __Pyx_RefNannySetupContext("_blosc_init", 0);
  __Pyx_TraceCall("_blosc_init", __pyx_f[0], 183, 0, __PYX_ERR(0, 183, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":190
 * 
 *     """
 *     blosc_init()             # <<<<<<<<<<<<<<
 * 
 * def _blosc_destroy():
 */
  __Pyx_TraceLine(190,0,__PYX_ERR(0, 190, __pyx_L1_error))
  blosc_init();

  /* "bcolz/carray_ext.pyx":183
 *     return blosc_set_nthreads(nthreads)
 * 
 * def _blosc_init():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_init()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext._blosc_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":192
 *     blosc_init()
 * 
 * def _blosc_destroy():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_destroy()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_7_blosc_destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6_blosc_destroy[] = "_blosc_destroy()\n\n    _blosc_destroy()\n\n    Finalize the Blosc library.\n\n    ";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_7_blosc_destroy = {"_blosc_destroy", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_7_blosc_destroy, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6_blosc_destroy};
static PyObject *__pyx_pw_5bcolz_10carray_ext_7_blosc_destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_blosc_destroy (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6_blosc_destroy(__pyx_self);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6_blosc_destroy(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_TraceFrameInit(__pyx_codeobj__7)
  __Pyx_RefNannySetupContext("_blosc_destroy", 0);
  __Pyx_TraceCall("_blosc_destroy", __pyx_f[0], 192, 0, __PYX_ERR(0, 192, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":199
 * 
 *     """
 *     blosc_destroy()             # <<<<<<<<<<<<<<
 * 
 * def blosc_version():
 */
  __Pyx_TraceLine(199,0,__PYX_ERR(0, 199, __pyx_L1_error))
  blosc_destroy();

  /* "bcolz/carray_ext.pyx":192
 *     blosc_init()
 * 
 * def _blosc_destroy():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_destroy()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext._blosc_destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":201
 *     blosc_destroy()
 * 
 * def blosc_version():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_version()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_9blosc_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_8blosc_version[] = "blosc_version()\n\n    blosc_version()\n\n    Return the version of the Blosc library.\n\n    ";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_9blosc_version = {"blosc_version", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_9blosc_version, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_8blosc_version};
static PyObject *__pyx_pw_5bcolz_10carray_ext_9blosc_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("blosc_version (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_8blosc_version(__pyx_self);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_8blosc_version(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_ver_str = NULL;
  PyObject *__pyx_v_ver_date = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_TraceFrameInit(__pyx_codeobj__8)
  __Pyx_RefNannySetupContext("blosc_version", 0);
  __Pyx_TraceCall("blosc_version", __pyx_f[0], 201, 0, __PYX_ERR(0, 201, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":209
 *     """
 *     # All the 'decode' contorsions are for Python 3 returning actual strings
 *     ver_str = <char *> BLOSC_VERSION_STRING             # <<<<<<<<<<<<<<
 *     if hasattr(ver_str, "decode"):
 *         ver_str = ver_str.decode()
 */
  __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyBytes_FromString(((char *)BLOSC_VERSION_STRING)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ver_str = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":210
 *     # All the 'decode' contorsions are for Python 3 returning actual strings
 *     ver_str = <char *> BLOSC_VERSION_STRING
 *     if hasattr(ver_str, "decode"):             # <<<<<<<<<<<<<<
 *         ver_str = ver_str.decode()
 *     ver_date = <char *> BLOSC_VERSION_DATE
 */
  __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error))
  __pyx_t_2 = PyObject_HasAttr(__pyx_v_ver_str, __pyx_n_s_decode); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 210, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":211
 *     ver_str = <char *> BLOSC_VERSION_STRING
 *     if hasattr(ver_str, "decode"):
 *         ver_str = ver_str.decode()             # <<<<<<<<<<<<<<
 *     ver_date = <char *> BLOSC_VERSION_DATE
 *     if hasattr(ver_date, "decode"):
 */
    __Pyx_TraceLine(211,0,__PYX_ERR(0, 211, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ver_str, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_ver_str, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":210
 *     # All the 'decode' contorsions are for Python 3 returning actual strings
 *     ver_str = <char *> BLOSC_VERSION_STRING
 *     if hasattr(ver_str, "decode"):             # <<<<<<<<<<<<<<
 *         ver_str = ver_str.decode()
 *     ver_date = <char *> BLOSC_VERSION_DATE
 */
  }

  /* "bcolz/carray_ext.pyx":212
 *     if hasattr(ver_str, "decode"):
 *         ver_str = ver_str.decode()
 *     ver_date = <char *> BLOSC_VERSION_DATE             # <<<<<<<<<<<<<<
 *     if hasattr(ver_date, "decode"):
 *         ver_date = ver_date.decode()
 */
  __Pyx_TraceLine(212,0,__PYX_ERR(0, 212, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyBytes_FromString(((char *)BLOSC_VERSION_DATE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ver_date = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":213
 *         ver_str = ver_str.decode()
 *     ver_date = <char *> BLOSC_VERSION_DATE
 *     if hasattr(ver_date, "decode"):             # <<<<<<<<<<<<<<
 *         ver_date = ver_date.decode()
 *     return (ver_str, ver_date)
 */
  __Pyx_TraceLine(213,0,__PYX_ERR(0, 213, __pyx_L1_error))
  __pyx_t_3 = PyObject_HasAttr(__pyx_v_ver_date, __pyx_n_s_decode); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 213, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":214
 *     ver_date = <char *> BLOSC_VERSION_DATE
 *     if hasattr(ver_date, "decode"):
 *         ver_date = ver_date.decode()             # <<<<<<<<<<<<<<
 *     return (ver_str, ver_date)
 * 
 */
    __Pyx_TraceLine(214,0,__PYX_ERR(0, 214, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ver_date, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_ver_date, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":213
 *         ver_str = ver_str.decode()
 *     ver_date = <char *> BLOSC_VERSION_DATE
 *     if hasattr(ver_date, "decode"):             # <<<<<<<<<<<<<<
 *         ver_date = ver_date.decode()
 *     return (ver_str, ver_date)
 */
  }

  /* "bcolz/carray_ext.pyx":215
 *     if hasattr(ver_date, "decode"):
 *         ver_date = ver_date.decode()
 *     return (ver_str, ver_date)             # <<<<<<<<<<<<<<
 * 
 * def list_bytes_to_str(lst):
 */
  __Pyx_TraceLine(215,0,__PYX_ERR(0, 215, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_ver_str);
  __Pyx_GIVEREF(__pyx_v_ver_str);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ver_str);
  __Pyx_INCREF(__pyx_v_ver_date);
  __Pyx_GIVEREF(__pyx_v_ver_date);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ver_date);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":201
 *     blosc_destroy()
 * 
 * def blosc_version():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_version()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bcolz.carray_ext.blosc_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ver_str);
  __Pyx_XDECREF(__pyx_v_ver_date);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":217
 *     return (ver_str, ver_date)
 * 
 * def list_bytes_to_str(lst):             # <<<<<<<<<<<<<<
 *     """The Python 3 JSON encoder doesn't accept 'bytes' objects,
 *     this utility function converts all bytes to strings.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_11list_bytes_to_str(PyObject *__pyx_self, PyObject *__pyx_v_lst); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_10list_bytes_to_str[] = "list_bytes_to_str(lst)\nThe Python 3 JSON encoder doesn't accept 'bytes' objects,\n    this utility function converts all bytes to strings.\n    ";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_11list_bytes_to_str = {"list_bytes_to_str", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_11list_bytes_to_str, METH_O, __pyx_doc_5bcolz_10carray_ext_10list_bytes_to_str};
static PyObject *__pyx_pw_5bcolz_10carray_ext_11list_bytes_to_str(PyObject *__pyx_self, PyObject *__pyx_v_lst) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list_bytes_to_str (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_10list_bytes_to_str(__pyx_self, ((PyObject *)__pyx_v_lst));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_10list_bytes_to_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lst) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_TraceFrameInit(__pyx_codeobj__9)
  __Pyx_RefNannySetupContext("list_bytes_to_str", 0);
  __Pyx_TraceCall("list_bytes_to_str", __pyx_f[0], 217, 0, __PYX_ERR(0, 217, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":221
 *     this utility function converts all bytes to strings.
 *     """
 *     if isinstance(lst, bytes):             # <<<<<<<<<<<<<<
 *         return lst.decode('ascii')
 *     elif isinstance(lst, list):
 */
  __Pyx_TraceLine(221,0,__PYX_ERR(0, 221, __pyx_L1_error))
  __pyx_t_1 = PyBytes_Check(__pyx_v_lst); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":222
 *     """
 *     if isinstance(lst, bytes):
 *         return lst.decode('ascii')             # <<<<<<<<<<<<<<
 *     elif isinstance(lst, list):
 *         return [list_bytes_to_str(x) for x in lst]
 */
    __Pyx_TraceLine(222,0,__PYX_ERR(0, 222, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_lst, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":221
 *     this utility function converts all bytes to strings.
 *     """
 *     if isinstance(lst, bytes):             # <<<<<<<<<<<<<<
 *         return lst.decode('ascii')
 *     elif isinstance(lst, list):
 */
  }

  /* "bcolz/carray_ext.pyx":223
 *     if isinstance(lst, bytes):
 *         return lst.decode('ascii')
 *     elif isinstance(lst, list):             # <<<<<<<<<<<<<<
 *         return [list_bytes_to_str(x) for x in lst]
 *     else:
 */
  __Pyx_TraceLine(223,0,__PYX_ERR(0, 223, __pyx_L1_error))
  __pyx_t_2 = PyList_Check(__pyx_v_lst); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":224
 *         return lst.decode('ascii')
 *     elif isinstance(lst, list):
 *         return [list_bytes_to_str(x) for x in lst]             # <<<<<<<<<<<<<<
 *     else:
 *         return lst
 */
    __Pyx_TraceLine(224,0,__PYX_ERR(0, 224, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_lst)) || PyTuple_CheckExact(__pyx_v_lst)) {
      __pyx_t_3 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_lst); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 224, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 224, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 224, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 224, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 224, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_3);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 224, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_bytes_to_str); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      } else {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_v_x);
        __Pyx_GIVEREF(__pyx_v_x);
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_x);
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 224, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":223
 *     if isinstance(lst, bytes):
 *         return lst.decode('ascii')
 *     elif isinstance(lst, list):             # <<<<<<<<<<<<<<
 *         return [list_bytes_to_str(x) for x in lst]
 *     else:
 */
  }

  /* "bcolz/carray_ext.pyx":226
 *         return [list_bytes_to_str(x) for x in lst]
 *     else:
 *         return lst             # <<<<<<<<<<<<<<
 * 
 * # This is the same than in utils.py, but works faster in extensions
 */
  __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_lst);
    __pyx_r = __pyx_v_lst;
    goto __pyx_L0;
  }

  /* "bcolz/carray_ext.pyx":217
 *     return (ver_str, ver_date)
 * 
 * def list_bytes_to_str(lst):             # <<<<<<<<<<<<<<
 *     """The Python 3 JSON encoder doesn't accept 'bytes' objects,
 *     this utility function converts all bytes to strings.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("bcolz.carray_ext.list_bytes_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":229
 * 
 * # This is the same than in utils.py, but works faster in extensions
 * cdef get_len_of_range(npy_intp start, npy_intp stop, npy_intp step):             # <<<<<<<<<<<<<<
 *     """Get the length of a (start, stop, step) range."""
 *     cdef npy_intp n
 */

static PyObject *__pyx_f_5bcolz_10carray_ext_get_len_of_range(npy_intp __pyx_v_start, npy_intp __pyx_v_stop, npy_intp __pyx_v_step) {
  npy_intp __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_len_of_range", 0);
  __Pyx_TraceCall("get_len_of_range", __pyx_f[0], 229, 0, __PYX_ERR(0, 229, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":233
 *     cdef npy_intp n
 * 
 *     n = 0             # <<<<<<<<<<<<<<
 *     if start < stop:
 *         # Do not use a cython.cdiv here (do not ask me why!)
 */
  __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
  __pyx_v_n = 0;

  /* "bcolz/carray_ext.pyx":234
 * 
 *     n = 0
 *     if start < stop:             # <<<<<<<<<<<<<<
 *         # Do not use a cython.cdiv here (do not ask me why!)
 *         n = ((stop - start - 1) // step + 1)
 */
  __Pyx_TraceLine(234,0,__PYX_ERR(0, 234, __pyx_L1_error))
  __pyx_t_1 = ((__pyx_v_start < __pyx_v_stop) != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":236
 *     if start < stop:
 *         # Do not use a cython.cdiv here (do not ask me why!)
 *         n = ((stop - start - 1) // step + 1)             # <<<<<<<<<<<<<<
 *     return n
 * 
 */
    __Pyx_TraceLine(236,0,__PYX_ERR(0, 236, __pyx_L1_error))
    __pyx_t_2 = ((__pyx_v_stop - __pyx_v_start) - 1);
    if (unlikely(__pyx_v_step == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 236, __pyx_L1_error)
    }
    else if (sizeof(long) == sizeof(long) && (!(((npy_intp)-1) > 0)) && unlikely(__pyx_v_step == (npy_intp)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_2))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(0, 236, __pyx_L1_error)
    }
    __pyx_v_n = (__Pyx_div_long(__pyx_t_2, __pyx_v_step) + 1);

    /* "bcolz/carray_ext.pyx":234
 * 
 *     n = 0
 *     if start < stop:             # <<<<<<<<<<<<<<
 *         # Do not use a cython.cdiv here (do not ask me why!)
 *         n = ((stop - start - 1) // step + 1)
 */
  }

  /* "bcolz/carray_ext.pyx":237
 *         # Do not use a cython.cdiv here (do not ask me why!)
 *         n = ((stop - start - 1) // step + 1)
 *     return n             # <<<<<<<<<<<<<<
 * 
 * cdef clip_chunk(npy_intp nchunk, npy_intp chunklen,
 */
  __Pyx_TraceLine(237,0,__PYX_ERR(0, 237, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":229
 * 
 * # This is the same than in utils.py, but works faster in extensions
 * cdef get_len_of_range(npy_intp start, npy_intp stop, npy_intp step):             # <<<<<<<<<<<<<<
 *     """Get the length of a (start, stop, step) range."""
 *     cdef npy_intp n
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bcolz.carray_ext.get_len_of_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":239
 *     return n
 * 
 * cdef clip_chunk(npy_intp nchunk, npy_intp chunklen,             # <<<<<<<<<<<<<<
 *                 npy_intp start, npy_intp stop, npy_intp step):
 *     """Get the limits of a certain chunk based on its length."""
 */

static PyObject *__pyx_f_5bcolz_10carray_ext_clip_chunk(npy_intp __pyx_v_nchunk, npy_intp __pyx_v_chunklen, npy_intp __pyx_v_start, npy_intp __pyx_v_stop, npy_intp __pyx_v_step) {
  npy_intp __pyx_v_startb;
  npy_intp __pyx_v_stopb;
  npy_intp __pyx_v_blen;
  npy_intp __pyx_v_distance;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  npy_intp __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("clip_chunk", 0);
  __Pyx_TraceCall("clip_chunk", __pyx_f[0], 239, 0, __PYX_ERR(0, 239, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":244
 *     cdef npy_intp startb, stopb, blen, distance
 * 
 *     startb = start - nchunk * chunklen             # <<<<<<<<<<<<<<
 *     stopb = stop - nchunk * chunklen
 * 
 */
  __Pyx_TraceLine(244,0,__PYX_ERR(0, 244, __pyx_L1_error))
  __pyx_v_startb = (__pyx_v_start - (__pyx_v_nchunk * __pyx_v_chunklen));

  /* "bcolz/carray_ext.pyx":245
 * 
 *     startb = start - nchunk * chunklen
 *     stopb = stop - nchunk * chunklen             # <<<<<<<<<<<<<<
 * 
 *     # Check limits
 */
  __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
  __pyx_v_stopb = (__pyx_v_stop - (__pyx_v_nchunk * __pyx_v_chunklen));

  /* "bcolz/carray_ext.pyx":248
 * 
 *     # Check limits
 *     if (startb >= chunklen) or (stopb <= 0):             # <<<<<<<<<<<<<<
 *         return startb, stopb, 0  # null size
 *     if startb < 0:
 */
  __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
  __pyx_t_2 = ((__pyx_v_startb >= __pyx_v_chunklen) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_stopb <= 0) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":249
 *     # Check limits
 *     if (startb >= chunklen) or (stopb <= 0):
 *         return startb, stopb, 0  # null size             # <<<<<<<<<<<<<<
 *     if startb < 0:
 *         startb = 0
 */
    __Pyx_TraceLine(249,0,__PYX_ERR(0, 249, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_stopb); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":248
 * 
 *     # Check limits
 *     if (startb >= chunklen) or (stopb <= 0):             # <<<<<<<<<<<<<<
 *         return startb, stopb, 0  # null size
 *     if startb < 0:
 */
  }

  /* "bcolz/carray_ext.pyx":250
 *     if (startb >= chunklen) or (stopb <= 0):
 *         return startb, stopb, 0  # null size
 *     if startb < 0:             # <<<<<<<<<<<<<<
 *         startb = 0
 *     if stopb > chunklen:
 */
  __Pyx_TraceLine(250,0,__PYX_ERR(0, 250, __pyx_L1_error))
  __pyx_t_1 = ((__pyx_v_startb < 0) != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":251
 *         return startb, stopb, 0  # null size
 *     if startb < 0:
 *         startb = 0             # <<<<<<<<<<<<<<
 *     if stopb > chunklen:
 *         stopb = chunklen
 */
    __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
    __pyx_v_startb = 0;

    /* "bcolz/carray_ext.pyx":250
 *     if (startb >= chunklen) or (stopb <= 0):
 *         return startb, stopb, 0  # null size
 *     if startb < 0:             # <<<<<<<<<<<<<<
 *         startb = 0
 *     if stopb > chunklen:
 */
  }

  /* "bcolz/carray_ext.pyx":252
 *     if startb < 0:
 *         startb = 0
 *     if stopb > chunklen:             # <<<<<<<<<<<<<<
 *         stopb = chunklen
 * 
 */
  __Pyx_TraceLine(252,0,__PYX_ERR(0, 252, __pyx_L1_error))
  __pyx_t_1 = ((__pyx_v_stopb > __pyx_v_chunklen) != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":253
 *         startb = 0
 *     if stopb > chunklen:
 *         stopb = chunklen             # <<<<<<<<<<<<<<
 * 
 *     # step corrections
 */
    __Pyx_TraceLine(253,0,__PYX_ERR(0, 253, __pyx_L1_error))
    __pyx_v_stopb = __pyx_v_chunklen;

    /* "bcolz/carray_ext.pyx":252
 *     if startb < 0:
 *         startb = 0
 *     if stopb > chunklen:             # <<<<<<<<<<<<<<
 *         stopb = chunklen
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":256
 * 
 *     # step corrections
 *     if step > 1:             # <<<<<<<<<<<<<<
 *         # Just correcting startb is enough
 *         distance = (nchunk * chunklen + startb) - start
 */
  __Pyx_TraceLine(256,0,__PYX_ERR(0, 256, __pyx_L1_error))
  __pyx_t_1 = ((__pyx_v_step > 1) != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":258
 *     if step > 1:
 *         # Just correcting startb is enough
 *         distance = (nchunk * chunklen + startb) - start             # <<<<<<<<<<<<<<
 *         if distance % step > 0:
 *             startb += (step - (distance % step))
 */
    __Pyx_TraceLine(258,0,__PYX_ERR(0, 258, __pyx_L1_error))
    __pyx_v_distance = (((__pyx_v_nchunk * __pyx_v_chunklen) + __pyx_v_startb) - __pyx_v_start);

    /* "bcolz/carray_ext.pyx":259
 *         # Just correcting startb is enough
 *         distance = (nchunk * chunklen + startb) - start
 *         if distance % step > 0:             # <<<<<<<<<<<<<<
 *             startb += (step - (distance % step))
 *             if startb > chunklen:
 */
    __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error))
    if (unlikely(__pyx_v_step == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 259, __pyx_L1_error)
    }
    __pyx_t_1 = ((__Pyx_mod_npy_intp(__pyx_v_distance, __pyx_v_step) > 0) != 0);
    if (__pyx_t_1) {

      /* "bcolz/carray_ext.pyx":260
 *         distance = (nchunk * chunklen + startb) - start
 *         if distance % step > 0:
 *             startb += (step - (distance % step))             # <<<<<<<<<<<<<<
 *             if startb > chunklen:
 *                 return startb, stopb, 0  # null size
 */
      __Pyx_TraceLine(260,0,__PYX_ERR(0, 260, __pyx_L1_error))
      if (unlikely(__pyx_v_step == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(0, 260, __pyx_L1_error)
      }
      __pyx_v_startb = (__pyx_v_startb + (__pyx_v_step - __Pyx_mod_npy_intp(__pyx_v_distance, __pyx_v_step)));

      /* "bcolz/carray_ext.pyx":261
 *         if distance % step > 0:
 *             startb += (step - (distance % step))
 *             if startb > chunklen:             # <<<<<<<<<<<<<<
 *                 return startb, stopb, 0  # null size
 * 
 */
      __Pyx_TraceLine(261,0,__PYX_ERR(0, 261, __pyx_L1_error))
      __pyx_t_1 = ((__pyx_v_startb > __pyx_v_chunklen) != 0);
      if (__pyx_t_1) {

        /* "bcolz/carray_ext.pyx":262
 *             startb += (step - (distance % step))
 *             if startb > chunklen:
 *                 return startb, stopb, 0  # null size             # <<<<<<<<<<<<<<
 * 
 *     # Compute size of the clipped block
 */
        __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error))
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_stopb); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
        __Pyx_INCREF(__pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_0);
        __pyx_t_5 = 0;
        __pyx_t_4 = 0;
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L0;

        /* "bcolz/carray_ext.pyx":261
 *         if distance % step > 0:
 *             startb += (step - (distance % step))
 *             if startb > chunklen:             # <<<<<<<<<<<<<<
 *                 return startb, stopb, 0  # null size
 * 
 */
      }

      /* "bcolz/carray_ext.pyx":259
 *         # Just correcting startb is enough
 *         distance = (nchunk * chunklen + startb) - start
 *         if distance % step > 0:             # <<<<<<<<<<<<<<
 *             startb += (step - (distance % step))
 *             if startb > chunklen:
 */
    }

    /* "bcolz/carray_ext.pyx":256
 * 
 *     # step corrections
 *     if step > 1:             # <<<<<<<<<<<<<<
 *         # Just correcting startb is enough
 *         distance = (nchunk * chunklen + startb) - start
 */
  }

  /* "bcolz/carray_ext.pyx":265
 * 
 *     # Compute size of the clipped block
 *     blen = get_len_of_range(startb, stopb, step)             # <<<<<<<<<<<<<<
 * 
 *     return startb, stopb, blen
 */
  __Pyx_TraceLine(265,0,__PYX_ERR(0, 265, __pyx_L1_error))
  __pyx_t_3 = __pyx_f_5bcolz_10carray_ext_get_len_of_range(__pyx_v_startb, __pyx_v_stopb, __pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_3); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_blen = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":267
 *     blen = get_len_of_range(startb, stopb, step)
 * 
 *     return startb, stopb, blen             # <<<<<<<<<<<<<<
 * 
 * cdef int check_zeros(char *data, int nbytes):
 */
  __Pyx_TraceLine(267,0,__PYX_ERR(0, 267, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_stopb); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_blen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":239
 *     return n
 * 
 * cdef clip_chunk(npy_intp nchunk, npy_intp chunklen,             # <<<<<<<<<<<<<<
 *                 npy_intp start, npy_intp stop, npy_intp step):
 *     """Get the limits of a certain chunk based on its length."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bcolz.carray_ext.clip_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":269
 *     return startb, stopb, blen
 * 
 * cdef int check_zeros(char *data, int nbytes):             # <<<<<<<<<<<<<<
 *     """Check whether [data, data+nbytes] is zero or not."""
 *     cdef int i, iszero, chunklen, leftover
 */

static int __pyx_f_5bcolz_10carray_ext_check_zeros(char *__pyx_v_data, int __pyx_v_nbytes) {
  int __pyx_v_i;
  int __pyx_v_iszero;
  int __pyx_v_chunklen;
  int __pyx_v_leftover;
  size_t *__pyx_v_sdata;
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("check_zeros", 0);
  __Pyx_TraceCall("check_zeros", __pyx_f[0], 269, 0, __PYX_ERR(0, 269, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":274
 *     cdef size_t *sdata
 * 
 *     iszero = 1             # <<<<<<<<<<<<<<
 *     sdata = <size_t *> data
 *     chunklen = cython.cdiv(nbytes, sizeof(size_t))
 */
  __Pyx_TraceLine(274,0,__PYX_ERR(0, 274, __pyx_L1_error))
  __pyx_v_iszero = 1;

  /* "bcolz/carray_ext.pyx":275
 * 
 *     iszero = 1
 *     sdata = <size_t *> data             # <<<<<<<<<<<<<<
 *     chunklen = cython.cdiv(nbytes, sizeof(size_t))
 *     leftover = nbytes % sizeof(size_t)
 */
  __Pyx_TraceLine(275,0,__PYX_ERR(0, 275, __pyx_L1_error))
  __pyx_v_sdata = ((size_t *)__pyx_v_data);

  /* "bcolz/carray_ext.pyx":276
 *     iszero = 1
 *     sdata = <size_t *> data
 *     chunklen = cython.cdiv(nbytes, sizeof(size_t))             # <<<<<<<<<<<<<<
 *     leftover = nbytes % sizeof(size_t)
 *     with nogil:
 */
  __Pyx_TraceLine(276,0,__PYX_ERR(0, 276, __pyx_L1_error))
  __pyx_v_chunklen = (__pyx_v_nbytes / (sizeof(size_t)));

  /* "bcolz/carray_ext.pyx":277
 *     sdata = <size_t *> data
 *     chunklen = cython.cdiv(nbytes, sizeof(size_t))
 *     leftover = nbytes % sizeof(size_t)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         for i from 0 <= i < chunklen:
 */
  __Pyx_TraceLine(277,0,__PYX_ERR(0, 277, __pyx_L1_error))
  __pyx_t_1 = (sizeof(size_t));
  if (unlikely(__pyx_t_1 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(0, 277, __pyx_L1_error)
  }
  __pyx_v_leftover = (__pyx_v_nbytes % __pyx_t_1);

  /* "bcolz/carray_ext.pyx":278
 *     chunklen = cython.cdiv(nbytes, sizeof(size_t))
 *     leftover = nbytes % sizeof(size_t)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < chunklen:
 *             if sdata[i] != 0:
 */
  __Pyx_TraceLine(278,0,__PYX_ERR(0, 278, __pyx_L1_error))
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      #endif
      /*try:*/ {

        /* "bcolz/carray_ext.pyx":279
 *     leftover = nbytes % sizeof(size_t)
 *     with nogil:
 *         for i from 0 <= i < chunklen:             # <<<<<<<<<<<<<<
 *             if sdata[i] != 0:
 *                 iszero = 0
 */
        __Pyx_TraceLine(279,1,__PYX_ERR(0, 279, __pyx_L4_error))
        __pyx_t_2 = __pyx_v_chunklen;
        for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

          /* "bcolz/carray_ext.pyx":280
 *     with nogil:
 *         for i from 0 <= i < chunklen:
 *             if sdata[i] != 0:             # <<<<<<<<<<<<<<
 *                 iszero = 0
 *                 break
 */
          __Pyx_TraceLine(280,1,__PYX_ERR(0, 280, __pyx_L4_error))
          __pyx_t_3 = (((__pyx_v_sdata[__pyx_v_i]) != 0) != 0);
          if (__pyx_t_3) {

            /* "bcolz/carray_ext.pyx":281
 *         for i from 0 <= i < chunklen:
 *             if sdata[i] != 0:
 *                 iszero = 0             # <<<<<<<<<<<<<<
 *                 break
 *         else:
 */
            __Pyx_TraceLine(281,1,__PYX_ERR(0, 281, __pyx_L4_error))
            __pyx_v_iszero = 0;

            /* "bcolz/carray_ext.pyx":282
 *             if sdata[i] != 0:
 *                 iszero = 0
 *                 break             # <<<<<<<<<<<<<<
 *         else:
 *             data += nbytes - leftover
 */
            __Pyx_TraceLine(282,1,__PYX_ERR(0, 282, __pyx_L4_error))
            goto __pyx_L7_break;

            /* "bcolz/carray_ext.pyx":280
 *     with nogil:
 *         for i from 0 <= i < chunklen:
 *             if sdata[i] != 0:             # <<<<<<<<<<<<<<
 *                 iszero = 0
 *                 break
 */
          }
        }
        /*else*/ {

          /* "bcolz/carray_ext.pyx":284
 *                 break
 *         else:
 *             data += nbytes - leftover             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < leftover:
 *                 if data[i] != 0:
 */
          __Pyx_TraceLine(284,1,__PYX_ERR(0, 284, __pyx_L4_error))
          __pyx_v_data = (__pyx_v_data + (__pyx_v_nbytes - __pyx_v_leftover));

          /* "bcolz/carray_ext.pyx":285
 *         else:
 *             data += nbytes - leftover
 *             for i from 0 <= i < leftover:             # <<<<<<<<<<<<<<
 *                 if data[i] != 0:
 *                     iszero = 0
 */
          __Pyx_TraceLine(285,1,__PYX_ERR(0, 285, __pyx_L4_error))
          __pyx_t_4 = __pyx_v_leftover;
          for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

            /* "bcolz/carray_ext.pyx":286
 *             data += nbytes - leftover
 *             for i from 0 <= i < leftover:
 *                 if data[i] != 0:             # <<<<<<<<<<<<<<
 *                     iszero = 0
 *                     break
 */
            __Pyx_TraceLine(286,1,__PYX_ERR(0, 286, __pyx_L4_error))
            __pyx_t_3 = (((__pyx_v_data[__pyx_v_i]) != 0) != 0);
            if (__pyx_t_3) {

              /* "bcolz/carray_ext.pyx":287
 *             for i from 0 <= i < leftover:
 *                 if data[i] != 0:
 *                     iszero = 0             # <<<<<<<<<<<<<<
 *                     break
 *     return iszero
 */
              __Pyx_TraceLine(287,1,__PYX_ERR(0, 287, __pyx_L4_error))
              __pyx_v_iszero = 0;

              /* "bcolz/carray_ext.pyx":288
 *                 if data[i] != 0:
 *                     iszero = 0
 *                     break             # <<<<<<<<<<<<<<
 *     return iszero
 * 
 */
              __Pyx_TraceLine(288,1,__PYX_ERR(0, 288, __pyx_L4_error))
              goto __pyx_L10_break;

              /* "bcolz/carray_ext.pyx":286
 *             data += nbytes - leftover
 *             for i from 0 <= i < leftover:
 *                 if data[i] != 0:             # <<<<<<<<<<<<<<
 *                     iszero = 0
 *                     break
 */
            }
          }
          __pyx_L10_break:;
        }
        __pyx_L7_break:;
      }

      /* "bcolz/carray_ext.pyx":278
 *     chunklen = cython.cdiv(nbytes, sizeof(size_t))
 *     leftover = nbytes % sizeof(size_t)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < chunklen:
 *             if sdata[i] != 0:
 */
      __Pyx_TraceLine(278,1,__PYX_ERR(0, 278, __pyx_L1_error))
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "bcolz/carray_ext.pyx":289
 *                     iszero = 0
 *                     break
 *     return iszero             # <<<<<<<<<<<<<<
 * 
 * cdef int true_count(char *data, int nbytes):
 */
  __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error))
  __pyx_r = __pyx_v_iszero;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":269
 *     return startb, stopb, blen
 * 
 * cdef int check_zeros(char *data, int nbytes):             # <<<<<<<<<<<<<<
 *     """Check whether [data, data+nbytes] is zero or not."""
 *     cdef int i, iszero, chunklen, leftover
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("bcolz.carray_ext.check_zeros", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":291
 *     return iszero
 * 
 * cdef int true_count(char *data, int nbytes):             # <<<<<<<<<<<<<<
 *     """Count the number of true values in data (boolean)."""
 *     cdef int i, count
 */

static int __pyx_f_5bcolz_10carray_ext_true_count(char *__pyx_v_data, int __pyx_v_nbytes) {
  int __pyx_v_i;
  int __pyx_v_count;
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("true_count", 0);
  __Pyx_TraceCall("true_count", __pyx_f[0], 291, 0, __PYX_ERR(0, 291, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":295
 *     cdef int i, count
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         count = 0
 *         for i from 0 <= i < nbytes:
 */
  __Pyx_TraceLine(295,0,__PYX_ERR(0, 295, __pyx_L1_error))
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      #endif
      /*try:*/ {

        /* "bcolz/carray_ext.pyx":296
 * 
 *     with nogil:
 *         count = 0             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nbytes:
 *             count += <int> (data[i])
 */
        __Pyx_TraceLine(296,1,__PYX_ERR(0, 296, __pyx_L4_error))
        __pyx_v_count = 0;

        /* "bcolz/carray_ext.pyx":297
 *     with nogil:
 *         count = 0
 *         for i from 0 <= i < nbytes:             # <<<<<<<<<<<<<<
 *             count += <int> (data[i])
 *     return count
 */
        __Pyx_TraceLine(297,1,__PYX_ERR(0, 297, __pyx_L4_error))
        __pyx_t_1 = __pyx_v_nbytes;
        for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

          /* "bcolz/carray_ext.pyx":298
 *         count = 0
 *         for i from 0 <= i < nbytes:
 *             count += <int> (data[i])             # <<<<<<<<<<<<<<
 *     return count
 * 
 */
          __Pyx_TraceLine(298,1,__PYX_ERR(0, 298, __pyx_L4_error))
          __pyx_v_count = (__pyx_v_count + ((int)(__pyx_v_data[__pyx_v_i])));
        }
      }

      /* "bcolz/carray_ext.pyx":295
 *     cdef int i, count
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         count = 0
 *         for i from 0 <= i < nbytes:
 */
      __Pyx_TraceLine(295,1,__PYX_ERR(0, 295, __pyx_L1_error))
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "bcolz/carray_ext.pyx":299
 *         for i from 0 <= i < nbytes:
 *             count += <int> (data[i])
 *     return count             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------
 */
  __Pyx_TraceLine(299,0,__PYX_ERR(0, 299, __pyx_L1_error))
  __pyx_r = __pyx_v_count;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":291
 *     return iszero
 * 
 * cdef int true_count(char *data, int nbytes):             # <<<<<<<<<<<<<<
 *     """Count the number of true values in data (boolean)."""
 *     cdef int i, count
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("bcolz.carray_ext.true_count", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":308
 * 
 * 
 * def _get_use_threads():             # <<<<<<<<<<<<<<
 *     global use_threads
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_13_get_use_threads(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_12_get_use_threads[] = "_get_use_threads()";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_13_get_use_threads = {"_get_use_threads", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_13_get_use_threads, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_12_get_use_threads};
static PyObject *__pyx_pw_5bcolz_10carray_ext_13_get_use_threads(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_use_threads (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_12_get_use_threads(__pyx_self);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_12_get_use_threads(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v__use_threads = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_TraceFrameInit(__pyx_codeobj__11)
  __Pyx_RefNannySetupContext("_get_use_threads", 0);
  __Pyx_TraceCall("_get_use_threads", __pyx_f[0], 308, 0, __PYX_ERR(0, 308, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":311
 *     global use_threads
 * 
 *     if use_threads in [True, False]:             # <<<<<<<<<<<<<<
 *         # user has manually overridden the default behaviour
 *         _use_threads = use_threads
 */
  __Pyx_TraceLine(311,0,__PYX_ERR(0, 311, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_use_threads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, Py_True, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, Py_False, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":313
 *     if use_threads in [True, False]:
 *         # user has manually overridden the default behaviour
 *         _use_threads = use_threads             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    __Pyx_TraceLine(313,0,__PYX_ERR(0, 313, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_use_threads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v__use_threads = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":311
 *     global use_threads
 * 
 *     if use_threads in [True, False]:             # <<<<<<<<<<<<<<
 *         # user has manually overridden the default behaviour
 *         _use_threads = use_threads
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":321
 *         # blosc to use threads, inferring it is being run from within a
 *         # multi-threaded program
 *         if hasattr(threading, 'main_thread'):             # <<<<<<<<<<<<<<
 *             _use_threads = (threading.main_thread() ==
 *                             threading.current_thread())
 */
  __Pyx_TraceLine(321,0,__PYX_ERR(0, 321, __pyx_L1_error))
  /*else*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_HasAttr(__pyx_t_1, __pyx_n_s_main_thread); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 321, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = (__pyx_t_4 != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":322
 *         # multi-threaded program
 *         if hasattr(threading, 'main_thread'):
 *             _use_threads = (threading.main_thread() ==             # <<<<<<<<<<<<<<
 *                             threading.current_thread())
 *         else:
 */
      __Pyx_TraceLine(322,0,__PYX_ERR(0, 322, __pyx_L1_error))
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_main_thread); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":323
 *         if hasattr(threading, 'main_thread'):
 *             _use_threads = (threading.main_thread() ==
 *                             threading.current_thread())             # <<<<<<<<<<<<<<
 *         else:
 *             _use_threads = threading.current_thread().name == 'MainThread'
 */
      __Pyx_TraceLine(323,0,__PYX_ERR(0, 323, __pyx_L1_error))
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_current_thread); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v__use_threads = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "bcolz/carray_ext.pyx":321
 *         # blosc to use threads, inferring it is being run from within a
 *         # multi-threaded program
 *         if hasattr(threading, 'main_thread'):             # <<<<<<<<<<<<<<
 *             _use_threads = (threading.main_thread() ==
 *                             threading.current_thread())
 */
      goto __pyx_L6;
    }

    /* "bcolz/carray_ext.pyx":325
 *                             threading.current_thread())
 *         else:
 *             _use_threads = threading.current_thread().name == 'MainThread'             # <<<<<<<<<<<<<<
 * 
 *     return _use_threads
 */
    __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error))
    /*else*/ {
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_current_thread); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_n_s_MainThread, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v__use_threads = __pyx_t_6;
      __pyx_t_6 = 0;
    }
    __pyx_L6:;
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":327
 *             _use_threads = threading.current_thread().name == 'MainThread'
 * 
 *     return _use_threads             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v__use_threads);
  __pyx_r = __pyx_v__use_threads;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":308
 * 
 * 
 * def _get_use_threads():             # <<<<<<<<<<<<<<
 *     global use_threads
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bcolz.carray_ext._get_use_threads", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__use_threads);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":342
 *     property dtype:
 *         "The NumPy dtype for this chunk."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.atom
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_5dtype_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_5dtype___get__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_5dtype___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 342, 0, __PYX_ERR(0, 342, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":343
 *         "The NumPy dtype for this chunk."
 *         def __get__(self):
 *             return self.atom             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, object dobject, object atom, object cparams,
 */
  __Pyx_TraceLine(343,0,__PYX_ERR(0, 343, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->atom);
  __pyx_r = __pyx_v_self->atom;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":342
 *     property dtype:
 *         "The NumPy dtype for this chunk."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.atom
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.dtype.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":345
 *             return self.atom
 * 
 *     def __cinit__(self, object dobject, object atom, object cparams,             # <<<<<<<<<<<<<<
 *                   object _memory=True, object _compr=False):
 *         cdef int itemsize, footprint
 */

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_5chunk_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_5chunk_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dobject = 0;
  PyObject *__pyx_v_atom = 0;
  PyObject *__pyx_v_cparams = 0;
  PyObject *__pyx_v__memory = 0;
  PyObject *__pyx_v__compr = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dobject,&__pyx_n_s_atom,&__pyx_n_s_cparams,&__pyx_n_s_memory,&__pyx_n_s_compr,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "bcolz/carray_ext.pyx":346
 * 
 *     def __cinit__(self, object dobject, object atom, object cparams,
 *                   object _memory=True, object _compr=False):             # <<<<<<<<<<<<<<
 *         cdef int itemsize, footprint
 *         cdef size_t nbytes, cbytes, blocksize
 */
    values[3] = ((PyObject *)Py_True);
    values[4] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_dobject)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_atom)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 345, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cparams)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 345, __pyx_L3_error)
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_memory);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compr);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 345, __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_dobject = values[0];
    __pyx_v_atom = values[1];
    __pyx_v_cparams = values[2];
    __pyx_v__memory = values[3];
    __pyx_v__compr = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk___cinit__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self), __pyx_v_dobject, __pyx_v_atom, __pyx_v_cparams, __pyx_v__memory, __pyx_v__compr);

  /* "bcolz/carray_ext.pyx":345
 *             return self.atom
 * 
 *     def __cinit__(self, object dobject, object atom, object cparams,             # <<<<<<<<<<<<<<
 *                   object _memory=True, object _compr=False):
 *         cdef int itemsize, footprint
 */

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

static int __pyx_pf_5bcolz_10carray_ext_5chunk___cinit__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_dobject, PyObject *__pyx_v_atom, PyObject *__pyx_v_cparams, PyObject *__pyx_v__memory, PyObject *__pyx_v__compr) {
  int __pyx_v_itemsize;
  int __pyx_v_footprint;
  size_t __pyx_v_nbytes;
  size_t __pyx_v_cbytes;
  size_t __pyx_v_blocksize;
  PyArray_Descr *__pyx_v_dtype_ = 0;
  char *__pyx_v_data;
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  char __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)(PyObject *);
  size_t __pyx_t_10;
  size_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  size_t __pyx_t_14;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_TraceCall("__cinit__", __pyx_f[0], 345, 0, __PYX_ERR(0, 345, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":352
 *         cdef char *data
 * 
 *         self.atom = atom             # <<<<<<<<<<<<<<
 *         self.atomsize = atom.itemsize
 *         dtype_ = atom.base
 */
  __Pyx_TraceLine(352,0,__PYX_ERR(0, 352, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_atom);
  __Pyx_GIVEREF(__pyx_v_atom);
  __Pyx_GOTREF(__pyx_v_self->atom);
  __Pyx_DECREF(__pyx_v_self->atom);
  __pyx_v_self->atom = __pyx_v_atom;

  /* "bcolz/carray_ext.pyx":353
 * 
 *         self.atom = atom
 *         self.atomsize = atom.itemsize             # <<<<<<<<<<<<<<
 *         dtype_ = atom.base
 *         self.typekind = dtype_.kind
 */
  __Pyx_TraceLine(353,0,__PYX_ERR(0, 353, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_atom, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->atomsize = __pyx_t_2;

  /* "bcolz/carray_ext.pyx":354
 *         self.atom = atom
 *         self.atomsize = atom.itemsize
 *         dtype_ = atom.base             # <<<<<<<<<<<<<<
 *         self.typekind = dtype_.kind
 *         # Hack for allowing strings with len > BLOSC_MAX_TYPESIZE
 */
  __Pyx_TraceLine(354,0,__PYX_ERR(0, 354, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_atom, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 354, __pyx_L1_error)
  __pyx_v_dtype_ = ((PyArray_Descr *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":355
 *         self.atomsize = atom.itemsize
 *         dtype_ = atom.base
 *         self.typekind = dtype_.kind             # <<<<<<<<<<<<<<
 *         # Hack for allowing strings with len > BLOSC_MAX_TYPESIZE
 *         if self.typekind == 'S':
 */
  __Pyx_TraceLine(355,0,__PYX_ERR(0, 355, __pyx_L1_error))
  __pyx_t_3 = __pyx_v_dtype_->kind;
  __pyx_v_self->typekind = __pyx_t_3;

  /* "bcolz/carray_ext.pyx":357
 *         self.typekind = dtype_.kind
 *         # Hack for allowing strings with len > BLOSC_MAX_TYPESIZE
 *         if self.typekind == 'S':             # <<<<<<<<<<<<<<
 *             itemsize = 1
 *         elif self.typekind == 'U':
 */
  __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error))
  __pyx_t_4 = ((__pyx_v_self->typekind == 'S') != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":358
 *         # Hack for allowing strings with len > BLOSC_MAX_TYPESIZE
 *         if self.typekind == 'S':
 *             itemsize = 1             # <<<<<<<<<<<<<<
 *         elif self.typekind == 'U':
 *             itemsize = 4
 */
    __Pyx_TraceLine(358,0,__PYX_ERR(0, 358, __pyx_L1_error))
    __pyx_v_itemsize = 1;

    /* "bcolz/carray_ext.pyx":357
 *         self.typekind = dtype_.kind
 *         # Hack for allowing strings with len > BLOSC_MAX_TYPESIZE
 *         if self.typekind == 'S':             # <<<<<<<<<<<<<<
 *             itemsize = 1
 *         elif self.typekind == 'U':
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":359
 *         if self.typekind == 'S':
 *             itemsize = 1
 *         elif self.typekind == 'U':             # <<<<<<<<<<<<<<
 *             itemsize = 4
 *         elif self.typekind == 'V' and dtype_.itemsize > BLOSC_MAX_TYPESIZE:
 */
  __Pyx_TraceLine(359,0,__PYX_ERR(0, 359, __pyx_L1_error))
  __pyx_t_4 = ((__pyx_v_self->typekind == 'U') != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":360
 *             itemsize = 1
 *         elif self.typekind == 'U':
 *             itemsize = 4             # <<<<<<<<<<<<<<
 *         elif self.typekind == 'V' and dtype_.itemsize > BLOSC_MAX_TYPESIZE:
 *             itemsize = 1
 */
    __Pyx_TraceLine(360,0,__PYX_ERR(0, 360, __pyx_L1_error))
    __pyx_v_itemsize = 4;

    /* "bcolz/carray_ext.pyx":359
 *         if self.typekind == 'S':
 *             itemsize = 1
 *         elif self.typekind == 'U':             # <<<<<<<<<<<<<<
 *             itemsize = 4
 *         elif self.typekind == 'V' and dtype_.itemsize > BLOSC_MAX_TYPESIZE:
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":361
 *         elif self.typekind == 'U':
 *             itemsize = 4
 *         elif self.typekind == 'V' and dtype_.itemsize > BLOSC_MAX_TYPESIZE:             # <<<<<<<<<<<<<<
 *             itemsize = 1
 *         else:
 */
  __Pyx_TraceLine(361,0,__PYX_ERR(0, 361, __pyx_L1_error))
  __pyx_t_5 = ((__pyx_v_self->typekind == 'V') != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_dtype_->elsize > BLOSC_MAX_TYPESIZE) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":362
 *             itemsize = 4
 *         elif self.typekind == 'V' and dtype_.itemsize > BLOSC_MAX_TYPESIZE:
 *             itemsize = 1             # <<<<<<<<<<<<<<
 *         else:
 *             itemsize = dtype_.itemsize
 */
    __Pyx_TraceLine(362,0,__PYX_ERR(0, 362, __pyx_L1_error))
    __pyx_v_itemsize = 1;

    /* "bcolz/carray_ext.pyx":361
 *         elif self.typekind == 'U':
 *             itemsize = 4
 *         elif self.typekind == 'V' and dtype_.itemsize > BLOSC_MAX_TYPESIZE:             # <<<<<<<<<<<<<<
 *             itemsize = 1
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":364
 *             itemsize = 1
 *         else:
 *             itemsize = dtype_.itemsize             # <<<<<<<<<<<<<<
 *         if itemsize > BLOSC_MAX_TYPESIZE:
 *             raise TypeError(
 */
  __Pyx_TraceLine(364,0,__PYX_ERR(0, 364, __pyx_L1_error))
  /*else*/ {
    __pyx_t_2 = __pyx_v_dtype_->elsize;
    __pyx_v_itemsize = __pyx_t_2;
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":365
 *         else:
 *             itemsize = dtype_.itemsize
 *         if itemsize > BLOSC_MAX_TYPESIZE:             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "typesize is %d and bcolz does not currently support data "
 */
  __Pyx_TraceLine(365,0,__PYX_ERR(0, 365, __pyx_L1_error))
  __pyx_t_4 = ((__pyx_v_itemsize > BLOSC_MAX_TYPESIZE) != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":368
 *             raise TypeError(
 *                 "typesize is %d and bcolz does not currently support data "
 *                 "types larger than %d bytes" % (itemsize, BLOSC_MAX_TYPESIZE))             # <<<<<<<<<<<<<<
 *         self.itemsize = itemsize
 *         footprint = 0
 */
    __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyInt_From_int(BLOSC_MAX_TYPESIZE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
    __pyx_t_1 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_typesize_is_d_and_bcolz_does_not, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "bcolz/carray_ext.pyx":366
 *             itemsize = dtype_.itemsize
 *         if itemsize > BLOSC_MAX_TYPESIZE:
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 "typesize is %d and bcolz does not currently support data "
 *                 "types larger than %d bytes" % (itemsize, BLOSC_MAX_TYPESIZE))
 */
    __Pyx_TraceLine(366,0,__PYX_ERR(0, 366, __pyx_L1_error))
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__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_ERR(0, 366, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":365
 *         else:
 *             itemsize = dtype_.itemsize
 *         if itemsize > BLOSC_MAX_TYPESIZE:             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 "typesize is %d and bcolz does not currently support data "
 */
  }

  /* "bcolz/carray_ext.pyx":369
 *                 "typesize is %d and bcolz does not currently support data "
 *                 "types larger than %d bytes" % (itemsize, BLOSC_MAX_TYPESIZE))
 *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
 *         footprint = 0
 * 
 */
  __Pyx_TraceLine(369,0,__PYX_ERR(0, 369, __pyx_L1_error))
  __pyx_v_self->itemsize = __pyx_v_itemsize;

  /* "bcolz/carray_ext.pyx":370
 *                 "types larger than %d bytes" % (itemsize, BLOSC_MAX_TYPESIZE))
 *         self.itemsize = itemsize
 *         footprint = 0             # <<<<<<<<<<<<<<
 * 
 *         if _compr:
 */
  __Pyx_TraceLine(370,0,__PYX_ERR(0, 370, __pyx_L1_error))
  __pyx_v_footprint = 0;

  /* "bcolz/carray_ext.pyx":372
 *         footprint = 0
 * 
 *         if _compr:             # <<<<<<<<<<<<<<
 *             # Data comes in an already compressed state inside a Python String
 *             self.dobject = dobject
 */
  __Pyx_TraceLine(372,0,__PYX_ERR(0, 372, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__compr); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 372, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":374
 *         if _compr:
 *             # Data comes in an already compressed state inside a Python String
 *             self.dobject = dobject             # <<<<<<<<<<<<<<
 *             # Set size info for the instance
 *             data = PyBytes_AS_STRING(dobject);
 */
    __Pyx_TraceLine(374,0,__PYX_ERR(0, 374, __pyx_L1_error))
    __Pyx_INCREF(__pyx_v_dobject);
    __Pyx_GIVEREF(__pyx_v_dobject);
    __Pyx_GOTREF(__pyx_v_self->dobject);
    __Pyx_DECREF(__pyx_v_self->dobject);
    __pyx_v_self->dobject = __pyx_v_dobject;

    /* "bcolz/carray_ext.pyx":376
 *             self.dobject = dobject
 *             # Set size info for the instance
 *             data = PyBytes_AS_STRING(dobject);             # <<<<<<<<<<<<<<
 *             blosc_cbuffer_sizes(data, &nbytes, &cbytes, &blocksize)
 *         elif dtype_ == 'O':
 */
    __Pyx_TraceLine(376,0,__PYX_ERR(0, 376, __pyx_L1_error))
    __pyx_v_data = PyBytes_AS_STRING(__pyx_v_dobject);

    /* "bcolz/carray_ext.pyx":377
 *             # Set size info for the instance
 *             data = PyBytes_AS_STRING(dobject);
 *             blosc_cbuffer_sizes(data, &nbytes, &cbytes, &blocksize)             # <<<<<<<<<<<<<<
 *         elif dtype_ == 'O':
 *             # The objects should arrive here already pickled
 */
    __Pyx_TraceLine(377,0,__PYX_ERR(0, 377, __pyx_L1_error))
    blosc_cbuffer_sizes(__pyx_v_data, (&__pyx_v_nbytes), (&__pyx_v_cbytes), (&__pyx_v_blocksize));

    /* "bcolz/carray_ext.pyx":372
 *         footprint = 0
 * 
 *         if _compr:             # <<<<<<<<<<<<<<
 *             # Data comes in an already compressed state inside a Python String
 *             self.dobject = dobject
 */
    goto __pyx_L7;
  }

  /* "bcolz/carray_ext.pyx":378
 *             data = PyBytes_AS_STRING(dobject);
 *             blosc_cbuffer_sizes(data, &nbytes, &cbytes, &blocksize)
 *         elif dtype_ == 'O':             # <<<<<<<<<<<<<<
 *             # The objects should arrive here already pickled
 *             data = PyBytes_AS_STRING(dobject)
 */
  __Pyx_TraceLine(378,0,__PYX_ERR(0, 378, __pyx_L1_error))
  __pyx_t_4 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_dtype_), __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 378, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":380
 *         elif dtype_ == 'O':
 *             # The objects should arrive here already pickled
 *             data = PyBytes_AS_STRING(dobject)             # <<<<<<<<<<<<<<
 *             nbytes = PyBytes_GET_SIZE(dobject)
 *             cbytes, blocksize = self.compress_data(data, 1, nbytes, cparams)
 */
    __Pyx_TraceLine(380,0,__PYX_ERR(0, 380, __pyx_L1_error))
    __pyx_v_data = PyBytes_AS_STRING(__pyx_v_dobject);

    /* "bcolz/carray_ext.pyx":381
 *             # The objects should arrive here already pickled
 *             data = PyBytes_AS_STRING(dobject)
 *             nbytes = PyBytes_GET_SIZE(dobject)             # <<<<<<<<<<<<<<
 *             cbytes, blocksize = self.compress_data(data, 1, nbytes, cparams)
 *         else:
 */
    __Pyx_TraceLine(381,0,__PYX_ERR(0, 381, __pyx_L1_error))
    __pyx_v_nbytes = PyBytes_GET_SIZE(__pyx_v_dobject);

    /* "bcolz/carray_ext.pyx":382
 *             data = PyBytes_AS_STRING(dobject)
 *             nbytes = PyBytes_GET_SIZE(dobject)
 *             cbytes, blocksize = self.compress_data(data, 1, nbytes, cparams)             # <<<<<<<<<<<<<<
 *         else:
 *             # Compress the data object (a NumPy object)
 */
    __Pyx_TraceLine(382,0,__PYX_ERR(0, 382, __pyx_L1_error))
    __pyx_t_6 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk *)__pyx_v_self->__pyx_vtab)->compress_data(__pyx_v_self, __pyx_v_data, 1, __pyx_v_nbytes, __pyx_v_cparams); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      #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_ERR(0, 382, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 382, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }
    __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_cbytes = __pyx_t_10;
    __pyx_v_blocksize = __pyx_t_11;

    /* "bcolz/carray_ext.pyx":378
 *             data = PyBytes_AS_STRING(dobject);
 *             blosc_cbuffer_sizes(data, &nbytes, &cbytes, &blocksize)
 *         elif dtype_ == 'O':             # <<<<<<<<<<<<<<
 *             # The objects should arrive here already pickled
 *             data = PyBytes_AS_STRING(dobject)
 */
    goto __pyx_L7;
  }

  /* "bcolz/carray_ext.pyx":385
 *         else:
 *             # Compress the data object (a NumPy object)
 *             nbytes, cbytes, blocksize, footprint = self.compress_arrdata(             # <<<<<<<<<<<<<<
 *                 dobject, itemsize, cparams, _memory)
 *         footprint += 128  # add the (aprox) footprint of this instance in bytes
 */
  __Pyx_TraceLine(385,0,__PYX_ERR(0, 385, __pyx_L1_error))
  /*else*/ {

    /* "bcolz/carray_ext.pyx":386
 *             # Compress the data object (a NumPy object)
 *             nbytes, cbytes, blocksize, footprint = self.compress_arrdata(
 *                 dobject, itemsize, cparams, _memory)             # <<<<<<<<<<<<<<
 *         footprint += 128  # add the (aprox) footprint of this instance in bytes
 * 
 */
    __Pyx_TraceLine(386,0,__PYX_ERR(0, 386, __pyx_L1_error))
    if (!(likely(((__pyx_v_dobject) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dobject, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 386, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":385
 *         else:
 *             # Compress the data object (a NumPy object)
 *             nbytes, cbytes, blocksize, footprint = self.compress_arrdata(             # <<<<<<<<<<<<<<
 *                 dobject, itemsize, cparams, _memory)
 *         footprint += 128  # add the (aprox) footprint of this instance in bytes
 */
    __Pyx_TraceLine(385,0,__PYX_ERR(0, 385, __pyx_L1_error))
    __pyx_t_6 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk *)__pyx_v_self->__pyx_vtab)->compress_arrdata(__pyx_v_self, ((PyArrayObject *)__pyx_v_dobject), __pyx_v_itemsize, __pyx_v_cparams, __pyx_v__memory); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 4)) {
        if (size > 4) __Pyx_RaiseTooManyValuesError(4);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 385, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_12 = PyList_GET_ITEM(sequence, 3); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_12);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_7,&__pyx_t_8,&__pyx_t_12};
        for (i=0; i < 4; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 385, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_7,&__pyx_t_8,&__pyx_t_12};
      __pyx_t_13 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 385, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_13)->tp_iternext;
      for (index=0; index < 4; index++) {
        PyObject* item = __pyx_t_9(__pyx_t_13); if (unlikely(!item)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_13), 4) < 0) __PYX_ERR(0, 385, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 385, __pyx_L1_error)
      __pyx_L11_unpacking_done:;
    }
    __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_14 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_14 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_12); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_v_nbytes = __pyx_t_11;
    __pyx_v_cbytes = __pyx_t_10;
    __pyx_v_blocksize = __pyx_t_14;
    __pyx_v_footprint = __pyx_t_2;
  }
  __pyx_L7:;

  /* "bcolz/carray_ext.pyx":387
 *             nbytes, cbytes, blocksize, footprint = self.compress_arrdata(
 *                 dobject, itemsize, cparams, _memory)
 *         footprint += 128  # add the (aprox) footprint of this instance in bytes             # <<<<<<<<<<<<<<
 * 
 *         # Fill instance data
 */
  __Pyx_TraceLine(387,0,__PYX_ERR(0, 387, __pyx_L1_error))
  __pyx_v_footprint = (__pyx_v_footprint + 0x80);

  /* "bcolz/carray_ext.pyx":390
 * 
 *         # Fill instance data
 *         self.nbytes = nbytes             # <<<<<<<<<<<<<<
 *         self.cbytes = cbytes
 *         self.blocksize = blocksize
 */
  __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
  __pyx_v_self->nbytes = __pyx_v_nbytes;

  /* "bcolz/carray_ext.pyx":391
 *         # Fill instance data
 *         self.nbytes = nbytes
 *         self.cbytes = cbytes             # <<<<<<<<<<<<<<
 *         self.blocksize = blocksize
 * 
 */
  __Pyx_TraceLine(391,0,__PYX_ERR(0, 391, __pyx_L1_error))
  __pyx_v_self->cbytes = __pyx_v_cbytes;

  /* "bcolz/carray_ext.pyx":392
 *         self.nbytes = nbytes
 *         self.cbytes = cbytes
 *         self.blocksize = blocksize             # <<<<<<<<<<<<<<
 * 
 *     cdef compress_arrdata(self, ndarray array, int itemsize,
 */
  __Pyx_TraceLine(392,0,__PYX_ERR(0, 392, __pyx_L1_error))
  __pyx_v_self->blocksize = __pyx_v_blocksize;

  /* "bcolz/carray_ext.pyx":345
 *             return self.atom
 * 
 *     def __cinit__(self, object dobject, object atom, object cparams,             # <<<<<<<<<<<<<<
 *                   object _memory=True, object _compr=False):
 *         cdef int itemsize, footprint
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_dtype_);
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":394
 *         self.blocksize = blocksize
 * 
 *     cdef compress_arrdata(self, ndarray array, int itemsize,             # <<<<<<<<<<<<<<
 *                           object cparams, object _memory):
 *         """Compress data in `array`"""
 */

static PyObject *__pyx_f_5bcolz_10carray_ext_5chunk_compress_arrdata(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyArrayObject *__pyx_v_array, int __pyx_v_itemsize, PyObject *__pyx_v_cparams, PyObject *__pyx_v__memory) {
  size_t __pyx_v_nbytes;
  size_t __pyx_v_cbytes;
  size_t __pyx_v_blocksize;
  size_t __pyx_v_footprint;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  size_t __pyx_t_11;
  __Pyx_RefNannySetupContext("compress_arrdata", 0);
  __Pyx_TraceCall("compress_arrdata", __pyx_f[0], 394, 0, __PYX_ERR(0, 394, __pyx_L1_error));
  __Pyx_INCREF((PyObject *)__pyx_v_array);

  /* "bcolz/carray_ext.pyx":400
 * 
 *         # Compute the total number of bytes in this array
 *         nbytes = array.itemsize * array.size             # <<<<<<<<<<<<<<
 *         cbytes = 0
 *         footprint = 0
 */
  __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_nbytes = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":401
 *         # Compute the total number of bytes in this array
 *         nbytes = array.itemsize * array.size
 *         cbytes = 0             # <<<<<<<<<<<<<<
 *         footprint = 0
 * 
 */
  __Pyx_TraceLine(401,0,__PYX_ERR(0, 401, __pyx_L1_error))
  __pyx_v_cbytes = 0;

  /* "bcolz/carray_ext.pyx":402
 *         nbytes = array.itemsize * array.size
 *         cbytes = 0
 *         footprint = 0             # <<<<<<<<<<<<<<
 * 
 *         # Check whether incoming data can be expressed as a constant or not.
 */
  __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
  __pyx_v_footprint = 0;

  /* "bcolz/carray_ext.pyx":406
 *         # Check whether incoming data can be expressed as a constant or not.
 *         # Disk-based chunks are not allowed to do this.
 *         self.isconstant = 0             # <<<<<<<<<<<<<<
 *         self.constant = None
 *         if _memory and (array.strides[0] == 0
 */
  __Pyx_TraceLine(406,0,__PYX_ERR(0, 406, __pyx_L1_error))
  __pyx_v_self->isconstant = 0;

  /* "bcolz/carray_ext.pyx":407
 *         # Disk-based chunks are not allowed to do this.
 *         self.isconstant = 0
 *         self.constant = None             # <<<<<<<<<<<<<<
 *         if _memory and (array.strides[0] == 0
 *                         or check_zeros(array.data, nbytes)):
 */
  __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error))
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->constant);
  __Pyx_DECREF(__pyx_v_self->constant);
  __pyx_v_self->constant = Py_None;

  /* "bcolz/carray_ext.pyx":408
 *         self.isconstant = 0
 *         self.constant = None
 *         if _memory and (array.strides[0] == 0             # <<<<<<<<<<<<<<
 *                         or check_zeros(array.data, nbytes)):
 *             self.isconstant = 1
 */
  __Pyx_TraceLine(408,0,__PYX_ERR(0, 408, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v__memory); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 408, __pyx_L1_error)
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }

  /* "bcolz/carray_ext.pyx":409
 *         self.constant = None
 *         if _memory and (array.strides[0] == 0
 *                         or check_zeros(array.data, nbytes)):             # <<<<<<<<<<<<<<
 *             self.isconstant = 1
 *             # Get the NumPy constant.  Avoid this NumPy quirk:
 */
  __Pyx_TraceLine(409,0,__PYX_ERR(0, 409, __pyx_L1_error))
  __pyx_t_6 = (((__pyx_v_array->strides[0]) == 0) != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__pyx_f_5bcolz_10carray_ext_check_zeros(__pyx_v_array->data, __pyx_v_nbytes) != 0);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;

  /* "bcolz/carray_ext.pyx":408
 *         self.isconstant = 0
 *         self.constant = None
 *         if _memory and (array.strides[0] == 0             # <<<<<<<<<<<<<<
 *                         or check_zeros(array.data, nbytes)):
 *             self.isconstant = 1
 */
  __Pyx_TraceLine(408,0,__PYX_ERR(0, 408, __pyx_L1_error))
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":410
 *         if _memory and (array.strides[0] == 0
 *                         or check_zeros(array.data, nbytes)):
 *             self.isconstant = 1             # <<<<<<<<<<<<<<
 *             # Get the NumPy constant.  Avoid this NumPy quirk:
 *             # np.array(['1'], dtype='S3').dtype != s[0].dtype
 */
    __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error))
    __pyx_v_self->isconstant = 1;

    /* "bcolz/carray_ext.pyx":413
 *             # Get the NumPy constant.  Avoid this NumPy quirk:
 *             # np.array(['1'], dtype='S3').dtype != s[0].dtype
 *             if array.dtype.kind != 'S':             # <<<<<<<<<<<<<<
 *                 self.constant = array[0]
 *             else:
 */
    __Pyx_TraceLine(413,0,__PYX_ERR(0, 413, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_S, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":414
 *             # np.array(['1'], dtype='S3').dtype != s[0].dtype
 *             if array.dtype.kind != 'S':
 *                 self.constant = array[0]             # <<<<<<<<<<<<<<
 *             else:
 *                 self.constant = np.array(array[0], dtype=array.dtype)
 */
      __Pyx_TraceLine(414,0,__PYX_ERR(0, 414, __pyx_L1_error))
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_array), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->constant);
      __Pyx_DECREF(__pyx_v_self->constant);
      __pyx_v_self->constant = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "bcolz/carray_ext.pyx":413
 *             # Get the NumPy constant.  Avoid this NumPy quirk:
 *             # np.array(['1'], dtype='S3').dtype != s[0].dtype
 *             if array.dtype.kind != 'S':             # <<<<<<<<<<<<<<
 *                 self.constant = array[0]
 *             else:
 */
      goto __pyx_L7;
    }

    /* "bcolz/carray_ext.pyx":416
 *                 self.constant = array[0]
 *             else:
 *                 self.constant = np.array(array[0], dtype=array.dtype)             # <<<<<<<<<<<<<<
 *             # Add overhead (64 bytes for the overhead of the numpy container)
 *             footprint += 64 + self.constant.size * self.constant.itemsize
 */
    __Pyx_TraceLine(416,0,__PYX_ERR(0, 416, __pyx_L1_error))
    /*else*/ {
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_array), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_v_self->constant);
      __Pyx_DECREF(__pyx_v_self->constant);
      __pyx_v_self->constant = __pyx_t_7;
      __pyx_t_7 = 0;
    }
    __pyx_L7:;

    /* "bcolz/carray_ext.pyx":418
 *                 self.constant = np.array(array[0], dtype=array.dtype)
 *             # Add overhead (64 bytes for the overhead of the numpy container)
 *             footprint += 64 + self.constant.size * self.constant.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if self.isconstant:
 */
    __Pyx_TraceLine(418,0,__PYX_ERR(0, 418, __pyx_L1_error))
    __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_footprint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->constant, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->constant, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_64, __pyx_t_3, 64, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_footprint = __pyx_t_4;

    /* "bcolz/carray_ext.pyx":408
 *         self.isconstant = 0
 *         self.constant = None
 *         if _memory and (array.strides[0] == 0             # <<<<<<<<<<<<<<
 *                         or check_zeros(array.data, nbytes)):
 *             self.isconstant = 1
 */
  }

  /* "bcolz/carray_ext.pyx":420
 *             footprint += 64 + self.constant.size * self.constant.itemsize
 * 
 *         if self.isconstant:             # <<<<<<<<<<<<<<
 *             blocksize = 4 * 1024  # use 4 KB as a cache for blocks
 *             # Make blocksize a multiple of itemsize
 */
  __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error))
  __pyx_t_5 = (__pyx_v_self->isconstant != 0);
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":421
 * 
 *         if self.isconstant:
 *             blocksize = 4 * 1024  # use 4 KB as a cache for blocks             # <<<<<<<<<<<<<<
 *             # Make blocksize a multiple of itemsize
 *             if blocksize % itemsize > 0:
 */
    __Pyx_TraceLine(421,0,__PYX_ERR(0, 421, __pyx_L1_error))
    __pyx_v_blocksize = 0x1000;

    /* "bcolz/carray_ext.pyx":423
 *             blocksize = 4 * 1024  # use 4 KB as a cache for blocks
 *             # Make blocksize a multiple of itemsize
 *             if blocksize % itemsize > 0:             # <<<<<<<<<<<<<<
 *                 blocksize = cython.cdiv(blocksize, itemsize) * itemsize
 *             # Correct in case we have a large itemsize
 */
    __Pyx_TraceLine(423,0,__PYX_ERR(0, 423, __pyx_L1_error))
    if (unlikely(__pyx_v_itemsize == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 423, __pyx_L1_error)
    }
    __pyx_t_5 = (((__pyx_v_blocksize % __pyx_v_itemsize) > 0) != 0);
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":424
 *             # Make blocksize a multiple of itemsize
 *             if blocksize % itemsize > 0:
 *                 blocksize = cython.cdiv(blocksize, itemsize) * itemsize             # <<<<<<<<<<<<<<
 *             # Correct in case we have a large itemsize
 *             if blocksize == 0:
 */
      __Pyx_TraceLine(424,0,__PYX_ERR(0, 424, __pyx_L1_error))
      __pyx_v_blocksize = ((__pyx_v_blocksize / __pyx_v_itemsize) * __pyx_v_itemsize);

      /* "bcolz/carray_ext.pyx":423
 *             blocksize = 4 * 1024  # use 4 KB as a cache for blocks
 *             # Make blocksize a multiple of itemsize
 *             if blocksize % itemsize > 0:             # <<<<<<<<<<<<<<
 *                 blocksize = cython.cdiv(blocksize, itemsize) * itemsize
 *             # Correct in case we have a large itemsize
 */
    }

    /* "bcolz/carray_ext.pyx":426
 *                 blocksize = cython.cdiv(blocksize, itemsize) * itemsize
 *             # Correct in case we have a large itemsize
 *             if blocksize == 0:             # <<<<<<<<<<<<<<
 *                 blocksize = itemsize
 *         else:
 */
    __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error))
    __pyx_t_5 = ((__pyx_v_blocksize == 0) != 0);
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":427
 *             # Correct in case we have a large itemsize
 *             if blocksize == 0:
 *                 blocksize = itemsize             # <<<<<<<<<<<<<<
 *         else:
 *             if self.typekind == 'b':
 */
      __Pyx_TraceLine(427,0,__PYX_ERR(0, 427, __pyx_L1_error))
      __pyx_v_blocksize = __pyx_v_itemsize;

      /* "bcolz/carray_ext.pyx":426
 *                 blocksize = cython.cdiv(blocksize, itemsize) * itemsize
 *             # Correct in case we have a large itemsize
 *             if blocksize == 0:             # <<<<<<<<<<<<<<
 *                 blocksize = itemsize
 *         else:
 */
    }

    /* "bcolz/carray_ext.pyx":420
 *             footprint += 64 + self.constant.size * self.constant.itemsize
 * 
 *         if self.isconstant:             # <<<<<<<<<<<<<<
 *             blocksize = 4 * 1024  # use 4 KB as a cache for blocks
 *             # Make blocksize a multiple of itemsize
 */
    goto __pyx_L8;
  }

  /* "bcolz/carray_ext.pyx":429
 *                 blocksize = itemsize
 *         else:
 *             if self.typekind == 'b':             # <<<<<<<<<<<<<<
 *                 self.true_count = true_count(array.data, nbytes)
 * 
 */
  __Pyx_TraceLine(429,0,__PYX_ERR(0, 429, __pyx_L1_error))
  /*else*/ {
    __pyx_t_5 = ((__pyx_v_self->typekind == 'b') != 0);
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":430
 *         else:
 *             if self.typekind == 'b':
 *                 self.true_count = true_count(array.data, nbytes)             # <<<<<<<<<<<<<<
 * 
 *             if array.strides[0] == 0:
 */
      __Pyx_TraceLine(430,0,__PYX_ERR(0, 430, __pyx_L1_error))
      __pyx_v_self->true_count = __pyx_f_5bcolz_10carray_ext_true_count(__pyx_v_array->data, __pyx_v_nbytes);

      /* "bcolz/carray_ext.pyx":429
 *                 blocksize = itemsize
 *         else:
 *             if self.typekind == 'b':             # <<<<<<<<<<<<<<
 *                 self.true_count = true_count(array.data, nbytes)
 * 
 */
    }

    /* "bcolz/carray_ext.pyx":432
 *                 self.true_count = true_count(array.data, nbytes)
 * 
 *             if array.strides[0] == 0:             # <<<<<<<<<<<<<<
 *                 # The chunk is made of constants.  Regenerate the actual data.
 *                 array = array.copy()
 */
    __Pyx_TraceLine(432,0,__PYX_ERR(0, 432, __pyx_L1_error))
    __pyx_t_5 = (((__pyx_v_array->strides[0]) == 0) != 0);
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":434
 *             if array.strides[0] == 0:
 *                 # The chunk is made of constants.  Regenerate the actual data.
 *                 array = array.copy()             # <<<<<<<<<<<<<<
 * 
 *             # Quantize data if necessary before compression
 */
      __Pyx_TraceLine(434,0,__PYX_ERR(0, 434, __pyx_L1_error))
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (__pyx_t_7) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __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_5numpy_ndarray))))) __PYX_ERR(0, 434, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_array, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":432
 *                 self.true_count = true_count(array.data, nbytes)
 * 
 *             if array.strides[0] == 0:             # <<<<<<<<<<<<<<
 *                 # The chunk is made of constants.  Regenerate the actual data.
 *                 array = array.copy()
 */
    }

    /* "bcolz/carray_ext.pyx":437
 * 
 *             # Quantize data if necessary before compression
 *             if cparams.quantize:             # <<<<<<<<<<<<<<
 *                 array = utils.quantize(array, cparams.quantize)
 *             # Compress data
 */
    __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cparams, __pyx_n_s_quantize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 437, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":438
 *             # Quantize data if necessary before compression
 *             if cparams.quantize:
 *                 array = utils.quantize(array, cparams.quantize)             # <<<<<<<<<<<<<<
 *             # Compress data
 *             cbytes, blocksize = self.compress_data(
 */
      __Pyx_TraceLine(438,0,__PYX_ERR(0, 438, __pyx_L1_error))
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_quantize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cparams, __pyx_n_s_quantize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_8 = 1;
        }
      }
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_array));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_array));
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_array));
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 438, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_array, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":437
 * 
 *             # Quantize data if necessary before compression
 *             if cparams.quantize:             # <<<<<<<<<<<<<<
 *                 array = utils.quantize(array, cparams.quantize)
 *             # Compress data
 */
    }

    /* "bcolz/carray_ext.pyx":440
 *                 array = utils.quantize(array, cparams.quantize)
 *             # Compress data
 *             cbytes, blocksize = self.compress_data(             # <<<<<<<<<<<<<<
 *                 array.data, itemsize, nbytes, cparams)
 *         return (nbytes, cbytes, blocksize, footprint)
 */
    __Pyx_TraceLine(440,0,__PYX_ERR(0, 440, __pyx_L1_error))
    __pyx_t_3 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk *)__pyx_v_self->__pyx_vtab)->compress_data(__pyx_v_self, __pyx_v_array->data, __pyx_v_itemsize, __pyx_v_nbytes, __pyx_v_cparams); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      #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_ERR(0, 440, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_9);
      #else
      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
      index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_1); if (unlikely(!__pyx_t_7)) goto __pyx_L14_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 1; __pyx_t_9 = __pyx_t_10(__pyx_t_1); if (unlikely(!__pyx_t_9)) goto __pyx_L14_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_1), 2) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L15_unpacking_done;
      __pyx_L14_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 440, __pyx_L1_error)
      __pyx_L15_unpacking_done:;
    }
    __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_7); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_11 = __Pyx_PyInt_As_size_t(__pyx_t_9); if (unlikely((__pyx_t_11 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_cbytes = __pyx_t_4;
    __pyx_v_blocksize = __pyx_t_11;
  }
  __pyx_L8:;

  /* "bcolz/carray_ext.pyx":442
 *             cbytes, blocksize = self.compress_data(
 *                 array.data, itemsize, nbytes, cparams)
 *         return (nbytes, cbytes, blocksize, footprint)             # <<<<<<<<<<<<<<
 * 
 *     cdef compress_data(self, char *data, size_t itemsize, size_t nbytes,
 */
  __Pyx_TraceLine(442,0,__PYX_ERR(0, 442, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_cbytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_blocksize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_footprint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_9 = 0;
  __pyx_t_7 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":394
 *         self.blocksize = blocksize
 * 
 *     cdef compress_arrdata(self, ndarray array, int itemsize,             # <<<<<<<<<<<<<<
 *                           object cparams, object _memory):
 *         """Compress data in `array`"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.compress_arrdata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":444
 *         return (nbytes, cbytes, blocksize, footprint)
 * 
 *     cdef compress_data(self, char *data, size_t itemsize, size_t nbytes,             # <<<<<<<<<<<<<<
 *                        object cparams):
 *         """Compress data with `cparams` and return metadata."""
 */

static PyObject *__pyx_f_5bcolz_10carray_ext_5chunk_compress_data(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, char *__pyx_v_data, size_t __pyx_v_itemsize, size_t __pyx_v_nbytes, PyObject *__pyx_v_cparams) {
  size_t __pyx_v_nbytes_;
  size_t __pyx_v_cbytes;
  size_t __pyx_v_blocksize;
  int __pyx_v_clevel;
  int __pyx_v_shuffle;
  int __pyx_v_ret;
  char *__pyx_v_dest;
  char *__pyx_v_cname_str;
  PyObject *__pyx_v_cname = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char const *__pyx_t_6;
  char *__pyx_t_7;
  __Pyx_RefNannySetupContext("compress_data", 0);
  __Pyx_TraceCall("compress_data", __pyx_f[0], 444, 0, __PYX_ERR(0, 444, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":452
 *         cdef char *cname_str
 * 
 *         clevel = cparams.clevel             # <<<<<<<<<<<<<<
 *         shuffle = cparams.shuffle
 *         cname = cparams.cname
 */
  __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cparams, __pyx_n_s_clevel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_clevel = __pyx_t_2;

  /* "bcolz/carray_ext.pyx":453
 * 
 *         clevel = cparams.clevel
 *         shuffle = cparams.shuffle             # <<<<<<<<<<<<<<
 *         cname = cparams.cname
 *         if type(cname) != bytes:
 */
  __Pyx_TraceLine(453,0,__PYX_ERR(0, 453, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cparams, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_shuffle = __pyx_t_2;

  /* "bcolz/carray_ext.pyx":454
 *         clevel = cparams.clevel
 *         shuffle = cparams.shuffle
 *         cname = cparams.cname             # <<<<<<<<<<<<<<
 *         if type(cname) != bytes:
 *             cname = cname.encode()
 */
  __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cparams, __pyx_n_s_cname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cname = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":455
 *         shuffle = cparams.shuffle
 *         cname = cparams.cname
 *         if type(cname) != bytes:             # <<<<<<<<<<<<<<
 *             cname = cname.encode()
 *         if blosc_set_compressor(cname) < 0:
 */
  __Pyx_TraceLine(455,0,__PYX_ERR(0, 455, __pyx_L1_error))
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_cname)), ((PyObject *)(&PyBytes_Type)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":456
 *         cname = cparams.cname
 *         if type(cname) != bytes:
 *             cname = cname.encode()             # <<<<<<<<<<<<<<
 *         if blosc_set_compressor(cname) < 0:
 *             raise ValueError(
 */
    __Pyx_TraceLine(456,0,__PYX_ERR(0, 456, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cname, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_cname, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":455
 *         shuffle = cparams.shuffle
 *         cname = cparams.cname
 *         if type(cname) != bytes:             # <<<<<<<<<<<<<<
 *             cname = cname.encode()
 *         if blosc_set_compressor(cname) < 0:
 */
  }

  /* "bcolz/carray_ext.pyx":457
 *         if type(cname) != bytes:
 *             cname = cname.encode()
 *         if blosc_set_compressor(cname) < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "Compressor '%s' is not available in this build" % cname)
 */
  __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_cname); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error)
  __pyx_t_3 = ((blosc_set_compressor(__pyx_t_6) < 0) != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":459
 *         if blosc_set_compressor(cname) < 0:
 *             raise ValueError(
 *                 "Compressor '%s' is not available in this build" % cname)             # <<<<<<<<<<<<<<
 *         dest = <char *> malloc(nbytes + BLOSC_MAX_OVERHEAD)
 *         if _get_use_threads():
 */
    __Pyx_TraceLine(459,0,__PYX_ERR(0, 459, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Compressor_s_is_not_available_in, __pyx_v_cname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "bcolz/carray_ext.pyx":458
 *             cname = cname.encode()
 *         if blosc_set_compressor(cname) < 0:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "Compressor '%s' is not available in this build" % cname)
 *         dest = <char *> malloc(nbytes + BLOSC_MAX_OVERHEAD)
 */
    __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 458, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":457
 *         if type(cname) != bytes:
 *             cname = cname.encode()
 *         if blosc_set_compressor(cname) < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "Compressor '%s' is not available in this build" % cname)
 */
  }

  /* "bcolz/carray_ext.pyx":460
 *             raise ValueError(
 *                 "Compressor '%s' is not available in this build" % cname)
 *         dest = <char *> malloc(nbytes + BLOSC_MAX_OVERHEAD)             # <<<<<<<<<<<<<<
 *         if _get_use_threads():
 *             with nogil:
 */
  __Pyx_TraceLine(460,0,__PYX_ERR(0, 460, __pyx_L1_error))
  __pyx_v_dest = ((char *)malloc((__pyx_v_nbytes + BLOSC_MAX_OVERHEAD)));

  /* "bcolz/carray_ext.pyx":461
 *                 "Compressor '%s' is not available in this build" % cname)
 *         dest = <char *> malloc(nbytes + BLOSC_MAX_OVERHEAD)
 *         if _get_use_threads():             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 ret = blosc_compress(clevel, shuffle, itemsize, nbytes,
 */
  __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_use_threads); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":462
 *         dest = <char *> malloc(nbytes + BLOSC_MAX_OVERHEAD)
 *         if _get_use_threads():
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 ret = blosc_compress(clevel, shuffle, itemsize, nbytes,
 *                                      data, dest, nbytes + BLOSC_MAX_OVERHEAD)
 */
    __Pyx_TraceLine(462,0,__PYX_ERR(0, 462, __pyx_L1_error))
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {

          /* "bcolz/carray_ext.pyx":463
 *         if _get_use_threads():
 *             with nogil:
 *                 ret = blosc_compress(clevel, shuffle, itemsize, nbytes,             # <<<<<<<<<<<<<<
 *                                      data, dest, nbytes + BLOSC_MAX_OVERHEAD)
 *         else:
 */
          __Pyx_TraceLine(463,1,__PYX_ERR(0, 463, __pyx_L7_error))
          __pyx_v_ret = blosc_compress(__pyx_v_clevel, __pyx_v_shuffle, __pyx_v_itemsize, __pyx_v_nbytes, __pyx_v_data, __pyx_v_dest, (__pyx_v_nbytes + BLOSC_MAX_OVERHEAD));
        }

        /* "bcolz/carray_ext.pyx":462
 *         dest = <char *> malloc(nbytes + BLOSC_MAX_OVERHEAD)
 *         if _get_use_threads():
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 ret = blosc_compress(clevel, shuffle, itemsize, nbytes,
 *                                      data, dest, nbytes + BLOSC_MAX_OVERHEAD)
 */
        __Pyx_TraceLine(462,1,__PYX_ERR(0, 462, __pyx_L1_error))
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L8;
          }
          __pyx_L7_error: {
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L8:;
        }
    }

    /* "bcolz/carray_ext.pyx":461
 *                 "Compressor '%s' is not available in this build" % cname)
 *         dest = <char *> malloc(nbytes + BLOSC_MAX_OVERHEAD)
 *         if _get_use_threads():             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 ret = blosc_compress(clevel, shuffle, itemsize, nbytes,
 */
    goto __pyx_L5;
  }

  /* "bcolz/carray_ext.pyx":466
 *                                      data, dest, nbytes + BLOSC_MAX_OVERHEAD)
 *         else:
 *             cname_str = cname             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 ret = blosc_compress_ctx(clevel, shuffle, itemsize, nbytes,
 */
  __Pyx_TraceLine(466,0,__PYX_ERR(0, 466, __pyx_L1_error))
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_cname); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L1_error)
    __pyx_v_cname_str = __pyx_t_7;

    /* "bcolz/carray_ext.pyx":467
 *         else:
 *             cname_str = cname
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 ret = blosc_compress_ctx(clevel, shuffle, itemsize, nbytes,
 *                                          data, dest,
 */
    __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error))
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {

          /* "bcolz/carray_ext.pyx":468
 *             cname_str = cname
 *             with nogil:
 *                 ret = blosc_compress_ctx(clevel, shuffle, itemsize, nbytes,             # <<<<<<<<<<<<<<
 *                                          data, dest,
 *                                          nbytes + BLOSC_MAX_OVERHEAD,
 */
          __Pyx_TraceLine(468,1,__PYX_ERR(0, 468, __pyx_L10_error))
          __pyx_v_ret = blosc_compress_ctx(__pyx_v_clevel, __pyx_v_shuffle, __pyx_v_itemsize, __pyx_v_nbytes, __pyx_v_data, __pyx_v_dest, (__pyx_v_nbytes + BLOSC_MAX_OVERHEAD), __pyx_v_cname_str, 0, 1);
        }

        /* "bcolz/carray_ext.pyx":467
 *         else:
 *             cname_str = cname
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 ret = blosc_compress_ctx(clevel, shuffle, itemsize, nbytes,
 *                                          data, dest,
 */
        __Pyx_TraceLine(467,1,__PYX_ERR(0, 467, __pyx_L1_error))
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L11;
          }
          __pyx_L10_error: {
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L11:;
        }
    }
  }
  __pyx_L5:;

  /* "bcolz/carray_ext.pyx":472
 *                                          nbytes + BLOSC_MAX_OVERHEAD,
 *                                          cname_str, 0, 1)
 *         if ret <= 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 "fatal error during Blosc compression: %d" % ret)
 */
  __Pyx_TraceLine(472,0,__PYX_ERR(0, 472, __pyx_L1_error))
  __pyx_t_3 = ((__pyx_v_ret <= 0) != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":474
 *         if ret <= 0:
 *             raise RuntimeError(
 *                 "fatal error during Blosc compression: %d" % ret)             # <<<<<<<<<<<<<<
 *         # Copy the compressed buffer into a Bytes buffer
 *         cbytes = ret
 */
    __Pyx_TraceLine(474,0,__PYX_ERR(0, 474, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_fatal_error_during_Blosc_compres, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":473
 *                                          cname_str, 0, 1)
 *         if ret <= 0:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 "fatal error during Blosc compression: %d" % ret)
 *         # Copy the compressed buffer into a Bytes buffer
 */
    __Pyx_TraceLine(473,0,__PYX_ERR(0, 473, __pyx_L1_error))
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 473, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":472
 *                                          nbytes + BLOSC_MAX_OVERHEAD,
 *                                          cname_str, 0, 1)
 *         if ret <= 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 "fatal error during Blosc compression: %d" % ret)
 */
  }

  /* "bcolz/carray_ext.pyx":476
 *                 "fatal error during Blosc compression: %d" % ret)
 *         # Copy the compressed buffer into a Bytes buffer
 *         cbytes = ret             # <<<<<<<<<<<<<<
 *         self.dobject = PyBytes_FromStringAndSize(dest, cbytes)
 *         # Get blocksize info for the instance
 */
  __Pyx_TraceLine(476,0,__PYX_ERR(0, 476, __pyx_L1_error))
  __pyx_v_cbytes = __pyx_v_ret;

  /* "bcolz/carray_ext.pyx":477
 *         # Copy the compressed buffer into a Bytes buffer
 *         cbytes = ret
 *         self.dobject = PyBytes_FromStringAndSize(dest, cbytes)             # <<<<<<<<<<<<<<
 *         # Get blocksize info for the instance
 *         blosc_cbuffer_sizes(dest, &nbytes_, &cbytes, &blocksize)
 */
  __Pyx_TraceLine(477,0,__PYX_ERR(0, 477, __pyx_L1_error))
  __pyx_t_4 = PyBytes_FromStringAndSize(__pyx_v_dest, __pyx_v_cbytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->dobject);
  __Pyx_DECREF(__pyx_v_self->dobject);
  __pyx_v_self->dobject = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "bcolz/carray_ext.pyx":479
 *         self.dobject = PyBytes_FromStringAndSize(dest, cbytes)
 *         # Get blocksize info for the instance
 *         blosc_cbuffer_sizes(dest, &nbytes_, &cbytes, &blocksize)             # <<<<<<<<<<<<<<
 *         assert nbytes_ == nbytes
 *         free(dest)
 */
  __Pyx_TraceLine(479,0,__PYX_ERR(0, 479, __pyx_L1_error))
  blosc_cbuffer_sizes(__pyx_v_dest, (&__pyx_v_nbytes_), (&__pyx_v_cbytes), (&__pyx_v_blocksize));

  /* "bcolz/carray_ext.pyx":480
 *         # Get blocksize info for the instance
 *         blosc_cbuffer_sizes(dest, &nbytes_, &cbytes, &blocksize)
 *         assert nbytes_ == nbytes             # <<<<<<<<<<<<<<
 *         free(dest)
 * 
 */
  __Pyx_TraceLine(480,0,__PYX_ERR(0, 480, __pyx_L1_error))
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_nbytes_ == __pyx_v_nbytes) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 480, __pyx_L1_error)
    }
  }
  #endif

  /* "bcolz/carray_ext.pyx":481
 *         blosc_cbuffer_sizes(dest, &nbytes_, &cbytes, &blocksize)
 *         assert nbytes_ == nbytes
 *         free(dest)             # <<<<<<<<<<<<<<
 * 
 *         return (cbytes, blocksize)
 */
  __Pyx_TraceLine(481,0,__PYX_ERR(0, 481, __pyx_L1_error))
  free(__pyx_v_dest);

  /* "bcolz/carray_ext.pyx":483
 *         free(dest)
 * 
 *         return (cbytes, blocksize)             # <<<<<<<<<<<<<<
 * 
 *     def getdata(self):
 */
  __Pyx_TraceLine(483,0,__PYX_ERR(0, 483, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_cbytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_blocksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":444
 *         return (nbytes, cbytes, blocksize, footprint)
 * 
 *     cdef compress_data(self, char *data, size_t itemsize, size_t nbytes,             # <<<<<<<<<<<<<<
 *                        object cparams):
 *         """Compress data with `cparams` and return metadata."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.compress_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":485
 *         return (cbytes, blocksize)
 * 
 *     def getdata(self):             # <<<<<<<<<<<<<<
 *         """Get a compressed string object for this chunk (for persistence)."""
 *         cdef object string
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_3getdata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_5chunk_2getdata[] = "chunk.getdata(self)\nGet a compressed string object for this chunk (for persistence).";
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_3getdata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getdata (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_2getdata(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_2getdata(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("getdata", 0);
  __Pyx_TraceCall("getdata", __pyx_f[0], 485, 0, __PYX_ERR(0, 485, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":489
 *         cdef object string
 * 
 *         assert (not self.isconstant,             # <<<<<<<<<<<<<<
 *                 "This function can only be used for persistency")
 *         return self.dobject
 */
  __Pyx_TraceLine(489,0,__PYX_ERR(0, 489, __pyx_L1_error))
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_1 = __Pyx_PyBool_FromLong((!(__pyx_v_self->isconstant != 0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_INCREF(__pyx_kp_s_This_function_can_only_be_used_f);
    __Pyx_GIVEREF(__pyx_kp_s_This_function_can_only_be_used_f);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_s_This_function_can_only_be_used_f);
    __pyx_t_1 = 0;
    __pyx_t_3 = (__pyx_t_2 != Py_None) && (PyTuple_GET_SIZE(__pyx_t_2) != 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 489, __pyx_L1_error)
    }
  }
  #endif

  /* "bcolz/carray_ext.pyx":491
 *         assert (not self.isconstant,
 *                 "This function can only be used for persistency")
 *         return self.dobject             # <<<<<<<<<<<<<<
 * 
 *     def getudata(self):
 */
  __Pyx_TraceLine(491,0,__PYX_ERR(0, 491, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->dobject);
  __pyx_r = __pyx_v_self->dobject;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":485
 *         return (cbytes, blocksize)
 * 
 *     def getdata(self):             # <<<<<<<<<<<<<<
 *         """Get a compressed string object for this chunk (for persistence)."""
 *         cdef object string
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.getdata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":493
 *         return self.dobject
 * 
 *     def getudata(self):             # <<<<<<<<<<<<<<
 *         """Get an uncompressed string out of this chunk (for 'O'bject types)."""
 *         cdef int ret
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_5getudata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_5chunk_4getudata[] = "chunk.getudata(self)\nGet an uncompressed string out of this chunk (for 'O'bject types).";
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_5getudata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getudata (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_4getudata(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_4getudata(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self) {
  int __pyx_v_ret;
  char *__pyx_v_src;
  char *__pyx_v_dest;
  PyObject *__pyx_v_result_str = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("getudata", 0);
  __Pyx_TraceCall("getudata", __pyx_f[0], 493, 0, __PYX_ERR(0, 493, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":499
 *         cdef char *dest
 * 
 *         result_str = PyBytes_FromStringAndSize(NULL, self.nbytes)             # <<<<<<<<<<<<<<
 *         src = PyBytes_AS_STRING(self.dobject)
 *         dest = PyBytes_AS_STRING(result_str)
 */
  __Pyx_TraceLine(499,0,__PYX_ERR(0, 499, __pyx_L1_error))
  __pyx_t_1 = PyBytes_FromStringAndSize(NULL, __pyx_v_self->nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result_str = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":500
 * 
 *         result_str = PyBytes_FromStringAndSize(NULL, self.nbytes)
 *         src = PyBytes_AS_STRING(self.dobject)             # <<<<<<<<<<<<<<
 *         dest = PyBytes_AS_STRING(result_str)
 * 
 */
  __Pyx_TraceLine(500,0,__PYX_ERR(0, 500, __pyx_L1_error))
  __pyx_t_1 = __pyx_v_self->dobject;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_src = PyBytes_AS_STRING(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":501
 *         result_str = PyBytes_FromStringAndSize(NULL, self.nbytes)
 *         src = PyBytes_AS_STRING(self.dobject)
 *         dest = PyBytes_AS_STRING(result_str)             # <<<<<<<<<<<<<<
 * 
 *         if _get_use_threads():
 */
  __Pyx_TraceLine(501,0,__PYX_ERR(0, 501, __pyx_L1_error))
  __pyx_v_dest = PyBytes_AS_STRING(__pyx_v_result_str);

  /* "bcolz/carray_ext.pyx":503
 *         dest = PyBytes_AS_STRING(result_str)
 * 
 *         if _get_use_threads():             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 ret = blosc_decompress(src, dest, self.nbytes)
 */
  __Pyx_TraceLine(503,0,__PYX_ERR(0, 503, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":504
 * 
 *         if _get_use_threads():
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 ret = blosc_decompress(src, dest, self.nbytes)
 *         else:
 */
    __Pyx_TraceLine(504,0,__PYX_ERR(0, 504, __pyx_L1_error))
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {

          /* "bcolz/carray_ext.pyx":505
 *         if _get_use_threads():
 *             with nogil:
 *                 ret = blosc_decompress(src, dest, self.nbytes)             # <<<<<<<<<<<<<<
 *         else:
 *             with nogil:
 */
          __Pyx_TraceLine(505,1,__PYX_ERR(0, 505, __pyx_L5_error))
          __pyx_v_ret = blosc_decompress(__pyx_v_src, __pyx_v_dest, __pyx_v_self->nbytes);
        }

        /* "bcolz/carray_ext.pyx":504
 * 
 *         if _get_use_threads():
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 ret = blosc_decompress(src, dest, self.nbytes)
 *         else:
 */
        __Pyx_TraceLine(504,1,__PYX_ERR(0, 504, __pyx_L1_error))
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "bcolz/carray_ext.pyx":503
 *         dest = PyBytes_AS_STRING(result_str)
 * 
 *         if _get_use_threads():             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 ret = blosc_decompress(src, dest, self.nbytes)
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":507
 *                 ret = blosc_decompress(src, dest, self.nbytes)
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 ret = blosc_decompress_ctx(src, dest, self.nbytes, 1)
 *         if ret < 0:
 */
  __Pyx_TraceLine(507,0,__PYX_ERR(0, 507, __pyx_L1_error))
  /*else*/ {
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        #endif
        /*try:*/ {

          /* "bcolz/carray_ext.pyx":508
 *         else:
 *             with nogil:
 *                 ret = blosc_decompress_ctx(src, dest, self.nbytes, 1)             # <<<<<<<<<<<<<<
 *         if ret < 0:
 *             raise RuntimeError(
 */
          __Pyx_TraceLine(508,1,__PYX_ERR(0, 508, __pyx_L8_error))
          __pyx_v_ret = blosc_decompress_ctx(__pyx_v_src, __pyx_v_dest, __pyx_v_self->nbytes, 1);
        }

        /* "bcolz/carray_ext.pyx":507
 *                 ret = blosc_decompress(src, dest, self.nbytes)
 *         else:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 ret = blosc_decompress_ctx(src, dest, self.nbytes, 1)
 *         if ret < 0:
 */
        __Pyx_TraceLine(507,1,__PYX_ERR(0, 507, __pyx_L1_error))
        /*finally:*/ {
          /*normal exit:*/{
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            #ifdef WITH_THREAD
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":509
 *             with nogil:
 *                 ret = blosc_decompress_ctx(src, dest, self.nbytes, 1)
 *         if ret < 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 "fatal error during Blosc decompression: %d" % ret)
 */
  __Pyx_TraceLine(509,0,__PYX_ERR(0, 509, __pyx_L1_error))
  __pyx_t_4 = ((__pyx_v_ret < 0) != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":511
 *         if ret < 0:
 *             raise RuntimeError(
 *                 "fatal error during Blosc decompression: %d" % ret)             # <<<<<<<<<<<<<<
 *         return result_str
 * 
 */
    __Pyx_TraceLine(511,0,__PYX_ERR(0, 511, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_fatal_error_during_Blosc_decompr, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":510
 *                 ret = blosc_decompress_ctx(src, dest, self.nbytes, 1)
 *         if ret < 0:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 "fatal error during Blosc decompression: %d" % ret)
 *         return result_str
 */
    __Pyx_TraceLine(510,0,__PYX_ERR(0, 510, __pyx_L1_error))
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__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_ERR(0, 510, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":509
 *             with nogil:
 *                 ret = blosc_decompress_ctx(src, dest, self.nbytes, 1)
 *         if ret < 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 "fatal error during Blosc decompression: %d" % ret)
 */
  }

  /* "bcolz/carray_ext.pyx":512
 *             raise RuntimeError(
 *                 "fatal error during Blosc decompression: %d" % ret)
 *         return result_str             # <<<<<<<<<<<<<<
 * 
 *     cdef void _getitem(self, int start, int stop, char *dest):
 */
  __Pyx_TraceLine(512,0,__PYX_ERR(0, 512, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result_str);
  __pyx_r = __pyx_v_result_str;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":493
 *         return self.dobject
 * 
 *     def getudata(self):             # <<<<<<<<<<<<<<
 *         """Get an uncompressed string out of this chunk (for 'O'bject types)."""
 *         cdef int ret
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.getudata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result_str);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":514
 *         return result_str
 * 
 *     cdef void _getitem(self, int start, int stop, char *dest):             # <<<<<<<<<<<<<<
 *         """Read data from `start` to `stop` and return it as a numpy array."""
 *         cdef int ret, bsize, blen, nitems, nstart
 */

static void __pyx_f_5bcolz_10carray_ext_5chunk__getitem(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, int __pyx_v_start, int __pyx_v_stop, char *__pyx_v_dest) {
  int __pyx_v_ret;
  int __pyx_v_bsize;
  int __pyx_v_blen;
  int __pyx_v_nitems;
  int __pyx_v_nstart;
  PyArrayObject *__pyx_v_constants = 0;
  char *__pyx_v_data;
  __Pyx_TraceDeclarations
  __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;
  __Pyx_RefNannySetupContext("_getitem", 0);
  __Pyx_TraceCall("_getitem", __pyx_f[0], 514, 0, __PYX_ERR(0, 514, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":520
 *         cdef char *data
 * 
 *         blen = stop - start             # <<<<<<<<<<<<<<
 *         bsize = blen * self.atomsize
 *         nitems = cython.cdiv(bsize, self.itemsize)
 */
  __Pyx_TraceLine(520,0,__PYX_ERR(0, 520, __pyx_L1_error))
  __pyx_v_blen = (__pyx_v_stop - __pyx_v_start);

  /* "bcolz/carray_ext.pyx":521
 * 
 *         blen = stop - start
 *         bsize = blen * self.atomsize             # <<<<<<<<<<<<<<
 *         nitems = cython.cdiv(bsize, self.itemsize)
 *         nstart = cython.cdiv(start * self.atomsize, self.itemsize)
 */
  __Pyx_TraceLine(521,0,__PYX_ERR(0, 521, __pyx_L1_error))
  __pyx_v_bsize = (__pyx_v_blen * __pyx_v_self->atomsize);

  /* "bcolz/carray_ext.pyx":522
 *         blen = stop - start
 *         bsize = blen * self.atomsize
 *         nitems = cython.cdiv(bsize, self.itemsize)             # <<<<<<<<<<<<<<
 *         nstart = cython.cdiv(start * self.atomsize, self.itemsize)
 * 
 */
  __Pyx_TraceLine(522,0,__PYX_ERR(0, 522, __pyx_L1_error))
  __pyx_v_nitems = (__pyx_v_bsize / __pyx_v_self->itemsize);

  /* "bcolz/carray_ext.pyx":523
 *         bsize = blen * self.atomsize
 *         nitems = cython.cdiv(bsize, self.itemsize)
 *         nstart = cython.cdiv(start * self.atomsize, self.itemsize)             # <<<<<<<<<<<<<<
 * 
 *         if self.isconstant:
 */
  __Pyx_TraceLine(523,0,__PYX_ERR(0, 523, __pyx_L1_error))
  __pyx_v_nstart = ((__pyx_v_start * __pyx_v_self->atomsize) / __pyx_v_self->itemsize);

  /* "bcolz/carray_ext.pyx":525
 *         nstart = cython.cdiv(start * self.atomsize, self.itemsize)
 * 
 *         if self.isconstant:             # <<<<<<<<<<<<<<
 *             # The chunk is made of constants
 *             constants = np.ndarray(shape=(blen,), dtype=self.dtype,
 */
  __Pyx_TraceLine(525,0,__PYX_ERR(0, 525, __pyx_L1_error))
  __pyx_t_1 = (__pyx_v_self->isconstant != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":527
 *         if self.isconstant:
 *             # The chunk is made of constants
 *             constants = np.ndarray(shape=(blen,), dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                    buffer=self.constant, strides=(0,)).copy()
 *             memcpy(dest, constants.data, bsize)
 */
    __Pyx_TraceLine(527,0,__PYX_ERR(0, 527, __pyx_L1_error))
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_blen); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":528
 *             # The chunk is made of constants
 *             constants = np.ndarray(shape=(blen,), dtype=self.dtype,
 *                                    buffer=self.constant, strides=(0,)).copy()             # <<<<<<<<<<<<<<
 *             memcpy(dest, constants.data, bsize)
 *             return
 */
    __Pyx_TraceLine(528,0,__PYX_ERR(0, 528, __pyx_L1_error))
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_buffer, __pyx_v_self->constant) < 0) __PYX_ERR(0, 527, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_strides, __pyx_tuple__12) < 0) __PYX_ERR(0, 527, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":527
 *         if self.isconstant:
 *             # The chunk is made of constants
 *             constants = np.ndarray(shape=(blen,), dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                    buffer=self.constant, strides=(0,)).copy()
 *             memcpy(dest, constants.data, bsize)
 */
    __Pyx_TraceLine(527,0,__PYX_ERR(0, 527, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_ndarray), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":528
 *             # The chunk is made of constants
 *             constants = np.ndarray(shape=(blen,), dtype=self.dtype,
 *                                    buffer=self.constant, strides=(0,)).copy()             # <<<<<<<<<<<<<<
 *             memcpy(dest, constants.data, bsize)
 *             return
 */
    __Pyx_TraceLine(528,0,__PYX_ERR(0, 528, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 528, __pyx_L1_error)
    __pyx_v_constants = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":529
 *             constants = np.ndarray(shape=(blen,), dtype=self.dtype,
 *                                    buffer=self.constant, strides=(0,)).copy()
 *             memcpy(dest, constants.data, bsize)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __Pyx_TraceLine(529,0,__PYX_ERR(0, 529, __pyx_L1_error))
    memcpy(__pyx_v_dest, __pyx_v_constants->data, __pyx_v_bsize);

    /* "bcolz/carray_ext.pyx":530
 *                                    buffer=self.constant, strides=(0,)).copy()
 *             memcpy(dest, constants.data, bsize)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Fill dest with uncompressed data
 */
    __Pyx_TraceLine(530,0,__PYX_ERR(0, 530, __pyx_L1_error))
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":525
 *         nstart = cython.cdiv(start * self.atomsize, self.itemsize)
 * 
 *         if self.isconstant:             # <<<<<<<<<<<<<<
 *             # The chunk is made of constants
 *             constants = np.ndarray(shape=(blen,), dtype=self.dtype,
 */
  }

  /* "bcolz/carray_ext.pyx":533
 * 
 *         # Fill dest with uncompressed data
 *         data = PyBytes_AS_STRING(self.dobject)             # <<<<<<<<<<<<<<
 *         if bsize == self.nbytes:
 *             ret = blosc_decompress(data, dest, bsize)
 */
  __Pyx_TraceLine(533,0,__PYX_ERR(0, 533, __pyx_L1_error))
  __pyx_t_2 = __pyx_v_self->dobject;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_data = PyBytes_AS_STRING(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":534
 *         # Fill dest with uncompressed data
 *         data = PyBytes_AS_STRING(self.dobject)
 *         if bsize == self.nbytes:             # <<<<<<<<<<<<<<
 *             ret = blosc_decompress(data, dest, bsize)
 *         else:
 */
  __Pyx_TraceLine(534,0,__PYX_ERR(0, 534, __pyx_L1_error))
  __pyx_t_1 = ((__pyx_v_bsize == __pyx_v_self->nbytes) != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":535
 *         data = PyBytes_AS_STRING(self.dobject)
 *         if bsize == self.nbytes:
 *             ret = blosc_decompress(data, dest, bsize)             # <<<<<<<<<<<<<<
 *         else:
 *             ret = blosc_getitem(data, nstart, nitems, dest)
 */
    __Pyx_TraceLine(535,0,__PYX_ERR(0, 535, __pyx_L1_error))
    __pyx_v_ret = blosc_decompress(__pyx_v_data, __pyx_v_dest, __pyx_v_bsize);

    /* "bcolz/carray_ext.pyx":534
 *         # Fill dest with uncompressed data
 *         data = PyBytes_AS_STRING(self.dobject)
 *         if bsize == self.nbytes:             # <<<<<<<<<<<<<<
 *             ret = blosc_decompress(data, dest, bsize)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "bcolz/carray_ext.pyx":537
 *             ret = blosc_decompress(data, dest, bsize)
 *         else:
 *             ret = blosc_getitem(data, nstart, nitems, dest)             # <<<<<<<<<<<<<<
 *         if ret < 0:
 *             raise RuntimeError(
 */
  __Pyx_TraceLine(537,0,__PYX_ERR(0, 537, __pyx_L1_error))
  /*else*/ {
    __pyx_v_ret = blosc_getitem(__pyx_v_data, __pyx_v_nstart, __pyx_v_nitems, __pyx_v_dest);
  }
  __pyx_L4:;

  /* "bcolz/carray_ext.pyx":538
 *         else:
 *             ret = blosc_getitem(data, nstart, nitems, dest)
 *         if ret < 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 "fatal error during Blosc decompression: %d" % ret)
 */
  __Pyx_TraceLine(538,0,__PYX_ERR(0, 538, __pyx_L1_error))
  __pyx_t_1 = ((__pyx_v_ret < 0) != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":540
 *         if ret < 0:
 *             raise RuntimeError(
 *                 "fatal error during Blosc decompression: %d" % ret)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, object key):
 */
    __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_fatal_error_during_Blosc_decompr, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":539
 *             ret = blosc_getitem(data, nstart, nitems, dest)
 *         if ret < 0:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 "fatal error during Blosc decompression: %d" % ret)
 * 
 */
    __Pyx_TraceLine(539,0,__PYX_ERR(0, 539, __pyx_L1_error))
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 539, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":538
 *         else:
 *             ret = blosc_getitem(data, nstart, nitems, dest)
 *         if ret < 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 "fatal error during Blosc decompression: %d" % ret)
 */
  }

  /* "bcolz/carray_ext.pyx":514
 *         return result_str
 * 
 *     cdef void _getitem(self, int start, int stop, char *dest):             # <<<<<<<<<<<<<<
 *         """Read data from `start` to `stop` and return it as a numpy array."""
 *         cdef int ret, bsize, blen, nitems, nstart
 */

  /* function exit code */
  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_WriteUnraisable("bcolz.carray_ext.chunk._getitem", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_constants);
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
}

/* "bcolz/carray_ext.pyx":542
 *                 "fatal error during Blosc decompression: %d" % ret)
 * 
 *     def __getitem__(self, object key):             # <<<<<<<<<<<<<<
 *         """__getitem__(self, key) -> values."""
 *         cdef ndarray array
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_5chunk_6__getitem__[] = "__getitem__(self, key) -> values.";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_6__getitem__;
#endif
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_6__getitem__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_6__getitem__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_key) {
  PyArrayObject *__pyx_v_array = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_v_clen = 0;
  PyObject *__pyx_v_idx = 0;
  PyObject *__pyx_v_idx2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_TraceCall("__getitem__", __pyx_f[0], 542, 0, __PYX_ERR(0, 542, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":547
 *         cdef object start, stop, step, clen, idx
 * 
 *         if isinstance(key, _inttypes):             # <<<<<<<<<<<<<<
 *             # Quickly return a single element
 *             array = np.empty(shape=(1,), dtype=self.dtype)
 */
  __Pyx_TraceLine(547,0,__PYX_ERR(0, 547, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_key, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":549
 *         if isinstance(key, _inttypes):
 *             # Quickly return a single element
 *             array = np.empty(shape=(1,), dtype=self.dtype)             # <<<<<<<<<<<<<<
 *             self._getitem(key, key + 1, array.data)
 *             return PyArray_GETITEM(array, array.data)
 */
    __Pyx_TraceLine(549,0,__PYX_ERR(0, 549, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_tuple__13) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 549, __pyx_L1_error)
    __pyx_v_array = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":550
 *             # Quickly return a single element
 *             array = np.empty(shape=(1,), dtype=self.dtype)
 *             self._getitem(key, key + 1, array.data)             # <<<<<<<<<<<<<<
 *             return PyArray_GETITEM(array, array.data)
 *         elif isinstance(key, slice):
 */
    __Pyx_TraceLine(550,0,__PYX_ERR(0, 550, __pyx_L1_error))
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_key); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk *)__pyx_v_self->__pyx_vtab)->_getitem(__pyx_v_self, __pyx_t_6, __pyx_t_7, __pyx_v_array->data);

    /* "bcolz/carray_ext.pyx":551
 *             array = np.empty(shape=(1,), dtype=self.dtype)
 *             self._getitem(key, key + 1, array.data)
 *             return PyArray_GETITEM(array, array.data)             # <<<<<<<<<<<<<<
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step
 */
    __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = PyArray_GETITEM(__pyx_v_array, __pyx_v_array->data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":547
 *         cdef object start, stop, step, clen, idx
 * 
 *         if isinstance(key, _inttypes):             # <<<<<<<<<<<<<<
 *             # Quickly return a single element
 *             array = np.empty(shape=(1,), dtype=self.dtype)
 */
  }

  /* "bcolz/carray_ext.pyx":552
 *             self._getitem(key, key + 1, array.data)
 *             return PyArray_GETITEM(array, array.data)
 *         elif isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             (start, stop, step) = key.start, key.stop, key.step
 *         elif isinstance(key, tuple) and self.dtype.shape != ():
 */
  __Pyx_TraceLine(552,0,__PYX_ERR(0, 552, __pyx_L1_error))
  __pyx_t_3 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":553
 *             return PyArray_GETITEM(array, array.data)
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step             # <<<<<<<<<<<<<<
 *         elif isinstance(key, tuple) and self.dtype.shape != ():
 *             # Build an array to guess indices
 */
    __Pyx_TraceLine(553,0,__PYX_ERR(0, 553, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_start = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_stop = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_step = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":552
 *             self._getitem(key, key + 1, array.data)
 *             return PyArray_GETITEM(array, array.data)
 *         elif isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             (start, stop, step) = key.start, key.stop, key.step
 *         elif isinstance(key, tuple) and self.dtype.shape != ():
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":554
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step
 *         elif isinstance(key, tuple) and self.dtype.shape != ():             # <<<<<<<<<<<<<<
 *             # Build an array to guess indices
 *             clen = cython.cdiv(self.nbytes, self.itemsize)
 */
  __Pyx_TraceLine(554,0,__PYX_ERR(0, 554, __pyx_L1_error))
  __pyx_t_3 = PyTuple_Check(__pyx_v_key); 
  __pyx_t_8 = (__pyx_t_3 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_2 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":556
 *         elif isinstance(key, tuple) and self.dtype.shape != ():
 *             # Build an array to guess indices
 *             clen = cython.cdiv(self.nbytes, self.itemsize)             # <<<<<<<<<<<<<<
 *             idx = np.arange(clen, dtype=np.int32).reshape(self.dtype.shape)
 *             idx2 = idx(key)
 */
    __Pyx_TraceLine(556,0,__PYX_ERR(0, 556, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->nbytes / __pyx_v_self->itemsize)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_clen = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":557
 *             # Build an array to guess indices
 *             clen = cython.cdiv(self.nbytes, self.itemsize)
 *             idx = np.arange(clen, dtype=np.int32).reshape(self.dtype.shape)             # <<<<<<<<<<<<<<
 *             idx2 = idx(key)
 *             if idx2.flags.contiguous:
 */
    __Pyx_TraceLine(557,0,__PYX_ERR(0, 557, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_clen);
    __Pyx_GIVEREF(__pyx_v_clen);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_clen);
    __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_reshape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    if (!__pyx_t_11) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL;
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_idx = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":558
 *             clen = cython.cdiv(self.nbytes, self.itemsize)
 *             idx = np.arange(clen, dtype=np.int32).reshape(self.dtype.shape)
 *             idx2 = idx(key)             # <<<<<<<<<<<<<<
 *             if idx2.flags.contiguous:
 *                 # The slice represents a contiguous slice.  Get start and stop.
 */
    __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error))
    __Pyx_INCREF(__pyx_v_idx);
    __pyx_t_9 = __pyx_v_idx; __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_key);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_idx2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":559
 *             idx = np.arange(clen, dtype=np.int32).reshape(self.dtype.shape)
 *             idx2 = idx(key)
 *             if idx2.flags.contiguous:             # <<<<<<<<<<<<<<
 *                 # The slice represents a contiguous slice.  Get start and stop.
 *                 start, stop = idx2.flatten()[[0, -1]]
 */
    __Pyx_TraceLine(559,0,__PYX_ERR(0, 559, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_idx2, __pyx_n_s_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":561
 *             if idx2.flags.contiguous:
 *                 # The slice represents a contiguous slice.  Get start and stop.
 *                 start, stop = idx2.flatten()[[0, -1]]             # <<<<<<<<<<<<<<
 *                 step = 1
 *             else:
 */
      __Pyx_TraceLine(561,0,__PYX_ERR(0, 561, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_idx2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_1) {
        __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 561, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 561, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
      __Pyx_INCREF(__pyx_int_neg_1);
      __Pyx_GIVEREF(__pyx_int_neg_1);
      PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1);
      __pyx_t_1 = PyObject_GetItem(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        #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_ERR(0, 561, __pyx_L1_error)
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 561, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_12(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_5); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_5), 2) < 0) __PYX_ERR(0, 561, __pyx_L1_error)
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L8_unpacking_done;
        __pyx_L7_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 561, __pyx_L1_error)
        __pyx_L8_unpacking_done:;
      }
      __pyx_v_start = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_v_stop = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "bcolz/carray_ext.pyx":562
 *                 # The slice represents a contiguous slice.  Get start and stop.
 *                 start, stop = idx2.flatten()[[0, -1]]
 *                 step = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 (start, stop, step) = key[0].start, key[0].stop, key[0].step
 */
      __Pyx_TraceLine(562,0,__PYX_ERR(0, 562, __pyx_L1_error))
      __Pyx_INCREF(__pyx_int_1);
      __pyx_v_step = __pyx_int_1;

      /* "bcolz/carray_ext.pyx":559
 *             idx = np.arange(clen, dtype=np.int32).reshape(self.dtype.shape)
 *             idx2 = idx(key)
 *             if idx2.flags.contiguous:             # <<<<<<<<<<<<<<
 *                 # The slice represents a contiguous slice.  Get start and stop.
 *                 start, stop = idx2.flatten()[[0, -1]]
 */
      goto __pyx_L6;
    }

    /* "bcolz/carray_ext.pyx":564
 *                 step = 1
 *             else:
 *                 (start, stop, step) = key[0].start, key[0].stop, key[0].step             # <<<<<<<<<<<<<<
 *         else:
 *             raise IndexError("key not suitable:", key)
 */
    __Pyx_TraceLine(564,0,__PYX_ERR(0, 564, __pyx_L1_error))
    /*else*/ {
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_start = __pyx_t_9;
      __pyx_t_9 = 0;
      __pyx_v_stop = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_v_step = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_L6:;

    /* "bcolz/carray_ext.pyx":554
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step
 *         elif isinstance(key, tuple) and self.dtype.shape != ():             # <<<<<<<<<<<<<<
 *             # Build an array to guess indices
 *             clen = cython.cdiv(self.nbytes, self.itemsize)
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":566
 *                 (start, stop, step) = key[0].start, key[0].stop, key[0].step
 *         else:
 *             raise IndexError("key not suitable:", key)             # <<<<<<<<<<<<<<
 * 
 *         # Get the corrected values for start, stop, step
 */
  __Pyx_TraceLine(566,0,__PYX_ERR(0, 566, __pyx_L1_error))
  /*else*/ {
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_kp_s_key_not_suitable);
    __Pyx_GIVEREF(__pyx_kp_s_key_not_suitable);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_key_not_suitable);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_key);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 566, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":569
 * 
 *         # Get the corrected values for start, stop, step
 *         clen = cython.cdiv(self.nbytes, self.atomsize)             # <<<<<<<<<<<<<<
 *         (start, stop, step) = slice(start, stop, step).indices(clen)
 * 
 */
  __Pyx_TraceLine(569,0,__PYX_ERR(0, 569, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->nbytes / __pyx_v_self->atomsize)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XDECREF_SET(__pyx_v_clen, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "bcolz/carray_ext.pyx":570
 *         # Get the corrected values for start, stop, step
 *         clen = cython.cdiv(self.nbytes, self.atomsize)
 *         (start, stop, step) = slice(start, stop, step).indices(clen)             # <<<<<<<<<<<<<<
 * 
 *         # Build a numpy container
 */
  __Pyx_TraceLine(570,0,__PYX_ERR(0, 570, __pyx_L1_error))
  __pyx_t_5 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_indices); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_clen); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_clen);
    __Pyx_GIVEREF(__pyx_v_clen);
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_clen);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    #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_ERR(0, 570, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
    index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_9);
    index = 1; __pyx_t_1 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 2; __pyx_t_5 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_5)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
    __pyx_t_12 = NULL;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L10_unpacking_done;
    __pyx_L9_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_12 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 570, __pyx_L1_error)
    __pyx_L10_unpacking_done:;
  }
  __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_9);
  __pyx_t_9 = 0;
  __Pyx_DECREF_SET(__pyx_v_stop, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_step, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":573
 * 
 *         # Build a numpy container
 *         array = np.empty(shape=(stop - start,), dtype=self.dtype)             # <<<<<<<<<<<<<<
 *         # Read actual data
 *         self._getitem(start, stop, array.data)
 */
  __Pyx_TraceLine(573,0,__PYX_ERR(0, 573, __pyx_L1_error))
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_stop, __pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_9) < 0) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 573, __pyx_L1_error)
  __pyx_v_array = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "bcolz/carray_ext.pyx":575
 *         array = np.empty(shape=(stop - start,), dtype=self.dtype)
 *         # Read actual data
 *         self._getitem(start, stop, array.data)             # <<<<<<<<<<<<<<
 * 
 *         # Return the value depending on the step
 */
  __Pyx_TraceLine(575,0,__PYX_ERR(0, 575, __pyx_L1_error))
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_start); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 575, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_stop); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 575, __pyx_L1_error)
  ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk *)__pyx_v_self->__pyx_vtab)->_getitem(__pyx_v_self, __pyx_t_7, __pyx_t_6, __pyx_v_array->data);

  /* "bcolz/carray_ext.pyx":578
 * 
 *         # Return the value depending on the step
 *         if step > 1:             # <<<<<<<<<<<<<<
 *             return array[::step]
 *         return array
 */
  __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error))
  __pyx_t_9 = PyObject_RichCompare(__pyx_v_step, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 578, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":579
 *         # Return the value depending on the step
 *         if step > 1:
 *             return array[::step]             # <<<<<<<<<<<<<<
 *         return array
 * 
 */
    __Pyx_TraceLine(579,0,__PYX_ERR(0, 579, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = PySlice_New(Py_None, Py_None, __pyx_v_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_array), __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":578
 * 
 *         # Return the value depending on the step
 *         if step > 1:             # <<<<<<<<<<<<<<
 *             return array[::step]
 *         return array
 */
  }

  /* "bcolz/carray_ext.pyx":580
 *         if step > 1:
 *             return array[::step]
 *         return array             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, object key, object value):
 */
  __Pyx_TraceLine(580,0,__PYX_ERR(0, 580, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_array));
  __pyx_r = ((PyObject *)__pyx_v_array);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":542
 *                 "fatal error during Blosc decompression: %d" % ret)
 * 
 *     def __getitem__(self, object key):             # <<<<<<<<<<<<<<
 *         """__getitem__(self, key) -> values."""
 *         cdef ndarray array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_array);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_stop);
  __Pyx_XDECREF(__pyx_v_step);
  __Pyx_XDECREF(__pyx_v_clen);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_idx2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":582
 *         return array
 * 
 *     def __setitem__(self, object key, object value):             # <<<<<<<<<<<<<<
 *         """__setitem__(self, key, value) -> None."""
 *         raise NotImplementedError()
 */

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_5chunk_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_5chunk_8__setitem__[] = "__setitem__(self, key, value) -> None.";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_8__setitem__;
#endif
static int __pyx_pw_5bcolz_10carray_ext_5chunk_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_8__setitem__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_5chunk_8__setitem__(CYTHON_UNUSED struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_key, CYTHON_UNUSED PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_TraceCall("__setitem__", __pyx_f[0], 582, 0, __PYX_ERR(0, 582, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":584
 *     def __setitem__(self, object key, object value):
 *         """__setitem__(self, key, value) -> None."""
 *         raise NotImplementedError()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_TraceLine(584,0,__PYX_ERR(0, 584, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 584, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":582
 *         return array
 * 
 *     def __setitem__(self, object key, object value):             # <<<<<<<<<<<<<<
 *         """__setitem__(self, key, value) -> None."""
 *         raise NotImplementedError()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":586
 *         raise NotImplementedError()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """Represent the chunk as an string."""
 *         return str(self[:])
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_11__str__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_5chunk_10__str__[] = "Represent the chunk as an string.";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_10__str__;
#endif
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_11__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_10__str__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_10__str__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);
  __Pyx_TraceCall("__str__", __pyx_f[0], 586, 0, __PYX_ERR(0, 586, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":588
 *     def __str__(self):
 *         """Represent the chunk as an string."""
 *         return str(self[:])             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, 0, NULL, NULL, &__pyx_slice__14, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __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;

  /* "bcolz/carray_ext.pyx":586
 *         raise NotImplementedError()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         """Represent the chunk as an string."""
 *         return str(self[:])
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":590
 *         return str(self[:])
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         """Represent the chunk as an string, with additional info."""
 *         cratio = self.nbytes / float(self.cbytes)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_13__repr__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_5chunk_12__repr__[] = "Represent the chunk as an string, with additional info.";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_12__repr__;
#endif
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_13__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_12__repr__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_12__repr__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self) {
  double __pyx_v_cratio;
  PyObject *__pyx_v_fullrepr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);
  __Pyx_TraceCall("__repr__", __pyx_f[0], 590, 0, __PYX_ERR(0, 590, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":592
 *     def __repr__(self):
 *         """Represent the chunk as an string, with additional info."""
 *         cratio = self.nbytes / float(self.cbytes)             # <<<<<<<<<<<<<<
 *         fullrepr = "chunk(%s)  nbytes: %d; cbytes: %d; ratio: %.2f\n%r" % \
 *                    (self.dtype, self.nbytes, self.cbytes, cratio, str(self))
 */
  __Pyx_TraceLine(592,0,__PYX_ERR(0, 592, __pyx_L1_error))
  if (unlikely(((double)__pyx_v_self->cbytes) == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 592, __pyx_L1_error)
  }
  __pyx_v_cratio = (__pyx_v_self->nbytes / ((double)__pyx_v_self->cbytes));

  /* "bcolz/carray_ext.pyx":594
 *         cratio = self.nbytes / float(self.cbytes)
 *         fullrepr = "chunk(%s)  nbytes: %d; cbytes: %d; ratio: %.2f\n%r" % \
 *                    (self.dtype, self.nbytes, self.cbytes, cratio, str(self))             # <<<<<<<<<<<<<<
 *         return fullrepr
 * 
 */
  __Pyx_TraceLine(594,0,__PYX_ERR(0, 594, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_cratio); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_6);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":593
 *         """Represent the chunk as an string, with additional info."""
 *         cratio = self.nbytes / float(self.cbytes)
 *         fullrepr = "chunk(%s)  nbytes: %d; cbytes: %d; ratio: %.2f\n%r" % \             # <<<<<<<<<<<<<<
 *                    (self.dtype, self.nbytes, self.cbytes, cratio, str(self))
 *         return fullrepr
 */
  __Pyx_TraceLine(593,0,__PYX_ERR(0, 593, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_chunk_s_nbytes_d_cbytes_d_ratio, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_fullrepr = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":595
 *         fullrepr = "chunk(%s)  nbytes: %d; cbytes: %d; ratio: %.2f\n%r" % \
 *                    (self.dtype, self.nbytes, self.cbytes, cratio, str(self))
 *         return fullrepr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_TraceLine(595,0,__PYX_ERR(0, 595, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fullrepr);
  __pyx_r = __pyx_v_fullrepr;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":590
 *         return str(self[:])
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         """Represent the chunk as an string, with additional info."""
 *         cratio = self.nbytes / float(self.cbytes)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fullrepr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pxd":4
 * 
 * cdef class chunk:
 *     cdef public int atomsize, itemsize, blocksize             # <<<<<<<<<<<<<<
 *     cdef public int nbytes, cbytes
 *     cdef object dobject
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_8atomsize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_8atomsize_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_8atomsize___get__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_8atomsize___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[1], 4, 0, __PYX_ERR(1, 4, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->atomsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.atomsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_5chunk_8atomsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_5chunk_8atomsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_8atomsize_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_5chunk_8atomsize_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[1], 4, 0, __PYX_ERR(1, 4, __pyx_L1_error));
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_v_self->atomsize = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.atomsize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_8itemsize_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_8itemsize___get__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_8itemsize___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[1], 4, 0, __PYX_ERR(1, 4, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_5chunk_8itemsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_5chunk_8itemsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_8itemsize_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_5chunk_8itemsize_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[1], 4, 0, __PYX_ERR(1, 4, __pyx_L1_error));
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_v_self->itemsize = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.itemsize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_9blocksize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_9blocksize_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_9blocksize___get__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_9blocksize___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[1], 4, 0, __PYX_ERR(1, 4, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->blocksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.blocksize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_5chunk_9blocksize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_5chunk_9blocksize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_9blocksize_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_5chunk_9blocksize_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[1], 4, 0, __PYX_ERR(1, 4, __pyx_L1_error));
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_v_self->blocksize = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.blocksize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pxd":5
 * cdef class chunk:
 *     cdef public int atomsize, itemsize, blocksize
 *     cdef public int nbytes, cbytes             # <<<<<<<<<<<<<<
 *     cdef object dobject
 *     cdef char typekind, isconstant
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_6nbytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_6nbytes___get__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_6nbytes___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[1], 5, 0, __PYX_ERR(1, 5, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_5chunk_6nbytes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_5chunk_6nbytes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_6nbytes_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_5chunk_6nbytes_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[1], 5, 0, __PYX_ERR(1, 5, __pyx_L1_error));
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 5, __pyx_L1_error)
  __pyx_v_self->nbytes = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.nbytes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_6cbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_5chunk_6cbytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_6cbytes___get__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_5chunk_6cbytes___get__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[1], 5, 0, __PYX_ERR(1, 5, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.cbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_5chunk_6cbytes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_5chunk_6cbytes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_5chunk_6cbytes_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_5chunk_6cbytes_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[1], 5, 0, __PYX_ERR(1, 5, __pyx_L1_error));
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 5, __pyx_L1_error)
  __pyx_v_self->cbytes = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunk.cbytes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":598
 * 
 * 
 * cdef create_bloscpack_header(nchunks=None, format_version=FORMAT_VERSION):             # <<<<<<<<<<<<<<
 *     """Create the bloscpack header string.
 * 
 */

static PyObject *__pyx_f_5bcolz_10carray_ext_create_bloscpack_header(struct __pyx_opt_args_5bcolz_10carray_ext_create_bloscpack_header *__pyx_optional_args) {
  PyObject *__pyx_v_nchunks = ((PyObject *)Py_None);
  PyObject *__pyx_v_format_version = __pyx_k__15;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("create_bloscpack_header", 0);
  __Pyx_TraceCall("create_bloscpack_header", __pyx_f[0], 598, 0, __PYX_ERR(0, 598, __pyx_L1_error));
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_nchunks = __pyx_optional_args->nchunks;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_format_version = __pyx_optional_args->format_version;
      }
    }
  }

  /* "bcolz/carray_ext.pyx":641
 * 
 *     """
 *     if not 0 <= nchunks <= MAX_CHUNKS and nchunks is not None:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "'nchunks' must be in the range 0 <= n <= %d, not '%s'" %
 */
  __Pyx_TraceLine(641,0,__PYX_ERR(0, 641, __pyx_L1_error))
  __pyx_t_2 = PyObject_RichCompare(__pyx_int_0, __pyx_v_nchunks, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_MAX_CHUNKS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_nchunks, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = (__pyx_v_nchunks != Py_None);
  __pyx_t_4 = (__pyx_t_5 != 0);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":644
 *         raise ValueError(
 *             "'nchunks' must be in the range 0 <= n <= %d, not '%s'" %
 *             (MAX_CHUNKS, str(nchunks)))             # <<<<<<<<<<<<<<
 *     return (MAGIC + struct.pack('<B', format_version) + b'\x00\x00\x00' +
 *             struct.pack('<q', nchunks if nchunks is not None else -1))
 */
    __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error))
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MAX_CHUNKS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_nchunks);
    __Pyx_GIVEREF(__pyx_v_nchunks);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_nchunks);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __pyx_t_2 = 0;
    __pyx_t_6 = 0;

    /* "bcolz/carray_ext.pyx":643
 *     if not 0 <= nchunks <= MAX_CHUNKS and nchunks is not None:
 *         raise ValueError(
 *             "'nchunks' must be in the range 0 <= n <= %d, not '%s'" %             # <<<<<<<<<<<<<<
 *             (MAX_CHUNKS, str(nchunks)))
 *     return (MAGIC + struct.pack('<B', format_version) + b'\x00\x00\x00' +
 */
    __Pyx_TraceLine(643,0,__PYX_ERR(0, 643, __pyx_L1_error))
    __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_nchunks_must_be_in_the_range_0, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":642
 *     """
 *     if not 0 <= nchunks <= MAX_CHUNKS and nchunks is not None:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "'nchunks' must be in the range 0 <= n <= %d, not '%s'" %
 *             (MAX_CHUNKS, str(nchunks)))
 */
    __Pyx_TraceLine(642,0,__PYX_ERR(0, 642, __pyx_L1_error))
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 642, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":641
 * 
 *     """
 *     if not 0 <= nchunks <= MAX_CHUNKS and nchunks is not None:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "'nchunks' must be in the range 0 <= n <= %d, not '%s'" %
 */
  }

  /* "bcolz/carray_ext.pyx":645
 *             "'nchunks' must be in the range 0 <= n <= %d, not '%s'" %
 *             (MAX_CHUNKS, str(nchunks)))
 *     return (MAGIC + struct.pack('<B', format_version) + b'\x00\x00\x00' +             # <<<<<<<<<<<<<<
 *             struct.pack('<q', nchunks if nchunks is not None else -1))
 * 
 */
  __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_MAGIC); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_B);
  __Pyx_GIVEREF(__pyx_kp_s_B);
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_kp_s_B);
  __Pyx_INCREF(__pyx_v_format_version);
  __Pyx_GIVEREF(__pyx_v_format_version);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_format_version);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_kp_b__16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "bcolz/carray_ext.pyx":646
 *             (MAX_CHUNKS, str(nchunks)))
 *     return (MAGIC + struct.pack('<B', format_version) + b'\x00\x00\x00' +
 *             struct.pack('<q', nchunks if nchunks is not None else -1))             # <<<<<<<<<<<<<<
 * 
 * if sys.version_info >= (3, 0):
 */
  __Pyx_TraceLine(646,0,__PYX_ERR(0, 646, __pyx_L1_error))
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pack); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = (__pyx_v_nchunks != Py_None);
  if ((__pyx_t_1 != 0)) {
    __Pyx_INCREF(__pyx_v_nchunks);
    __pyx_t_6 = __pyx_v_nchunks;
  } else {
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_t_6 = __pyx_int_neg_1;
  }
  __pyx_t_2 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_10 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_q);
  __Pyx_GIVEREF(__pyx_kp_s_q);
  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_8, __pyx_kp_s_q);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "bcolz/carray_ext.pyx":645
 *             "'nchunks' must be in the range 0 <= n <= %d, not '%s'" %
 *             (MAX_CHUNKS, str(nchunks)))
 *     return (MAGIC + struct.pack('<B', format_version) + b'\x00\x00\x00' +             # <<<<<<<<<<<<<<
 *             struct.pack('<q', nchunks if nchunks is not None else -1))
 * 
 */
  __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error))
  __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":598
 * 
 * 
 * cdef create_bloscpack_header(nchunks=None, format_version=FORMAT_VERSION):             # <<<<<<<<<<<<<<
 *     """Create the bloscpack header string.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("bcolz.carray_ext.create_bloscpack_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":649
 * 
 * if sys.version_info >= (3, 0):
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return byte
 * else:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_15decode_byte(PyObject *__pyx_self, PyObject *__pyx_v_byte); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_14decode_byte[] = "decode_byte(byte)";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_15decode_byte = {"decode_byte", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_15decode_byte, METH_O, __pyx_doc_5bcolz_10carray_ext_14decode_byte};
static PyObject *__pyx_pw_5bcolz_10carray_ext_15decode_byte(PyObject *__pyx_self, PyObject *__pyx_v_byte) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode_byte (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_14decode_byte(__pyx_self, ((PyObject *)__pyx_v_byte));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_14decode_byte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_byte) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_TraceFrameInit(__pyx_codeobj__17)
  __Pyx_RefNannySetupContext("decode_byte", 0);
  __Pyx_TraceCall("decode_byte", __pyx_f[0], 649, 0, __PYX_ERR(0, 649, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":650
 * if sys.version_info >= (3, 0):
 *     def decode_byte(byte):
 *         return byte             # <<<<<<<<<<<<<<
 * else:
 *     def decode_byte(byte):
 */
  __Pyx_TraceLine(650,0,__PYX_ERR(0, 650, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_byte);
  __pyx_r = __pyx_v_byte;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":649
 * 
 * if sys.version_info >= (3, 0):
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return byte
 * else:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.decode_byte", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":652
 *         return byte
 * else:
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_17decode_byte(PyObject *__pyx_self, PyObject *__pyx_v_byte); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_16decode_byte[] = "decode_byte(byte)";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_17decode_byte = {"decode_byte", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_17decode_byte, METH_O, __pyx_doc_5bcolz_10carray_ext_16decode_byte};
static PyObject *__pyx_pw_5bcolz_10carray_ext_17decode_byte(PyObject *__pyx_self, PyObject *__pyx_v_byte) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode_byte (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_16decode_byte(__pyx_self, ((PyObject *)__pyx_v_byte));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_16decode_byte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_byte) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_TraceFrameInit(__pyx_codeobj__18)
  __Pyx_RefNannySetupContext("decode_byte", 0);
  __Pyx_TraceCall("decode_byte", __pyx_f[0], 652, 0, __PYX_ERR(0, 652, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":653
 * else:
 *     def decode_byte(byte):
 *         return int(byte.encode('hex'), 16)             # <<<<<<<<<<<<<<
 * def decode_uint32(fourbyte):
 *     return struct.unpack('<I', fourbyte)[0]
 */
  __Pyx_TraceLine(653,0,__PYX_ERR(0, 653, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_byte, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __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_ERR(0, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_int_16);
  __Pyx_GIVEREF(__pyx_int_16);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_16);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":652
 *         return byte
 * else:
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bcolz.carray_ext.decode_byte", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":654
 *     def decode_byte(byte):
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):             # <<<<<<<<<<<<<<
 *     return struct.unpack('<I', fourbyte)[0]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_19decode_uint32(PyObject *__pyx_self, PyObject *__pyx_v_fourbyte); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_18decode_uint32[] = "decode_uint32(fourbyte)";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_19decode_uint32 = {"decode_uint32", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_19decode_uint32, METH_O, __pyx_doc_5bcolz_10carray_ext_18decode_uint32};
static PyObject *__pyx_pw_5bcolz_10carray_ext_19decode_uint32(PyObject *__pyx_self, PyObject *__pyx_v_fourbyte) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode_uint32 (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_18decode_uint32(__pyx_self, ((PyObject *)__pyx_v_fourbyte));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_18decode_uint32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fourbyte) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_TraceFrameInit(__pyx_codeobj__20)
  __Pyx_RefNannySetupContext("decode_uint32", 0);
  __Pyx_TraceCall("decode_uint32", __pyx_f[0], 654, 0, __PYX_ERR(0, 654, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":655
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):
 *     return struct.unpack('<I', fourbyte)[0]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_TraceLine(655,0,__PYX_ERR(0, 655, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unpack); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_I);
  __Pyx_GIVEREF(__pyx_kp_s_I);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_s_I);
  __Pyx_INCREF(__pyx_v_fourbyte);
  __Pyx_GIVEREF(__pyx_v_fourbyte);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_fourbyte);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":654
 *     def decode_byte(byte):
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):             # <<<<<<<<<<<<<<
 *     return struct.unpack('<I', fourbyte)[0]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bcolz.carray_ext.decode_uint32", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":658
 * 
 * 
 * cdef decode_blosc_header(buffer_):             # <<<<<<<<<<<<<<
 *     """ Read and decode header from compressed Blosc buffer.
 * 
 */

static PyObject *__pyx_f_5bcolz_10carray_ext_decode_blosc_header(PyObject *__pyx_v_buffer_) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("decode_blosc_header", 0);
  __Pyx_TraceCall("decode_blosc_header", __pyx_f[0], 658, 0, __PYX_ERR(0, 658, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":690
 * 
 *     """
 *     return {'version': decode_byte(buffer_[0]),             # <<<<<<<<<<<<<<
 *             'versionlz': decode_byte(buffer_[1]),
 *             'flags': decode_byte(buffer_[2]),
 */
  __Pyx_TraceLine(690,0,__PYX_ERR(0, 690, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_buffer_, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_version, __pyx_t_2) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":691
 *     """
 *     return {'version': decode_byte(buffer_[0]),
 *             'versionlz': decode_byte(buffer_[1]),             # <<<<<<<<<<<<<<
 *             'flags': decode_byte(buffer_[2]),
 *             'typesize': decode_byte(buffer_[3]),
 */
  __Pyx_TraceLine(691,0,__PYX_ERR(0, 691, __pyx_L1_error))
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_buffer_, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_versionlz, __pyx_t_2) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":692
 *     return {'version': decode_byte(buffer_[0]),
 *             'versionlz': decode_byte(buffer_[1]),
 *             'flags': decode_byte(buffer_[2]),             # <<<<<<<<<<<<<<
 *             'typesize': decode_byte(buffer_[3]),
 *             'nbytes': decode_uint32(buffer_[4:8]),
 */
  __Pyx_TraceLine(692,0,__PYX_ERR(0, 692, __pyx_L1_error))
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_buffer_, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_flags, __pyx_t_2) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":693
 *             'versionlz': decode_byte(buffer_[1]),
 *             'flags': decode_byte(buffer_[2]),
 *             'typesize': decode_byte(buffer_[3]),             # <<<<<<<<<<<<<<
 *             'nbytes': decode_uint32(buffer_[4:8]),
 *             'blocksize': decode_uint32(buffer_[8:12]),
 */
  __Pyx_TraceLine(693,0,__PYX_ERR(0, 693, __pyx_L1_error))
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_byte); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_buffer_, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_typesize, __pyx_t_2) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":694
 *             'flags': decode_byte(buffer_[2]),
 *             'typesize': decode_byte(buffer_[3]),
 *             'nbytes': decode_uint32(buffer_[4:8]),             # <<<<<<<<<<<<<<
 *             'blocksize': decode_uint32(buffer_[8:12]),
 *             'ctbytes': decode_uint32(buffer_[12:16])}
 */
  __Pyx_TraceLine(694,0,__PYX_ERR(0, 694, __pyx_L1_error))
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_buffer_, 4, 8, NULL, NULL, &__pyx_slice__21, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nbytes, __pyx_t_2) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":695
 *             'typesize': decode_byte(buffer_[3]),
 *             'nbytes': decode_uint32(buffer_[4:8]),
 *             'blocksize': decode_uint32(buffer_[8:12]),             # <<<<<<<<<<<<<<
 *             'ctbytes': decode_uint32(buffer_[12:16])}
 * 
 */
  __Pyx_TraceLine(695,0,__PYX_ERR(0, 695, __pyx_L1_error))
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_buffer_, 8, 12, NULL, NULL, &__pyx_slice__22, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_blocksize, __pyx_t_2) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":696
 *             'nbytes': decode_uint32(buffer_[4:8]),
 *             'blocksize': decode_uint32(buffer_[8:12]),
 *             'ctbytes': decode_uint32(buffer_[12:16])}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_TraceLine(696,0,__PYX_ERR(0, 696, __pyx_L1_error))
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_buffer_, 12, 16, NULL, NULL, &__pyx_slice__23, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ctbytes, __pyx_t_2) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":658
 * 
 * 
 * cdef decode_blosc_header(buffer_):             # <<<<<<<<<<<<<<
 *     """ Read and decode header from compressed Blosc buffer.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bcolz.carray_ext.decode_blosc_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":703
 *     property mode:
 *         "The mode used to create/open the `mode`."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._mode
 *         def __set__(self, value):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_4mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_4mode___get__(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_4mode___get__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 703, 0, __PYX_ERR(0, 703, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":704
 *         "The mode used to create/open the `mode`."
 *         def __get__(self):
 *             return self._mode             # <<<<<<<<<<<<<<
 *         def __set__(self, value):
 *             self._mode = value
 */
  __Pyx_TraceLine(704,0,__PYX_ERR(0, 704, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_mode);
  __pyx_r = __pyx_v_self->_mode;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":703
 *     property mode:
 *         "The mode used to create/open the `mode`."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._mode
 *         def __set__(self, value):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":705
 *         def __get__(self):
 *             return self._mode
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._mode = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6chunks_4mode_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_6chunks_4mode_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_4mode_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_6chunks_4mode_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 705, 0, __PYX_ERR(0, 705, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":706
 *             return self._mode
 *         def __set__(self, value):
 *             self._mode = value             # <<<<<<<<<<<<<<
 * 
 *     property rootdir:
 */
  __Pyx_TraceLine(706,0,__PYX_ERR(0, 706, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_mode);
  __Pyx_DECREF(__pyx_v_self->_mode);
  __pyx_v_self->_mode = __pyx_v_value;

  /* "bcolz/carray_ext.pyx":705
 *         def __get__(self):
 *             return self._mode
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._mode = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.mode.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":710
 *     property rootdir:
 *         "The on-disk directory used for persistency."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._rootdir
 *         def __set__(self, value):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_7rootdir_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_7rootdir_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_7rootdir___get__(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_7rootdir___get__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 710, 0, __PYX_ERR(0, 710, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":711
 *         "The on-disk directory used for persistency."
 *         def __get__(self):
 *             return self._rootdir             # <<<<<<<<<<<<<<
 *         def __set__(self, value):
 *             self._rootdir = value
 */
  __Pyx_TraceLine(711,0,__PYX_ERR(0, 711, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_rootdir);
  __pyx_r = __pyx_v_self->_rootdir;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":710
 *     property rootdir:
 *         "The on-disk directory used for persistency."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._rootdir
 *         def __set__(self, value):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.rootdir.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":712
 *         def __get__(self):
 *             return self._rootdir
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._rootdir = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6chunks_7rootdir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_6chunks_7rootdir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_7rootdir_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_6chunks_7rootdir_2__set__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 712, 0, __PYX_ERR(0, 712, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":713
 *             return self._rootdir
 *         def __set__(self, value):
 *             self._rootdir = value             # <<<<<<<<<<<<<<
 * 
 *     property datadir:
 */
  __Pyx_TraceLine(713,0,__PYX_ERR(0, 713, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_rootdir);
  __Pyx_DECREF(__pyx_v_self->_rootdir);
  __pyx_v_self->_rootdir = __pyx_v_value;

  /* "bcolz/carray_ext.pyx":712
 *         def __get__(self):
 *             return self._rootdir
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._rootdir = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.rootdir.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":717
 *     property datadir:
 *         """The directory for data files."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return os.path.join(self.rootdir, DATA_DIR)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_7datadir_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_7datadir_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_7datadir___get__(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_7datadir___get__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 717, 0, __PYX_ERR(0, 717, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":718
 *         """The directory for data files."""
 *         def __get__(self):
 *             return os.path.join(self.rootdir, DATA_DIR)             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, rootdir, metainfo=None, _new=False):
 */
  __Pyx_TraceLine(718,0,__PYX_ERR(0, 718, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rootdir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DATA_DIR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":717
 *     property datadir:
 *         """The directory for data files."""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return os.path.join(self.rootdir, DATA_DIR)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.datadir.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":720
 *             return os.path.join(self.rootdir, DATA_DIR)
 * 
 *     def __cinit__(self, rootdir, metainfo=None, _new=False):             # <<<<<<<<<<<<<<
 *         cdef ndarray lastchunkarr
 *         cdef void *decompressed
 */

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6chunks_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_6chunks_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_rootdir = 0;
  PyObject *__pyx_v_metainfo = 0;
  PyObject *__pyx_v__new = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rootdir,&__pyx_n_s_metainfo,&__pyx_n_s_new,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_rootdir)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_metainfo);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 720, __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_rootdir = values[0];
    __pyx_v_metainfo = values[1];
    __pyx_v__new = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 720, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks___cinit__(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self), __pyx_v_rootdir, __pyx_v_metainfo, __pyx_v__new);

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

static int __pyx_pf_5bcolz_10carray_ext_6chunks___cinit__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_rootdir, PyObject *__pyx_v_metainfo, PyObject *__pyx_v__new) {
  PyArrayObject *__pyx_v_lastchunkarr = 0;
  void *__pyx_v_compressed;
  int __pyx_v_leftover;
  char *__pyx_v_lastchunk;
  size_t __pyx_v_chunksize;
  PyObject *__pyx_v_scomp = 0;
  int __pyx_v_ret;
  CYTHON_UNUSED int __pyx_v_itemsize;
  int __pyx_v_atomsize;
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  npy_intp __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  char *__pyx_t_14;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_TraceCall("__cinit__", __pyx_f[0], 720, 0, __PYX_ERR(0, 720, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":731
 *         cdef int itemsize, atomsize
 * 
 *         self._rootdir = rootdir             # <<<<<<<<<<<<<<
 *         self.nchunks = 0
 *         self.nchunk_cached = -1  # no chunk cached initially
 */
  __Pyx_TraceLine(731,0,__PYX_ERR(0, 731, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_rootdir);
  __Pyx_GIVEREF(__pyx_v_rootdir);
  __Pyx_GOTREF(__pyx_v_self->_rootdir);
  __Pyx_DECREF(__pyx_v_self->_rootdir);
  __pyx_v_self->_rootdir = __pyx_v_rootdir;

  /* "bcolz/carray_ext.pyx":732
 * 
 *         self._rootdir = rootdir
 *         self.nchunks = 0             # <<<<<<<<<<<<<<
 *         self.nchunk_cached = -1  # no chunk cached initially
 *         self.dtype, self.cparams, self.len, lastchunkarr, self._mode = metainfo
 */
  __Pyx_TraceLine(732,0,__PYX_ERR(0, 732, __pyx_L1_error))
  __pyx_v_self->nchunks = 0;

  /* "bcolz/carray_ext.pyx":733
 *         self._rootdir = rootdir
 *         self.nchunks = 0
 *         self.nchunk_cached = -1  # no chunk cached initially             # <<<<<<<<<<<<<<
 *         self.dtype, self.cparams, self.len, lastchunkarr, self._mode = metainfo
 *         atomsize = self.dtype.itemsize
 */
  __Pyx_TraceLine(733,0,__PYX_ERR(0, 733, __pyx_L1_error))
  __pyx_v_self->nchunk_cached = -1;

  /* "bcolz/carray_ext.pyx":734
 *         self.nchunks = 0
 *         self.nchunk_cached = -1  # no chunk cached initially
 *         self.dtype, self.cparams, self.len, lastchunkarr, self._mode = metainfo             # <<<<<<<<<<<<<<
 *         atomsize = self.dtype.itemsize
 *         itemsize = self.dtype.base.itemsize
 */
  __Pyx_TraceLine(734,0,__PYX_ERR(0, 734, __pyx_L1_error))
  if ((likely(PyTuple_CheckExact(__pyx_v_metainfo))) || (PyList_CheckExact(__pyx_v_metainfo))) {
    PyObject* sequence = __pyx_v_metainfo;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 5)) {
      if (size > 5) __Pyx_RaiseTooManyValuesError(5);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 734, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 4); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
      for (i=0; i < 5; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 734, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
    __pyx_t_6 = PyObject_GetIter(__pyx_v_metainfo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    for (index=0; index < 5; index++) {
      PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 5) < 0) __PYX_ERR(0, 734, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 734, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 734, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->dtype);
  __Pyx_DECREF(__pyx_v_self->dtype);
  __pyx_v_self->dtype = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->cparams);
  __Pyx_DECREF(__pyx_v_self->cparams);
  __pyx_v_self->cparams = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_self->len = __pyx_t_8;
  __pyx_v_lastchunkarr = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->_mode);
  __Pyx_DECREF(__pyx_v_self->_mode);
  __pyx_v_self->_mode = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":735
 *         self.nchunk_cached = -1  # no chunk cached initially
 *         self.dtype, self.cparams, self.len, lastchunkarr, self._mode = metainfo
 *         atomsize = self.dtype.itemsize             # <<<<<<<<<<<<<<
 *         itemsize = self.dtype.base.itemsize
 * 
 */
  __Pyx_TraceLine(735,0,__PYX_ERR(0, 735, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_atomsize = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":736
 *         self.dtype, self.cparams, self.len, lastchunkarr, self._mode = metainfo
 *         atomsize = self.dtype.itemsize
 *         itemsize = self.dtype.base.itemsize             # <<<<<<<<<<<<<<
 * 
 *         # For 'O'bject types, the number of chunks is equal to the number of
 */
  __Pyx_TraceLine(736,0,__PYX_ERR(0, 736, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 736, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_itemsize = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":740
 *         # For 'O'bject types, the number of chunks is equal to the number of
 *         # elements
 *         if self.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *             self.nchunks = self.len
 * 
 */
  __Pyx_TraceLine(740,0,__PYX_ERR(0, 740, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_char); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_10) {

    /* "bcolz/carray_ext.pyx":741
 *         # elements
 *         if self.dtype.char == 'O':
 *             self.nchunks = self.len             # <<<<<<<<<<<<<<
 * 
 *         # Initialize last chunk (not valid for 'O'bject dtypes)
 */
    __Pyx_TraceLine(741,0,__PYX_ERR(0, 741, __pyx_L1_error))
    __pyx_t_8 = __pyx_v_self->len;
    __pyx_v_self->nchunks = __pyx_t_8;

    /* "bcolz/carray_ext.pyx":740
 *         # For 'O'bject types, the number of chunks is equal to the number of
 *         # elements
 *         if self.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *             self.nchunks = self.len
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":744
 * 
 *         # Initialize last chunk (not valid for 'O'bject dtypes)
 *         if not _new and self.dtype.char != 'O':             # <<<<<<<<<<<<<<
 *             self.nchunks = cython.cdiv(self.len, len(lastchunkarr))
 *             chunksize = len(lastchunkarr) * atomsize
 */
  __Pyx_TraceLine(744,0,__PYX_ERR(0, 744, __pyx_L1_error))
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v__new); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 744, __pyx_L1_error)
  __pyx_t_12 = ((!__pyx_t_11) != 0);
  if (__pyx_t_12) {
  } else {
    __pyx_t_10 = __pyx_t_12;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_char); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_O, Py_NE)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __pyx_t_12;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_10) {

    /* "bcolz/carray_ext.pyx":745
 *         # Initialize last chunk (not valid for 'O'bject dtypes)
 *         if not _new and self.dtype.char != 'O':
 *             self.nchunks = cython.cdiv(self.len, len(lastchunkarr))             # <<<<<<<<<<<<<<
 *             chunksize = len(lastchunkarr) * atomsize
 *             lastchunk = lastchunkarr.data
 */
    __Pyx_TraceLine(745,0,__PYX_ERR(0, 745, __pyx_L1_error))
    __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_lastchunkarr)); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 745, __pyx_L1_error)
    __pyx_v_self->nchunks = (__pyx_v_self->len / __pyx_t_13);

    /* "bcolz/carray_ext.pyx":746
 *         if not _new and self.dtype.char != 'O':
 *             self.nchunks = cython.cdiv(self.len, len(lastchunkarr))
 *             chunksize = len(lastchunkarr) * atomsize             # <<<<<<<<<<<<<<
 *             lastchunk = lastchunkarr.data
 *             leftover = (self.len % len(lastchunkarr)) * atomsize
 */
    __Pyx_TraceLine(746,0,__PYX_ERR(0, 746, __pyx_L1_error))
    __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_lastchunkarr)); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 746, __pyx_L1_error)
    __pyx_v_chunksize = (__pyx_t_13 * __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":747
 *             self.nchunks = cython.cdiv(self.len, len(lastchunkarr))
 *             chunksize = len(lastchunkarr) * atomsize
 *             lastchunk = lastchunkarr.data             # <<<<<<<<<<<<<<
 *             leftover = (self.len % len(lastchunkarr)) * atomsize
 *             if leftover:
 */
    __Pyx_TraceLine(747,0,__PYX_ERR(0, 747, __pyx_L1_error))
    __pyx_t_14 = __pyx_v_lastchunkarr->data;
    __pyx_v_lastchunk = __pyx_t_14;

    /* "bcolz/carray_ext.pyx":748
 *             chunksize = len(lastchunkarr) * atomsize
 *             lastchunk = lastchunkarr.data
 *             leftover = (self.len % len(lastchunkarr)) * atomsize             # <<<<<<<<<<<<<<
 *             if leftover:
 *                 # Fill lastchunk with data on disk
 */
    __Pyx_TraceLine(748,0,__PYX_ERR(0, 748, __pyx_L1_error))
    __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_lastchunkarr)); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 748, __pyx_L1_error)
    if (unlikely(__pyx_t_13 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 748, __pyx_L1_error)
    }
    __pyx_v_leftover = (__Pyx_mod_Py_ssize_t(__pyx_v_self->len, __pyx_t_13) * __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":749
 *             lastchunk = lastchunkarr.data
 *             leftover = (self.len % len(lastchunkarr)) * atomsize
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 # Fill lastchunk with data on disk
 *                 scomp = self.read_chunk(self.nchunks)
 */
    __Pyx_TraceLine(749,0,__PYX_ERR(0, 749, __pyx_L1_error))
    __pyx_t_10 = (__pyx_v_leftover != 0);
    if (__pyx_t_10) {

      /* "bcolz/carray_ext.pyx":751
 *             if leftover:
 *                 # Fill lastchunk with data on disk
 *                 scomp = self.read_chunk(self.nchunks)             # <<<<<<<<<<<<<<
 *                 compressed = PyBytes_AS_STRING(scomp)
 *                 ret = blosc_decompress(compressed, lastchunk, chunksize)
 */
      __Pyx_TraceLine(751,0,__PYX_ERR(0, 751, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->nchunks); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks *)__pyx_v_self->__pyx_vtab)->read_chunk(__pyx_v_self, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_scomp = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":752
 *                 # Fill lastchunk with data on disk
 *                 scomp = self.read_chunk(self.nchunks)
 *                 compressed = PyBytes_AS_STRING(scomp)             # <<<<<<<<<<<<<<
 *                 ret = blosc_decompress(compressed, lastchunk, chunksize)
 *                 if ret < 0:
 */
      __Pyx_TraceLine(752,0,__PYX_ERR(0, 752, __pyx_L1_error))
      __pyx_v_compressed = PyBytes_AS_STRING(__pyx_v_scomp);

      /* "bcolz/carray_ext.pyx":753
 *                 scomp = self.read_chunk(self.nchunks)
 *                 compressed = PyBytes_AS_STRING(scomp)
 *                 ret = blosc_decompress(compressed, lastchunk, chunksize)             # <<<<<<<<<<<<<<
 *                 if ret < 0:
 *                     raise RuntimeError(
 */
      __Pyx_TraceLine(753,0,__PYX_ERR(0, 753, __pyx_L1_error))
      __pyx_v_ret = blosc_decompress(__pyx_v_compressed, __pyx_v_lastchunk, __pyx_v_chunksize);

      /* "bcolz/carray_ext.pyx":754
 *                 compressed = PyBytes_AS_STRING(scomp)
 *                 ret = blosc_decompress(compressed, lastchunk, chunksize)
 *                 if ret < 0:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         "error decompressing the last chunk (error code: "
 */
      __Pyx_TraceLine(754,0,__PYX_ERR(0, 754, __pyx_L1_error))
      __pyx_t_10 = ((__pyx_v_ret < 0) != 0);
      if (__pyx_t_10) {

        /* "bcolz/carray_ext.pyx":757
 *                     raise RuntimeError(
 *                         "error decompressing the last chunk (error code: "
 *                         "%d)" % ret)             # <<<<<<<<<<<<<<
 * 
 *     cdef _chunk_file_name(self, nchunk):
 */
        __Pyx_TraceLine(757,0,__PYX_ERR(0, 757, __pyx_L1_error))
        __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 757, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_error_decompressing_the_last_chu, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "bcolz/carray_ext.pyx":755
 *                 ret = blosc_decompress(compressed, lastchunk, chunksize)
 *                 if ret < 0:
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         "error decompressing the last chunk (error code: "
 *                         "%d)" % ret)
 */
        __Pyx_TraceLine(755,0,__PYX_ERR(0, 755, __pyx_L1_error))
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 755, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(0, 755, __pyx_L1_error)

        /* "bcolz/carray_ext.pyx":754
 *                 compressed = PyBytes_AS_STRING(scomp)
 *                 ret = blosc_decompress(compressed, lastchunk, chunksize)
 *                 if ret < 0:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         "error decompressing the last chunk (error code: "
 */
      }

      /* "bcolz/carray_ext.pyx":749
 *             lastchunk = lastchunkarr.data
 *             leftover = (self.len % len(lastchunkarr)) * atomsize
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 # Fill lastchunk with data on disk
 *                 scomp = self.read_chunk(self.nchunks)
 */
    }

    /* "bcolz/carray_ext.pyx":744
 * 
 *         # Initialize last chunk (not valid for 'O'bject dtypes)
 *         if not _new and self.dtype.char != 'O':             # <<<<<<<<<<<<<<
 *             self.nchunks = cython.cdiv(self.len, len(lastchunkarr))
 *             chunksize = len(lastchunkarr) * atomsize
 */
  }

  /* "bcolz/carray_ext.pyx":720
 *             return os.path.join(self.rootdir, DATA_DIR)
 * 
 *     def __cinit__(self, rootdir, metainfo=None, _new=False):             # <<<<<<<<<<<<<<
 *         cdef ndarray lastchunkarr
 *         cdef void *decompressed
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lastchunkarr);
  __Pyx_XDECREF(__pyx_v_scomp);
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":759
 *                         "%d)" % ret)
 * 
 *     cdef _chunk_file_name(self, nchunk):             # <<<<<<<<<<<<<<
 *         """ Determine the name of a chunk file. """
 *         return os.path.join(self.datadir, "__%d%s" % (nchunk, EXTENSION))
 */

static PyObject *__pyx_f_5bcolz_10carray_ext_6chunks__chunk_file_name(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_nchunk) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("_chunk_file_name", 0);
  __Pyx_TraceCall("_chunk_file_name", __pyx_f[0], 759, 0, __PYX_ERR(0, 759, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":761
 *     cdef _chunk_file_name(self, nchunk):
 *         """ Determine the name of a chunk file. """
 *         return os.path.join(self.datadir, "__%d%s" % (nchunk, EXTENSION))             # <<<<<<<<<<<<<<
 * 
 *     cdef read_chunk(self, nchunk):
 */
  __Pyx_TraceLine(761,0,__PYX_ERR(0, 761, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_datadir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EXTENSION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_nchunk);
  __Pyx_GIVEREF(__pyx_v_nchunk);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_nchunk);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_d_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":759
 *                         "%d)" % ret)
 * 
 *     cdef _chunk_file_name(self, nchunk):             # <<<<<<<<<<<<<<
 *         """ Determine the name of a chunk file. """
 *         return os.path.join(self.datadir, "__%d%s" % (nchunk, EXTENSION))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bcolz.carray_ext.chunks._chunk_file_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":763
 *         return os.path.join(self.datadir, "__%d%s" % (nchunk, EXTENSION))
 * 
 *     cdef read_chunk(self, nchunk):             # <<<<<<<<<<<<<<
 *         """Read a chunk and return it in compressed form."""
 *         schunkfile = self._chunk_file_name(nchunk)
 */

static PyObject *__pyx_f_5bcolz_10carray_ext_6chunks_read_chunk(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_nchunk) {
  PyObject *__pyx_v_schunkfile = NULL;
  PyObject *__pyx_v_schunk = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_bloscpack_header = NULL;
  PyObject *__pyx_v_blosc_header_raw = NULL;
  PyObject *__pyx_v_blosc_header = NULL;
  PyObject *__pyx_v_ctbytes = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_nbytes = NULL;
  PyObject *__pyx_v_scomp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("read_chunk", 0);
  __Pyx_TraceCall("read_chunk", __pyx_f[0], 763, 0, __PYX_ERR(0, 763, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":765
 *     cdef read_chunk(self, nchunk):
 *         """Read a chunk and return it in compressed form."""
 *         schunkfile = self._chunk_file_name(nchunk)             # <<<<<<<<<<<<<<
 *         if not os.path.exists(schunkfile):
 *             raise ValueError("chunkfile %s not found" % schunkfile)
 */
  __Pyx_TraceLine(765,0,__PYX_ERR(0, 765, __pyx_L1_error))
  __pyx_t_1 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks *)__pyx_v_self->__pyx_vtab)->_chunk_file_name(__pyx_v_self, __pyx_v_nchunk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_schunkfile = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":766
 *         """Read a chunk and return it in compressed form."""
 *         schunkfile = self._chunk_file_name(nchunk)
 *         if not os.path.exists(schunkfile):             # <<<<<<<<<<<<<<
 *             raise ValueError("chunkfile %s not found" % schunkfile)
 *         with open(schunkfile, 'rb') as schunk:
 */
  __Pyx_TraceLine(766,0,__PYX_ERR(0, 766, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_schunkfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_schunkfile);
    __Pyx_GIVEREF(__pyx_v_schunkfile);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_schunkfile);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = ((!__pyx_t_5) != 0);
  if (__pyx_t_6) {

    /* "bcolz/carray_ext.pyx":767
 *         schunkfile = self._chunk_file_name(nchunk)
 *         if not os.path.exists(schunkfile):
 *             raise ValueError("chunkfile %s not found" % schunkfile)             # <<<<<<<<<<<<<<
 *         with open(schunkfile, 'rb') as schunk:
 *             bloscpack_header = schunk.read(BLOSCPACK_HEADER_LENGTH)
 */
    __Pyx_TraceLine(767,0,__PYX_ERR(0, 767, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_chunkfile_s_not_found, __pyx_v_schunkfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__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_ERR(0, 767, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":766
 *         """Read a chunk and return it in compressed form."""
 *         schunkfile = self._chunk_file_name(nchunk)
 *         if not os.path.exists(schunkfile):             # <<<<<<<<<<<<<<
 *             raise ValueError("chunkfile %s not found" % schunkfile)
 *         with open(schunkfile, 'rb') as schunk:
 */
  }

  /* "bcolz/carray_ext.pyx":768
 *         if not os.path.exists(schunkfile):
 *             raise ValueError("chunkfile %s not found" % schunkfile)
 *         with open(schunkfile, 'rb') as schunk:             # <<<<<<<<<<<<<<
 *             bloscpack_header = schunk.read(BLOSCPACK_HEADER_LENGTH)
 *             blosc_header_raw = schunk.read(BLOSC_HEADER_LENGTH)
 */
  __Pyx_TraceLine(768,0,__PYX_ERR(0, 768, __pyx_L1_error))
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_schunkfile);
    __Pyx_GIVEREF(__pyx_v_schunkfile);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_schunkfile);
    __Pyx_INCREF(__pyx_n_s_rb);
    __Pyx_GIVEREF(__pyx_n_s_rb);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_rb);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L4_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {
          __pyx_v_schunk = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":769
 *             raise ValueError("chunkfile %s not found" % schunkfile)
 *         with open(schunkfile, 'rb') as schunk:
 *             bloscpack_header = schunk.read(BLOSCPACK_HEADER_LENGTH)             # <<<<<<<<<<<<<<
 *             blosc_header_raw = schunk.read(BLOSC_HEADER_LENGTH)
 *             blosc_header = decode_blosc_header(blosc_header_raw)
 */
          __Pyx_TraceLine(769,0,__PYX_ERR(0, 769, __pyx_L8_error))
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_BLOSCPACK_HEADER_LENGTH); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          if (!__pyx_t_3) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L8_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 769, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
            __pyx_t_1 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_bloscpack_header = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":770
 *         with open(schunkfile, 'rb') as schunk:
 *             bloscpack_header = schunk.read(BLOSCPACK_HEADER_LENGTH)
 *             blosc_header_raw = schunk.read(BLOSC_HEADER_LENGTH)             # <<<<<<<<<<<<<<
 *             blosc_header = decode_blosc_header(blosc_header_raw)
 *             ctbytes = blosc_header['ctbytes']
 */
          __Pyx_TraceLine(770,0,__PYX_ERR(0, 770, __pyx_L8_error))
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_BLOSC_HEADER_LENGTH); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 770, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_1 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          if (!__pyx_t_1) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __pyx_L8_error)
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_GIVEREF(__pyx_t_11);
            PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_11);
            __pyx_t_11 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_blosc_header_raw = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":771
 *             bloscpack_header = schunk.read(BLOSCPACK_HEADER_LENGTH)
 *             blosc_header_raw = schunk.read(BLOSC_HEADER_LENGTH)
 *             blosc_header = decode_blosc_header(blosc_header_raw)             # <<<<<<<<<<<<<<
 *             ctbytes = blosc_header['ctbytes']
 *             nbytes = blosc_header['nbytes']
 */
          __Pyx_TraceLine(771,0,__PYX_ERR(0, 771, __pyx_L8_error))
          __pyx_t_4 = __pyx_f_5bcolz_10carray_ext_decode_blosc_header(__pyx_v_blosc_header_raw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_v_blosc_header = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":772
 *             blosc_header_raw = schunk.read(BLOSC_HEADER_LENGTH)
 *             blosc_header = decode_blosc_header(blosc_header_raw)
 *             ctbytes = blosc_header['ctbytes']             # <<<<<<<<<<<<<<
 *             nbytes = blosc_header['nbytes']
 *             # seek back BLOSC_HEADER_LENGTH bytes in file relative to current
 */
          __Pyx_TraceLine(772,0,__PYX_ERR(0, 772, __pyx_L8_error))
          __pyx_t_4 = PyObject_GetItem(__pyx_v_blosc_header, __pyx_n_s_ctbytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_v_ctbytes = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":773
 *             blosc_header = decode_blosc_header(blosc_header_raw)
 *             ctbytes = blosc_header['ctbytes']
 *             nbytes = blosc_header['nbytes']             # <<<<<<<<<<<<<<
 *             # seek back BLOSC_HEADER_LENGTH bytes in file relative to current
 *             # position
 */
          __Pyx_TraceLine(773,0,__PYX_ERR(0, 773, __pyx_L8_error))
          __pyx_t_4 = PyObject_GetItem(__pyx_v_blosc_header, __pyx_n_s_nbytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_v_nbytes = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":776
 *             # seek back BLOSC_HEADER_LENGTH bytes in file relative to current
 *             # position
 *             schunk.seek(-BLOSC_HEADER_LENGTH, 1)             # <<<<<<<<<<<<<<
 *             scomp = schunk.read(ctbytes)
 *         return scomp
 */
          __Pyx_TraceLine(776,0,__PYX_ERR(0, 776, __pyx_L8_error))
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_BLOSC_HEADER_LENGTH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_11 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 776, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          __pyx_t_12 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
              __pyx_t_12 = 1;
            }
          }
          __pyx_t_1 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (__pyx_t_3) {
            __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
          }
          __Pyx_GIVEREF(__pyx_t_11);
          PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_12, __pyx_t_11);
          __Pyx_INCREF(__pyx_int_1);
          __Pyx_GIVEREF(__pyx_int_1);
          PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_12, __pyx_int_1);
          __pyx_t_11 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 776, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":777
 *             # position
 *             schunk.seek(-BLOSC_HEADER_LENGTH, 1)
 *             scomp = schunk.read(ctbytes)             # <<<<<<<<<<<<<<
 *         return scomp
 * 
 */
          __Pyx_TraceLine(777,0,__PYX_ERR(0, 777, __pyx_L8_error))
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          if (!__pyx_t_1) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_ctbytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 777, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 777, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_INCREF(__pyx_v_ctbytes);
            __Pyx_GIVEREF(__pyx_v_ctbytes);
            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_ctbytes);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 777, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_v_scomp = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":768
 *         if not os.path.exists(schunkfile):
 *             raise ValueError("chunkfile %s not found" % schunkfile)
 *         with open(schunkfile, 'rb') as schunk:             # <<<<<<<<<<<<<<
 *             bloscpack_header = schunk.read(BLOSCPACK_HEADER_LENGTH)
 *             blosc_header_raw = schunk.read(BLOSC_HEADER_LENGTH)
 */
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("bcolz.carray_ext.chunks.read_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_11) < 0) __PYX_ERR(0, 768, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 768, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (__pyx_t_6 < 0) __PYX_ERR(0, 768, __pyx_L10_except_error)
          __pyx_t_5 = ((!(__pyx_t_6 != 0)) != 0);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_2, __pyx_t_11);
            __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_11 = 0; 
            __PYX_ERR(0, 768, __pyx_L10_except_error)
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L9_exception_handled;
        }
        __pyx_L10_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L9_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L15_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__24, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 768, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L7;
      }
      __pyx_L7:;
    }
    goto __pyx_L19;
    __pyx_L4_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L19:;
  }

  /* "bcolz/carray_ext.pyx":778
 *             schunk.seek(-BLOSC_HEADER_LENGTH, 1)
 *             scomp = schunk.read(ctbytes)
 *         return scomp             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_TraceLine(778,0,__PYX_ERR(0, 778, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_scomp)) { __Pyx_RaiseUnboundLocalError("scomp"); __PYX_ERR(0, 778, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_v_scomp);
  __pyx_r = __pyx_v_scomp;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":763
 *         return os.path.join(self.datadir, "__%d%s" % (nchunk, EXTENSION))
 * 
 *     cdef read_chunk(self, nchunk):             # <<<<<<<<<<<<<<
 *         """Read a chunk and return it in compressed form."""
 *         schunkfile = self._chunk_file_name(nchunk)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.read_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_schunkfile);
  __Pyx_XDECREF(__pyx_v_schunk);
  __Pyx_XDECREF(__pyx_v_bloscpack_header);
  __Pyx_XDECREF(__pyx_v_blosc_header_raw);
  __Pyx_XDECREF(__pyx_v_blosc_header);
  __Pyx_XDECREF(__pyx_v_ctbytes);
  __Pyx_XDECREF(__pyx_v_nbytes);
  __Pyx_XDECREF(__pyx_v_scomp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":780
 *         return scomp
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *        self._iter_count = 0
 *        return self
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_2__iter__(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_2__iter__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __Pyx_TraceCall("__iter__", __pyx_f[0], 780, 0, __PYX_ERR(0, 780, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":781
 * 
 *     def __iter__(self):
 *        self._iter_count = 0             # <<<<<<<<<<<<<<
 *        return self
 * 
 */
  __Pyx_TraceLine(781,0,__PYX_ERR(0, 781, __pyx_L1_error))
  __pyx_v_self->_iter_count = 0;

  /* "bcolz/carray_ext.pyx":782
 *     def __iter__(self):
 *        self._iter_count = 0
 *        return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_TraceLine(782,0,__PYX_ERR(0, 782, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":780
 *         return scomp
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *        self._iter_count = 0
 *        return self
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":784
 *        return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         if self._iter_count < self.nchunks:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_5__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_5__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_4__next__(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_4__next__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self) {
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__next__", 0);
  __Pyx_TraceCall("__next__", __pyx_f[0], 784, 0, __PYX_ERR(0, 784, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":786
 *     def __next__(self):
 *         cdef int i
 *         if self._iter_count < self.nchunks:             # <<<<<<<<<<<<<<
 *             i = self._iter_count
 *             self._iter_count += 1
 */
  __Pyx_TraceLine(786,0,__PYX_ERR(0, 786, __pyx_L1_error))
  __pyx_t_1 = ((__pyx_v_self->_iter_count < __pyx_v_self->nchunks) != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":787
 *         cdef int i
 *         if self._iter_count < self.nchunks:
 *             i = self._iter_count             # <<<<<<<<<<<<<<
 *             self._iter_count += 1
 *             return self.__getitem__(i)
 */
    __Pyx_TraceLine(787,0,__PYX_ERR(0, 787, __pyx_L1_error))
    __pyx_t_2 = __pyx_v_self->_iter_count;
    __pyx_v_i = __pyx_t_2;

    /* "bcolz/carray_ext.pyx":788
 *         if self._iter_count < self.nchunks:
 *             i = self._iter_count
 *             self._iter_count += 1             # <<<<<<<<<<<<<<
 *             return self.__getitem__(i)
 *         else:
 */
    __Pyx_TraceLine(788,0,__PYX_ERR(0, 788, __pyx_L1_error))
    __pyx_v_self->_iter_count = (__pyx_v_self->_iter_count + 1);

    /* "bcolz/carray_ext.pyx":789
 *             i = self._iter_count
 *             self._iter_count += 1
 *             return self.__getitem__(i)             # <<<<<<<<<<<<<<
 *         else:
 *             raise StopIteration()
 */
    __Pyx_TraceLine(789,0,__PYX_ERR(0, 789, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":786
 *     def __next__(self):
 *         cdef int i
 *         if self._iter_count < self.nchunks:             # <<<<<<<<<<<<<<
 *             i = self._iter_count
 *             self._iter_count += 1
 */
  }

  /* "bcolz/carray_ext.pyx":791
 *             return self.__getitem__(i)
 *         else:
 *             raise StopIteration()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, nchunk):
 */
  __Pyx_TraceLine(791,0,__PYX_ERR(0, 791, __pyx_L1_error))
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 791, __pyx_L1_error)
  }

  /* "bcolz/carray_ext.pyx":784
 *        return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef int i
 *         if self._iter_count < self.nchunks:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":793
 *             raise StopIteration()
 * 
 *     def __getitem__(self, nchunk):             # <<<<<<<<<<<<<<
 *         cdef void *decompressed
 *         cdef void *compressed
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_nchunk); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_nchunk) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_6__getitem__(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self), ((PyObject *)__pyx_v_nchunk));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_6__getitem__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_nchunk) {
  PyObject *__pyx_v_scomp = NULL;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  npy_intp __pyx_t_5;
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_TraceCall("__getitem__", __pyx_f[0], 793, 0, __PYX_ERR(0, 793, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":797
 *         cdef void *compressed
 * 
 *         if nchunk == self.nchunk_cached:             # <<<<<<<<<<<<<<
 *             # Hit!
 *             return self.chunk_cached
 */
  __Pyx_TraceLine(797,0,__PYX_ERR(0, 797, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->nchunk_cached); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_nchunk, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 797, __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_ERR(0, 797, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":799
 *         if nchunk == self.nchunk_cached:
 *             # Hit!
 *             return self.chunk_cached             # <<<<<<<<<<<<<<
 *         else:
 *             scomp = self.read_chunk(nchunk)
 */
    __Pyx_TraceLine(799,0,__PYX_ERR(0, 799, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self->chunk_cached);
    __pyx_r = __pyx_v_self->chunk_cached;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":797
 *         cdef void *compressed
 * 
 *         if nchunk == self.nchunk_cached:             # <<<<<<<<<<<<<<
 *             # Hit!
 *             return self.chunk_cached
 */
  }

  /* "bcolz/carray_ext.pyx":801
 *             return self.chunk_cached
 *         else:
 *             scomp = self.read_chunk(nchunk)             # <<<<<<<<<<<<<<
 *             # Data chunk should be compressed already
 *             chunk_ = chunk(scomp, self.dtype, self.cparams,
 */
  __Pyx_TraceLine(801,0,__PYX_ERR(0, 801, __pyx_L1_error))
  /*else*/ {
    __pyx_t_2 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks *)__pyx_v_self->__pyx_vtab)->read_chunk(__pyx_v_self, __pyx_v_nchunk); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 801, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_scomp = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":803
 *             scomp = self.read_chunk(nchunk)
 *             # Data chunk should be compressed already
 *             chunk_ = chunk(scomp, self.dtype, self.cparams,             # <<<<<<<<<<<<<<
 *                            _memory=False, _compr=True)
 *             # Fill cache
 */
    __Pyx_TraceLine(803,0,__PYX_ERR(0, 803, __pyx_L1_error))
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_scomp);
    __Pyx_GIVEREF(__pyx_v_scomp);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_scomp);
    __Pyx_INCREF(__pyx_v_self->dtype);
    __Pyx_GIVEREF(__pyx_v_self->dtype);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->dtype);
    __Pyx_INCREF(__pyx_v_self->cparams);
    __Pyx_GIVEREF(__pyx_v_self->cparams);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_self->cparams);

    /* "bcolz/carray_ext.pyx":804
 *             # Data chunk should be compressed already
 *             chunk_ = chunk(scomp, self.dtype, self.cparams,
 *                            _memory=False, _compr=True)             # <<<<<<<<<<<<<<
 *             # Fill cache
 *             self.nchunk_cached = nchunk
 */
    __Pyx_TraceLine(804,0,__PYX_ERR(0, 804, __pyx_L1_error))
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_memory, Py_False) < 0) __PYX_ERR(0, 804, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_compr, Py_True) < 0) __PYX_ERR(0, 804, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":803
 *             scomp = self.read_chunk(nchunk)
 *             # Data chunk should be compressed already
 *             chunk_ = chunk(scomp, self.dtype, self.cparams,             # <<<<<<<<<<<<<<
 *                            _memory=False, _compr=True)
 *             # Fill cache
 */
    __Pyx_TraceLine(803,0,__PYX_ERR(0, 803, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_chunk_ = ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":806
 *                            _memory=False, _compr=True)
 *             # Fill cache
 *             self.nchunk_cached = nchunk             # <<<<<<<<<<<<<<
 *             self.chunk_cached = chunk_
 *         return chunk_
 */
    __Pyx_TraceLine(806,0,__PYX_ERR(0, 806, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_nchunk); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 806, __pyx_L1_error)
    __pyx_v_self->nchunk_cached = __pyx_t_5;

    /* "bcolz/carray_ext.pyx":807
 *             # Fill cache
 *             self.nchunk_cached = nchunk
 *             self.chunk_cached = chunk_             # <<<<<<<<<<<<<<
 *         return chunk_
 * 
 */
    __Pyx_TraceLine(807,0,__PYX_ERR(0, 807, __pyx_L1_error))
    __Pyx_INCREF(((PyObject *)__pyx_v_chunk_));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_chunk_));
    __Pyx_GOTREF(__pyx_v_self->chunk_cached);
    __Pyx_DECREF(__pyx_v_self->chunk_cached);
    __pyx_v_self->chunk_cached = ((PyObject *)__pyx_v_chunk_);
  }

  /* "bcolz/carray_ext.pyx":808
 *             self.nchunk_cached = nchunk
 *             self.chunk_cached = chunk_
 *         return chunk_             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, nchunk, chunk_):
 */
  __Pyx_TraceLine(808,0,__PYX_ERR(0, 808, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_chunk_));
  __pyx_r = ((PyObject *)__pyx_v_chunk_);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":793
 *             raise StopIteration()
 * 
 *     def __getitem__(self, nchunk):             # <<<<<<<<<<<<<<
 *         cdef void *decompressed
 *         cdef void *compressed
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_scomp);
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":810
 *         return chunk_
 * 
 *     def __setitem__(self, nchunk, chunk_):             # <<<<<<<<<<<<<<
 *         self._save(nchunk, chunk_)
 * 
 */

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6chunks_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_nchunk, PyObject *__pyx_v_chunk_); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_6chunks_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_nchunk, PyObject *__pyx_v_chunk_) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_8__setitem__(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self), ((PyObject *)__pyx_v_nchunk), ((PyObject *)__pyx_v_chunk_));

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

static int __pyx_pf_5bcolz_10carray_ext_6chunks_8__setitem__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_nchunk, PyObject *__pyx_v_chunk_) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_TraceCall("__setitem__", __pyx_f[0], 810, 0, __PYX_ERR(0, 810, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":811
 * 
 *     def __setitem__(self, nchunk, chunk_):
 *         self._save(nchunk, chunk_)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_TraceLine(811,0,__PYX_ERR(0, 811, __pyx_L1_error))
  __pyx_t_1 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks *)__pyx_v_self->__pyx_vtab)->_save(__pyx_v_self, __pyx_v_nchunk, __pyx_v_chunk_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":810
 *         return chunk_
 * 
 *     def __setitem__(self, nchunk, chunk_):             # <<<<<<<<<<<<<<
 *         self._save(nchunk, chunk_)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":813
 *         self._save(nchunk, chunk_)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.nchunks
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_5bcolz_10carray_ext_6chunks_11__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_5bcolz_10carray_ext_6chunks_11__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_10__len__(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_5bcolz_10carray_ext_6chunks_10__len__(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);
  __Pyx_TraceCall("__len__", __pyx_f[0], 813, 0, __PYX_ERR(0, 813, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":814
 * 
 *     def __len__(self):
 *         return self.nchunks             # <<<<<<<<<<<<<<
 * 
 *     def free_cachemem(self):
 */
  __Pyx_TraceLine(814,0,__PYX_ERR(0, 814, __pyx_L1_error))
  __pyx_r = __pyx_v_self->nchunks;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":813
 *         self._save(nchunk, chunk_)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.nchunks
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":816
 *         return self.nchunks
 * 
 *     def free_cachemem(self):             # <<<<<<<<<<<<<<
 *         self.nchunk_cached = -1
 *         self.chunk_cached = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_13free_cachemem(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6chunks_12free_cachemem[] = "chunks.free_cachemem(self)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_13free_cachemem(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_cachemem (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_12free_cachemem(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_12free_cachemem(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_cachemem", 0);
  __Pyx_TraceCall("free_cachemem", __pyx_f[0], 816, 0, __PYX_ERR(0, 816, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":817
 * 
 *     def free_cachemem(self):
 *         self.nchunk_cached = -1             # <<<<<<<<<<<<<<
 *         self.chunk_cached = None
 * 
 */
  __Pyx_TraceLine(817,0,__PYX_ERR(0, 817, __pyx_L1_error))
  __pyx_v_self->nchunk_cached = -1;

  /* "bcolz/carray_ext.pyx":818
 *     def free_cachemem(self):
 *         self.nchunk_cached = -1
 *         self.chunk_cached = None             # <<<<<<<<<<<<<<
 * 
 *     def append(self, chunk_):
 */
  __Pyx_TraceLine(818,0,__PYX_ERR(0, 818, __pyx_L1_error))
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->chunk_cached);
  __Pyx_DECREF(__pyx_v_self->chunk_cached);
  __pyx_v_self->chunk_cached = Py_None;

  /* "bcolz/carray_ext.pyx":816
 *         return self.nchunks
 * 
 *     def free_cachemem(self):             # <<<<<<<<<<<<<<
 *         self.nchunk_cached = -1
 *         self.chunk_cached = None
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.free_cachemem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":820
 *         self.chunk_cached = None
 * 
 *     def append(self, chunk_):             # <<<<<<<<<<<<<<
 *         """Append an new chunk to the carray."""
 *         self._save(self.nchunks, chunk_)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_15append(PyObject *__pyx_v_self, PyObject *__pyx_v_chunk_); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6chunks_14append[] = "chunks.append(self, chunk_)\nAppend an new chunk to the carray.";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_15append(PyObject *__pyx_v_self, PyObject *__pyx_v_chunk_) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_14append(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self), ((PyObject *)__pyx_v_chunk_));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_14append(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_chunk_) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("append", 0);
  __Pyx_TraceCall("append", __pyx_f[0], 820, 0, __PYX_ERR(0, 820, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":822
 *     def append(self, chunk_):
 *         """Append an new chunk to the carray."""
 *         self._save(self.nchunks, chunk_)             # <<<<<<<<<<<<<<
 *         self.nchunks += 1
 * 
 */
  __Pyx_TraceLine(822,0,__PYX_ERR(0, 822, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->nchunks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks *)__pyx_v_self->__pyx_vtab)->_save(__pyx_v_self, __pyx_t_1, __pyx_v_chunk_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __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;

  /* "bcolz/carray_ext.pyx":823
 *         """Append an new chunk to the carray."""
 *         self._save(self.nchunks, chunk_)
 *         self.nchunks += 1             # <<<<<<<<<<<<<<
 * 
 *     cdef _save(self, nchunk, chunk_):
 */
  __Pyx_TraceLine(823,0,__PYX_ERR(0, 823, __pyx_L1_error))
  __pyx_v_self->nchunks = (__pyx_v_self->nchunks + 1);

  /* "bcolz/carray_ext.pyx":820
 *         self.chunk_cached = None
 * 
 *     def append(self, chunk_):             # <<<<<<<<<<<<<<
 *         """Append an new chunk to the carray."""
 *         self._save(self.nchunks, chunk_)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":825
 *         self.nchunks += 1
 * 
 *     cdef _save(self, nchunk, chunk_):             # <<<<<<<<<<<<<<
 *         """Save the `chunk_` as chunk #`nchunk`. """
 * 
 */

static PyObject *__pyx_f_5bcolz_10carray_ext_6chunks__save(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_nchunk, PyObject *__pyx_v_chunk_) {
  PyObject *__pyx_v_schunkfile = NULL;
  PyObject *__pyx_v_bloscpack_header = NULL;
  PyObject *__pyx_v_schunk = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  struct __pyx_opt_args_5bcolz_10carray_ext_create_bloscpack_header __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("_save", 0);
  __Pyx_TraceCall("_save", __pyx_f[0], 825, 0, __PYX_ERR(0, 825, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":828
 *         """Save the `chunk_` as chunk #`nchunk`. """
 * 
 *         if self.mode == "r":             # <<<<<<<<<<<<<<
 *             raise IOError(
 *                 "cannot modify data because mode is '%s'" % self.mode)
 */
  __Pyx_TraceLine(828,0,__PYX_ERR(0, 828, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":830
 *         if self.mode == "r":
 *             raise IOError(
 *                 "cannot modify data because mode is '%s'" % self.mode)             # <<<<<<<<<<<<<<
 * 
 *         schunkfile = self._chunk_file_name(nchunk)
 */
    __Pyx_TraceLine(830,0,__PYX_ERR(0, 830, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_cannot_modify_data_because_mode, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":829
 * 
 *         if self.mode == "r":
 *             raise IOError(             # <<<<<<<<<<<<<<
 *                 "cannot modify data because mode is '%s'" % self.mode)
 * 
 */
    __Pyx_TraceLine(829,0,__PYX_ERR(0, 829, __pyx_L1_error))
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 829, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":828
 *         """Save the `chunk_` as chunk #`nchunk`. """
 * 
 *         if self.mode == "r":             # <<<<<<<<<<<<<<
 *             raise IOError(
 *                 "cannot modify data because mode is '%s'" % self.mode)
 */
  }

  /* "bcolz/carray_ext.pyx":832
 *                 "cannot modify data because mode is '%s'" % self.mode)
 * 
 *         schunkfile = self._chunk_file_name(nchunk)             # <<<<<<<<<<<<<<
 *         bloscpack_header = create_bloscpack_header(1)
 *         with open(schunkfile, 'wb') as schunk:
 */
  __Pyx_TraceLine(832,0,__PYX_ERR(0, 832, __pyx_L1_error))
  __pyx_t_3 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks *)__pyx_v_self->__pyx_vtab)->_chunk_file_name(__pyx_v_self, __pyx_v_nchunk); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_schunkfile = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":833
 * 
 *         schunkfile = self._chunk_file_name(nchunk)
 *         bloscpack_header = create_bloscpack_header(1)             # <<<<<<<<<<<<<<
 *         with open(schunkfile, 'wb') as schunk:
 *             schunk.write(bloscpack_header)
 */
  __Pyx_TraceLine(833,0,__PYX_ERR(0, 833, __pyx_L1_error))
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.nchunks = __pyx_int_1;
  __pyx_t_3 = __pyx_f_5bcolz_10carray_ext_create_bloscpack_header(&__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_bloscpack_header = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":834
 *         schunkfile = self._chunk_file_name(nchunk)
 *         bloscpack_header = create_bloscpack_header(1)
 *         with open(schunkfile, 'wb') as schunk:             # <<<<<<<<<<<<<<
 *             schunk.write(bloscpack_header)
 *             schunk.write(chunk_.getdata())
 */
  __Pyx_TraceLine(834,0,__PYX_ERR(0, 834, __pyx_L1_error))
  /*with:*/ {
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_schunkfile);
    __Pyx_GIVEREF(__pyx_v_schunkfile);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_schunkfile);
    __Pyx_INCREF(__pyx_n_s_wb);
    __Pyx_GIVEREF(__pyx_n_s_wb);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_wb);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 834, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L4_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {
          __pyx_v_schunk = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "bcolz/carray_ext.pyx":835
 *         bloscpack_header = create_bloscpack_header(1)
 *         with open(schunkfile, 'wb') as schunk:
 *             schunk.write(bloscpack_header)             # <<<<<<<<<<<<<<
 *             schunk.write(chunk_.getdata())
 *         # Mark the cache as dirty if needed
 */
          __Pyx_TraceLine(835,0,__PYX_ERR(0, 835, __pyx_L8_error))
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          if (!__pyx_t_3) {
            __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_bloscpack_header); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 835, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_6);
          } else {
            __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 835, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
            __Pyx_INCREF(__pyx_v_bloscpack_header);
            __Pyx_GIVEREF(__pyx_v_bloscpack_header);
            PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_bloscpack_header);
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 835, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "bcolz/carray_ext.pyx":836
 *         with open(schunkfile, 'wb') as schunk:
 *             schunk.write(bloscpack_header)
 *             schunk.write(chunk_.getdata())             # <<<<<<<<<<<<<<
 *         # Mark the cache as dirty if needed
 *         if nchunk == self.nchunk_cached:
 */
          __Pyx_TraceLine(836,0,__PYX_ERR(0, 836, __pyx_L8_error))
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_chunk_, __pyx_n_s_getdata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_11 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          if (__pyx_t_11) {
            __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 836, __pyx_L8_error)
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          } else {
            __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 836, __pyx_L8_error)
          }
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          if (!__pyx_t_3) {
            __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 836, __pyx_L8_error)
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else {
            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 836, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 836, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "bcolz/carray_ext.pyx":834
 *         schunkfile = self._chunk_file_name(nchunk)
 *         bloscpack_header = create_bloscpack_header(1)
 *         with open(schunkfile, 'wb') as schunk:             # <<<<<<<<<<<<<<
 *             schunk.write(bloscpack_header)
 *             schunk.write(chunk_.getdata())
 */
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("bcolz.carray_ext.chunks._save", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_11) < 0) __PYX_ERR(0, 834, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_7 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 834, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 834, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_2 < 0) __PYX_ERR(0, 834, __pyx_L10_except_error)
          __pyx_t_13 = ((!(__pyx_t_2 != 0)) != 0);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_1, __pyx_t_11);
            __pyx_t_6 = 0; __pyx_t_1 = 0; __pyx_t_11 = 0; 
            __PYX_ERR(0, 834, __pyx_L10_except_error)
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L9_exception_handled;
        }
        __pyx_L10_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L9_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L15_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_5) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__25, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 834, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L7;
      }
      __pyx_L7:;
    }
    goto __pyx_L19;
    __pyx_L4_error:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L1_error;
    __pyx_L19:;
  }

  /* "bcolz/carray_ext.pyx":838
 *             schunk.write(chunk_.getdata())
 *         # Mark the cache as dirty if needed
 *         if nchunk == self.nchunk_cached:             # <<<<<<<<<<<<<<
 *             self.nchunk_cached = -1
 * 
 */
  __Pyx_TraceLine(838,0,__PYX_ERR(0, 838, __pyx_L1_error))
  __pyx_t_11 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->nchunk_cached); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_nchunk, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_13) {

    /* "bcolz/carray_ext.pyx":839
 *         # Mark the cache as dirty if needed
 *         if nchunk == self.nchunk_cached:
 *             self.nchunk_cached = -1             # <<<<<<<<<<<<<<
 * 
 *     def flush(self, chunk_):
 */
    __Pyx_TraceLine(839,0,__PYX_ERR(0, 839, __pyx_L1_error))
    __pyx_v_self->nchunk_cached = -1;

    /* "bcolz/carray_ext.pyx":838
 *             schunk.write(chunk_.getdata())
 *         # Mark the cache as dirty if needed
 *         if nchunk == self.nchunk_cached:             # <<<<<<<<<<<<<<
 *             self.nchunk_cached = -1
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":825
 *         self.nchunks += 1
 * 
 *     cdef _save(self, nchunk, chunk_):             # <<<<<<<<<<<<<<
 *         """Save the `chunk_` as chunk #`nchunk`. """
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("bcolz.carray_ext.chunks._save", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_schunkfile);
  __Pyx_XDECREF(__pyx_v_bloscpack_header);
  __Pyx_XDECREF(__pyx_v_schunk);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":841
 *             self.nchunk_cached = -1
 * 
 *     def flush(self, chunk_):             # <<<<<<<<<<<<<<
 *         """Flush the leftover chunk."""
 *         self._save(self.nchunks, chunk_)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_17flush(PyObject *__pyx_v_self, PyObject *__pyx_v_chunk_); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6chunks_16flush[] = "chunks.flush(self, chunk_)\nFlush the leftover chunk.";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_17flush(PyObject *__pyx_v_self, PyObject *__pyx_v_chunk_) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_16flush(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self), ((PyObject *)__pyx_v_chunk_));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_16flush(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self, PyObject *__pyx_v_chunk_) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("flush", 0);
  __Pyx_TraceCall("flush", __pyx_f[0], 841, 0, __PYX_ERR(0, 841, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":843
 *     def flush(self, chunk_):
 *         """Flush the leftover chunk."""
 *         self._save(self.nchunks, chunk_)             # <<<<<<<<<<<<<<
 * 
 *     def pop(self):
 */
  __Pyx_TraceLine(843,0,__PYX_ERR(0, 843, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->nchunks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks *)__pyx_v_self->__pyx_vtab)->_save(__pyx_v_self, __pyx_t_1, __pyx_v_chunk_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __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;

  /* "bcolz/carray_ext.pyx":841
 *             self.nchunk_cached = -1
 * 
 *     def flush(self, chunk_):             # <<<<<<<<<<<<<<
 *         """Flush the leftover chunk."""
 *         self._save(self.nchunks, chunk_)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":845
 *         self._save(self.nchunks, chunk_)
 * 
 *     def pop(self):             # <<<<<<<<<<<<<<
 *         """Remove the last chunk and return it."""
 *         nchunk = self.nchunks - 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_19pop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6chunks_18pop[] = "chunks.pop(self)\nRemove the last chunk and return it.";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6chunks_19pop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pop (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6chunks_18pop(((struct __pyx_obj_5bcolz_10carray_ext_chunks *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6chunks_18pop(struct __pyx_obj_5bcolz_10carray_ext_chunks *__pyx_v_self) {
  PyObject *__pyx_v_nchunk = NULL;
  PyObject *__pyx_v_chunk_ = NULL;
  PyObject *__pyx_v_schunkfile = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  __Pyx_RefNannySetupContext("pop", 0);
  __Pyx_TraceCall("pop", __pyx_f[0], 845, 0, __PYX_ERR(0, 845, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":847
 *     def pop(self):
 *         """Remove the last chunk and return it."""
 *         nchunk = self.nchunks - 1             # <<<<<<<<<<<<<<
 *         chunk_ = self.__getitem__(nchunk)
 *         schunkfile = self._chunk_file_name(nchunk)
 */
  __Pyx_TraceLine(847,0,__PYX_ERR(0, 847, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->nchunks - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nchunk = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":848
 *         """Remove the last chunk and return it."""
 *         nchunk = self.nchunks - 1
 *         chunk_ = self.__getitem__(nchunk)             # <<<<<<<<<<<<<<
 *         schunkfile = self._chunk_file_name(nchunk)
 *         if not os.path.exists(schunkfile):
 */
  __Pyx_TraceLine(848,0,__PYX_ERR(0, 848, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_nchunk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_nchunk);
    __Pyx_GIVEREF(__pyx_v_nchunk);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_nchunk);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_chunk_ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":849
 *         nchunk = self.nchunks - 1
 *         chunk_ = self.__getitem__(nchunk)
 *         schunkfile = self._chunk_file_name(nchunk)             # <<<<<<<<<<<<<<
 *         if not os.path.exists(schunkfile):
 *             raise IOError("chunk filename %s does exist" % schunkfile)
 */
  __Pyx_TraceLine(849,0,__PYX_ERR(0, 849, __pyx_L1_error))
  __pyx_t_1 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks *)__pyx_v_self->__pyx_vtab)->_chunk_file_name(__pyx_v_self, __pyx_v_nchunk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_schunkfile = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":850
 *         chunk_ = self.__getitem__(nchunk)
 *         schunkfile = self._chunk_file_name(nchunk)
 *         if not os.path.exists(schunkfile):             # <<<<<<<<<<<<<<
 *             raise IOError("chunk filename %s does exist" % schunkfile)
 *         os.remove(schunkfile)
 */
  __Pyx_TraceLine(850,0,__PYX_ERR(0, 850, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_schunkfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_schunkfile);
    __Pyx_GIVEREF(__pyx_v_schunkfile);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_schunkfile);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = ((!__pyx_t_5) != 0);
  if (__pyx_t_6) {

    /* "bcolz/carray_ext.pyx":851
 *         schunkfile = self._chunk_file_name(nchunk)
 *         if not os.path.exists(schunkfile):
 *             raise IOError("chunk filename %s does exist" % schunkfile)             # <<<<<<<<<<<<<<
 *         os.remove(schunkfile)
 * 
 */
    __Pyx_TraceLine(851,0,__PYX_ERR(0, 851, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_chunk_filename_s_does_exist, __pyx_v_schunkfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__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_ERR(0, 851, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":850
 *         chunk_ = self.__getitem__(nchunk)
 *         schunkfile = self._chunk_file_name(nchunk)
 *         if not os.path.exists(schunkfile):             # <<<<<<<<<<<<<<
 *             raise IOError("chunk filename %s does exist" % schunkfile)
 *         os.remove(schunkfile)
 */
  }

  /* "bcolz/carray_ext.pyx":852
 *         if not os.path.exists(schunkfile):
 *             raise IOError("chunk filename %s does exist" % schunkfile)
 *         os.remove(schunkfile)             # <<<<<<<<<<<<<<
 * 
 *         # When poping a chunk, we must be sure that we don't leave anything
 */
  __Pyx_TraceLine(852,0,__PYX_ERR(0, 852, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_schunkfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_schunkfile);
    __Pyx_GIVEREF(__pyx_v_schunkfile);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_schunkfile);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":856
 *         # When poping a chunk, we must be sure that we don't leave anything
 *         # behind (i.e. the lastchunk)
 *         schunkfile = self._chunk_file_name(nchunk + 1)             # <<<<<<<<<<<<<<
 *         if os.path.exists(schunkfile):
 *             os.remove(schunkfile)
 */
  __Pyx_TraceLine(856,0,__PYX_ERR(0, 856, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_nchunk, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks *)__pyx_v_self->__pyx_vtab)->_chunk_file_name(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_schunkfile, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":857
 *         # behind (i.e. the lastchunk)
 *         schunkfile = self._chunk_file_name(nchunk + 1)
 *         if os.path.exists(schunkfile):             # <<<<<<<<<<<<<<
 *             os.remove(schunkfile)
 * 
 */
  __Pyx_TraceLine(857,0,__PYX_ERR(0, 857, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_schunkfile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_schunkfile);
    __Pyx_GIVEREF(__pyx_v_schunkfile);
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_schunkfile);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 857, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "bcolz/carray_ext.pyx":858
 *         schunkfile = self._chunk_file_name(nchunk + 1)
 *         if os.path.exists(schunkfile):
 *             os.remove(schunkfile)             # <<<<<<<<<<<<<<
 * 
 *         self.nchunks -= 1
 */
    __Pyx_TraceLine(858,0,__PYX_ERR(0, 858, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_schunkfile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_schunkfile);
      __Pyx_GIVEREF(__pyx_v_schunkfile);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_schunkfile);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":857
 *         # behind (i.e. the lastchunk)
 *         schunkfile = self._chunk_file_name(nchunk + 1)
 *         if os.path.exists(schunkfile):             # <<<<<<<<<<<<<<
 *             os.remove(schunkfile)
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":860
 *             os.remove(schunkfile)
 * 
 *         self.nchunks -= 1             # <<<<<<<<<<<<<<
 *         return chunk_
 * 
 */
  __Pyx_TraceLine(860,0,__PYX_ERR(0, 860, __pyx_L1_error))
  __pyx_v_self->nchunks = (__pyx_v_self->nchunks - 1);

  /* "bcolz/carray_ext.pyx":861
 * 
 *         self.nchunks -= 1
 *         return chunk_             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_TraceLine(861,0,__PYX_ERR(0, 861, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_chunk_);
  __pyx_r = __pyx_v_chunk_;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":845
 *         self._save(self.nchunks, chunk_)
 * 
 *     def pop(self):             # <<<<<<<<<<<<<<
 *         """Remove the last chunk and return it."""
 *         nchunk = self.nchunks - 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bcolz.carray_ext.chunks.pop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nchunk);
  __Pyx_XDECREF(__pyx_v_chunk_);
  __Pyx_XDECREF(__pyx_v_schunkfile);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":920
 *     property leftover_ptr:
 *         """Pointer referring to the leftover_array"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             # Pointer to the leftovers chunk
 *             return self.lastchunkarr.ctypes.data
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_12leftover_ptr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_12leftover_ptr_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_12leftover_ptr___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_12leftover_ptr___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 920, 0, __PYX_ERR(0, 920, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":922
 *         def __get__(self):
 *             # Pointer to the leftovers chunk
 *             return self.lastchunkarr.ctypes.data             # <<<<<<<<<<<<<<
 * 
 *     property leftover_array:
 */
  __Pyx_TraceLine(922,0,__PYX_ERR(0, 922, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->lastchunkarr, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":920
 *     property leftover_ptr:
 *         """Pointer referring to the leftover_array"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             # Pointer to the leftovers chunk
 *             return self.lastchunkarr.ctypes.data
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.leftover_ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":926
 *     property leftover_array:
 *         """Array containing the leftovers chunk (uncompressed chunk)"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.lastchunkarr
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_14leftover_array_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_14leftover_array_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_14leftover_array___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_14leftover_array___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 926, 0, __PYX_ERR(0, 926, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":927
 *         """Array containing the leftovers chunk (uncompressed chunk)"""
 *         def __get__(self):
 *             return self.lastchunkarr             # <<<<<<<<<<<<<<
 * 
 *     property leftover_bytes:
 */
  __Pyx_TraceLine(927,0,__PYX_ERR(0, 927, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->lastchunkarr);
  __pyx_r = __pyx_v_self->lastchunkarr;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":926
 *     property leftover_array:
 *         """Array containing the leftovers chunk (uncompressed chunk)"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.lastchunkarr
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.leftover_array.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":931
 *     property leftover_bytes:
 *         """Number of bytes in the leftover_array"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.leftover
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_14leftover_bytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_14leftover_bytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_14leftover_bytes___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_14leftover_bytes___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 931, 0, __PYX_ERR(0, 931, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":932
 *         """Number of bytes in the leftover_array"""
 *         def __get__(self):
 *             return self.leftover             # <<<<<<<<<<<<<<
 * 
 *     property leftover_elements:
 */
  __Pyx_TraceLine(932,0,__PYX_ERR(0, 932, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->leftover); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":931
 *     property leftover_bytes:
 *         """Number of bytes in the leftover_array"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.leftover
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.leftover_bytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":936
 *     property leftover_elements:
 *         """Number of elements in the leftover_array"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return cython.cdiv(self.leftover, self.atomsize)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_17leftover_elements_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_17leftover_elements_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_17leftover_elements___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_17leftover_elements___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 936, 0, __PYX_ERR(0, 936, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":937
 *         """Number of elements in the leftover_array"""
 *         def __get__(self):
 *             return cython.cdiv(self.leftover, self.atomsize)             # <<<<<<<<<<<<<<
 * 
 *     property nchunks:
 */
  __Pyx_TraceLine(937,0,__PYX_ERR(0, 937, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->leftover / __pyx_v_self->atomsize)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":936
 *     property leftover_elements:
 *         """Number of elements in the leftover_array"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return cython.cdiv(self.leftover, self.atomsize)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.leftover_elements.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":941
 *     property nchunks:
 *         """Number of chunks in the carray"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             # TODO: do we need to handle the last chunk specially?
 *             return <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_7nchunks_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_7nchunks_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_7nchunks___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_7nchunks___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 941, 0, __PYX_ERR(0, 941, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":943
 *         def __get__(self):
 *             # TODO: do we need to handle the last chunk specially?
 *             return <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 * 
 *     property partitions:
 */
  __Pyx_TraceLine(943,0,__PYX_ERR(0, 943, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":941
 *     property nchunks:
 *         """Number of chunks in the carray"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             # TODO: do we need to handle the last chunk specially?
 *             return <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.nchunks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":947
 *     property partitions:
 *         """List of tuples indicating the bounds for each chunk"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *             chunklen = cython.cdiv(self._chunksize, self.atomsize)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_10partitions_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_10partitions_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_10partitions___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_10partitions___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  npy_intp __pyx_v_nchunks;
  PyObject *__pyx_v_chunklen = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 947, 0, __PYX_ERR(0, 947, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":948
 *         """List of tuples indicating the bounds for each chunk"""
 *         def __get__(self):
 *             nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *             chunklen = cython.cdiv(self._chunksize, self.atomsize)
 *             return [(i * chunklen, (i + 1) * chunklen) for i in
 */
  __Pyx_TraceLine(948,0,__PYX_ERR(0, 948, __pyx_L1_error))
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":949
 *         def __get__(self):
 *             nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *             chunklen = cython.cdiv(self._chunksize, self.atomsize)             # <<<<<<<<<<<<<<
 *             return [(i * chunklen, (i + 1) * chunklen) for i in
 *                     xrange(nchunks)]
 */
  __Pyx_TraceLine(949,0,__PYX_ERR(0, 949, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->_chunksize / __pyx_v_self->atomsize)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_chunklen = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":950
 *             nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *             chunklen = cython.cdiv(self._chunksize, self.atomsize)
 *             return [(i * chunklen, (i + 1) * chunklen) for i in             # <<<<<<<<<<<<<<
 *                     xrange(nchunks)]
 * 
 */
  __Pyx_TraceLine(950,0,__PYX_ERR(0, 950, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "bcolz/carray_ext.pyx":951
 *             chunklen = cython.cdiv(self._chunksize, self.atomsize)
 *             return [(i * chunklen, (i + 1) * chunklen) for i in
 *                     xrange(nchunks)]             # <<<<<<<<<<<<<<
 * 
 *     property attrs:
 */
  __Pyx_TraceLine(951,0,__PYX_ERR(0, 951, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_nchunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 951, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 951, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 951, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 951, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 951, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":950
 *             nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *             chunklen = cython.cdiv(self._chunksize, self.atomsize)
 *             return [(i * chunklen, (i + 1) * chunklen) for i in             # <<<<<<<<<<<<<<
 *                     xrange(nchunks)]
 * 
 */
    __Pyx_TraceLine(950,0,__PYX_ERR(0, 950, __pyx_L1_error))
    __pyx_t_2 = PyNumber_Multiply(__pyx_v_i, __pyx_v_chunklen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyNumber_Multiply(__pyx_t_6, __pyx_v_chunklen); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
    __pyx_t_2 = 0;
    __pyx_t_7 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 950, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":947
 *     property partitions:
 *         """List of tuples indicating the bounds for each chunk"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *             chunklen = cython.cdiv(self._chunksize, self.atomsize)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.partitions.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chunklen);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":962
 * 
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._attrs
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_5attrs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_5attrs_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_5attrs___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_5attrs___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 962, 0, __PYX_ERR(0, 962, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":963
 *         """
 *         def __get__(self):
 *             return self._attrs             # <<<<<<<<<<<<<<
 * 
 *     property cbytes:
 */
  __Pyx_TraceLine(963,0,__PYX_ERR(0, 963, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_attrs);
  __pyx_r = __pyx_v_self->_attrs;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":962
 * 
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._attrs
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.attrs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":967
 *     property cbytes:
 *         "The compressed size of this object (in bytes)."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._cbytes
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_6cbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_6cbytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_6cbytes___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_6cbytes___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 967, 0, __PYX_ERR(0, 967, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":968
 *         "The compressed size of this object (in bytes)."
 *         def __get__(self):
 *             return self._cbytes             # <<<<<<<<<<<<<<
 * 
 *     property chunklen:
 */
  __Pyx_TraceLine(968,0,__PYX_ERR(0, 968, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_cbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":967
 *     property cbytes:
 *         "The compressed size of this object (in bytes)."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._cbytes
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.cbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":972
 *     property chunklen:
 *         "The chunklen of this object (in rows)."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._chunklen
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_8chunklen_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_8chunklen_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_8chunklen___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_8chunklen___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 972, 0, __PYX_ERR(0, 972, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":973
 *         "The chunklen of this object (in rows)."
 *         def __get__(self):
 *             return self._chunklen             # <<<<<<<<<<<<<<
 * 
 *     property cparams:
 */
  __Pyx_TraceLine(973,0,__PYX_ERR(0, 973, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_chunklen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":972
 *     property chunklen:
 *         "The chunklen of this object (in rows)."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._chunklen
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.chunklen.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":977
 *     property cparams:
 *         "The compression parameters for this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._cparams
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_7cparams_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_7cparams_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_7cparams___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_7cparams___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 977, 0, __PYX_ERR(0, 977, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":978
 *         "The compression parameters for this object."
 *         def __get__(self):
 *             return self._cparams             # <<<<<<<<<<<<<<
 * 
 *     property dflt:
 */
  __Pyx_TraceLine(978,0,__PYX_ERR(0, 978, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_cparams);
  __pyx_r = __pyx_v_self->_cparams;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":977
 *     property cparams:
 *         "The compression parameters for this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._cparams
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.cparams.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":982
 *     property dflt:
 *         "The default value of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._dflt
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_4dflt_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_4dflt_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_4dflt___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4dflt___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 982, 0, __PYX_ERR(0, 982, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":983
 *         "The default value of this object."
 *         def __get__(self):
 *             return self._dflt             # <<<<<<<<<<<<<<
 * 
 *     property dtype:
 */
  __Pyx_TraceLine(983,0,__PYX_ERR(0, 983, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_dflt);
  __pyx_r = __pyx_v_self->_dflt;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":982
 *     property dflt:
 *         "The default value of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._dflt
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.dflt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":987
 *     property dtype:
 *         "The dtype of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._dtype.base
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_5dtype_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_5dtype___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_5dtype___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 987, 0, __PYX_ERR(0, 987, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":988
 *         "The dtype of this object."
 *         def __get__(self):
 *             return self._dtype.base             # <<<<<<<<<<<<<<
 * 
 *     property len:
 */
  __Pyx_TraceLine(988,0,__PYX_ERR(0, 988, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":987
 *     property dtype:
 *         "The dtype of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._dtype.base
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.dtype.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":992
 *     property len:
 *         "The length (leading dimension) of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._dtype.char == 'O':
 *                 return len(self.chunks)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_3len_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_3len_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_3len___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_3len___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 992, 0, __PYX_ERR(0, 992, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":993
 *         "The length (leading dimension) of this object."
 *         def __get__(self):
 *             if self._dtype.char == 'O':             # <<<<<<<<<<<<<<
 *                 return len(self.chunks)
 *             else:
 */
  __Pyx_TraceLine(993,0,__PYX_ERR(0, 993, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_char); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":994
 *         def __get__(self):
 *             if self._dtype.char == 'O':
 *                 return len(self.chunks)             # <<<<<<<<<<<<<<
 *             else:
 *                 # Important to do the cast in order to get a npy_intp result
 */
    __Pyx_TraceLine(994,0,__PYX_ERR(0, 994, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_v_self->chunks;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 994, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":993
 *         "The length (leading dimension) of this object."
 *         def __get__(self):
 *             if self._dtype.char == 'O':             # <<<<<<<<<<<<<<
 *                 return len(self.chunks)
 *             else:
 */
  }

  /* "bcolz/carray_ext.pyx":997
 *             else:
 *                 # Important to do the cast in order to get a npy_intp result
 *                 return <npy_intp> cython.cdiv(self._nbytes, self.atomsize)             # <<<<<<<<<<<<<<
 * 
 *     property mode:
 */
  __Pyx_TraceLine(997,0,__PYX_ERR(0, 997, __pyx_L1_error))
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->atomsize))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "bcolz/carray_ext.pyx":992
 *     property len:
 *         "The length (leading dimension) of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if self._dtype.char == 'O':
 *                 return len(self.chunks)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.len.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1001
 *     property mode:
 *         "The mode used to create/open the `mode`."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._mode
 *         def __set__(self, value):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_4mode_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_4mode_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_4mode___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4mode___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 1001, 0, __PYX_ERR(0, 1001, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1002
 *         "The mode used to create/open the `mode`."
 *         def __get__(self):
 *             return self._mode             # <<<<<<<<<<<<<<
 *         def __set__(self, value):
 *             self._mode = value
 */
  __Pyx_TraceLine(1002,0,__PYX_ERR(0, 1002, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_mode);
  __pyx_r = __pyx_v_self->_mode;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1001
 *     property mode:
 *         "The mode used to create/open the `mode`."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._mode
 *         def __set__(self, value):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1003
 *         def __get__(self):
 *             return self._mode
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._mode = value
 *             if hasattr(self.chunks, 'mode'):
 */

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6carray_4mode_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_6carray_4mode_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_4mode_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_6carray_4mode_2__set__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 1003, 0, __PYX_ERR(0, 1003, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1004
 *             return self._mode
 *         def __set__(self, value):
 *             self._mode = value             # <<<<<<<<<<<<<<
 *             if hasattr(self.chunks, 'mode'):
 *                 self.chunks.mode = value
 */
  __Pyx_TraceLine(1004,0,__PYX_ERR(0, 1004, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_mode);
  __Pyx_DECREF(__pyx_v_self->_mode);
  __pyx_v_self->_mode = __pyx_v_value;

  /* "bcolz/carray_ext.pyx":1005
 *         def __set__(self, value):
 *             self._mode = value
 *             if hasattr(self.chunks, 'mode'):             # <<<<<<<<<<<<<<
 *                 self.chunks.mode = value
 * 
 */
  __Pyx_TraceLine(1005,0,__PYX_ERR(0, 1005, __pyx_L1_error))
  __pyx_t_1 = __pyx_v_self->chunks;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_HasAttr(__pyx_t_1, __pyx_n_s_mode); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1006
 *             self._mode = value
 *             if hasattr(self.chunks, 'mode'):
 *                 self.chunks.mode = value             # <<<<<<<<<<<<<<
 * 
 *     property nbytes:
 */
    __Pyx_TraceLine(1006,0,__PYX_ERR(0, 1006, __pyx_L1_error))
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->chunks, __pyx_n_s_mode, __pyx_v_value) < 0) __PYX_ERR(0, 1006, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1005
 *         def __set__(self, value):
 *             self._mode = value
 *             if hasattr(self.chunks, 'mode'):             # <<<<<<<<<<<<<<
 *                 self.chunks.mode = value
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1003
 *         def __get__(self):
 *             return self._mode
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._mode = value
 *             if hasattr(self.chunks, 'mode'):
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.mode.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1010
 *     property nbytes:
 *         "The original (uncompressed) size of this object (in bytes)."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._nbytes
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_6nbytes_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_6nbytes___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_6nbytes___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 1010, 0, __PYX_ERR(0, 1010, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1011
 *         "The original (uncompressed) size of this object (in bytes)."
 *         def __get__(self):
 *             return self._nbytes             # <<<<<<<<<<<<<<
 * 
 *     property nleftover:
 */
  __Pyx_TraceLine(1011,0,__PYX_ERR(0, 1011, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1010
 *     property nbytes:
 *         "The original (uncompressed) size of this object (in bytes)."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._nbytes
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1015
 *     property nleftover:
 *         "The number of leftover elements."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return cython.cdiv(self.leftover, self.atomsize)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_9nleftover_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_9nleftover_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_9nleftover___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_9nleftover___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 1015, 0, __PYX_ERR(0, 1015, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1016
 *         "The number of leftover elements."
 *         def __get__(self):
 *             return cython.cdiv(self.leftover, self.atomsize)             # <<<<<<<<<<<<<<
 * 
 *     property ndim:
 */
  __Pyx_TraceLine(1016,0,__PYX_ERR(0, 1016, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->leftover / __pyx_v_self->atomsize)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1015
 *     property nleftover:
 *         "The number of leftover elements."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return cython.cdiv(self.leftover, self.atomsize)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.nleftover.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1020
 *     property ndim:
 *         "The number of dimensions of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return len(self.shape)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_4ndim_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_4ndim___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4ndim___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 1020, 0, __PYX_ERR(0, 1020, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1021
 *         "The number of dimensions of this object."
 *         def __get__(self):
 *             return len(self.shape)             # <<<<<<<<<<<<<<
 * 
 *     property safe:
 */
  __Pyx_TraceLine(1021,0,__PYX_ERR(0, 1021, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1020
 *     property ndim:
 *         "The number of dimensions of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return len(self.shape)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1025
 *     property safe:
 *         "Whether or not to perform type/shape checks on every operation."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._safe
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_4safe_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_4safe_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_4safe___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4safe___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 1025, 0, __PYX_ERR(0, 1025, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1026
 *         "Whether or not to perform type/shape checks on every operation."
 *         def __get__(self):
 *             return self._safe             # <<<<<<<<<<<<<<
 * 
 *     property shape:
 */
  __Pyx_TraceLine(1026,0,__PYX_ERR(0, 1026, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_safe);
  __pyx_r = __pyx_v_self->_safe;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1025
 *     property safe:
 *         "Whether or not to perform type/shape checks on every operation."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._safe
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.safe.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1030
 *     property shape:
 *         "The shape of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             # note: the int cast is in order to get a consistent type
 *             # across windows and linux
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_5shape___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_5shape___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 1030, 0, __PYX_ERR(0, 1030, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1033
 *             # note: the int cast is in order to get a consistent type
 *             # across windows and linux
 *             return tuple((int(self.len),) + self._dtype.shape)             # <<<<<<<<<<<<<<
 * 
 *     property size:
 */
  __Pyx_TraceLine(1033,0,__PYX_ERR(0, 1033, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1030
 *     property shape:
 *         "The shape of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             # note: the int cast is in order to get a consistent type
 *             # across windows and linux
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1037
 *     property size:
 *         "The size of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return np.prod(self.shape)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_4size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_4size___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4size___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 1037, 0, __PYX_ERR(0, 1037, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1038
 *         "The size of this object."
 *         def __get__(self):
 *             return np.prod(self.shape)             # <<<<<<<<<<<<<<
 * 
 *     property rootdir:
 */
  __Pyx_TraceLine(1038,0,__PYX_ERR(0, 1038, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_prod); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1037
 *     property size:
 *         "The size of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return np.prod(self.shape)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1042
 *     property rootdir:
 *         "The on-disk directory used for persistency."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._rootdir
 *         def __set__(self, value):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_7rootdir_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_7rootdir_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_7rootdir___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_7rootdir___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[0], 1042, 0, __PYX_ERR(0, 1042, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1043
 *         "The on-disk directory used for persistency."
 *         def __get__(self):
 *             return self._rootdir             # <<<<<<<<<<<<<<
 *         def __set__(self, value):
 *             if not self.rootdir:
 */
  __Pyx_TraceLine(1043,0,__PYX_ERR(0, 1043, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_rootdir);
  __pyx_r = __pyx_v_self->_rootdir;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1042
 *     property rootdir:
 *         "The on-disk directory used for persistency."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._rootdir
 *         def __set__(self, value):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.rootdir.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1044
 *         def __get__(self):
 *             return self._rootdir
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             if not self.rootdir:
 *                 raise ValueError(
 */

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6carray_7rootdir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_6carray_7rootdir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_7rootdir_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_6carray_7rootdir_2__set__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[0], 1044, 0, __PYX_ERR(0, 1044, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1045
 *             return self._rootdir
 *         def __set__(self, value):
 *             if not self.rootdir:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "cannot modify the rootdir value of an in-memory carray")
 */
  __Pyx_TraceLine(1045,0,__PYX_ERR(0, 1045, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rootdir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1045, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1046
 *         def __set__(self, value):
 *             if not self.rootdir:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "cannot modify the rootdir value of an in-memory carray")
 *             self._rootdir = value
 */
    __Pyx_TraceLine(1046,0,__PYX_ERR(0, 1046, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1046, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1045
 *             return self._rootdir
 *         def __set__(self, value):
 *             if not self.rootdir:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "cannot modify the rootdir value of an in-memory carray")
 */
  }

  /* "bcolz/carray_ext.pyx":1048
 *                 raise ValueError(
 *                     "cannot modify the rootdir value of an in-memory carray")
 *             self._rootdir = value             # <<<<<<<<<<<<<<
 *             self.chunks.rootdir = value
 * 
 */
  __Pyx_TraceLine(1048,0,__PYX_ERR(0, 1048, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_rootdir);
  __Pyx_DECREF(__pyx_v_self->_rootdir);
  __pyx_v_self->_rootdir = __pyx_v_value;

  /* "bcolz/carray_ext.pyx":1049
 *                     "cannot modify the rootdir value of an in-memory carray")
 *             self._rootdir = value
 *             self.chunks.rootdir = value             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, object array=None, object cparams=None,
 */
  __Pyx_TraceLine(1049,0,__PYX_ERR(0, 1049, __pyx_L1_error))
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->chunks, __pyx_n_s_rootdir, __pyx_v_value) < 0) __PYX_ERR(0, 1049, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":1044
 *         def __get__(self):
 *             return self._rootdir
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             if not self.rootdir:
 *                 raise ValueError(
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.rootdir.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1051
 *             self.chunks.rootdir = value
 * 
 *     def __cinit__(self, object array=None, object cparams=None,             # <<<<<<<<<<<<<<
 *                   object dtype=None, object dflt=None,
 *                   object expectedlen=None, object chunklen=None,
 */

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6carray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_6carray_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_array = 0;
  PyObject *__pyx_v_cparams = 0;
  PyObject *__pyx_v_dtype = 0;
  PyObject *__pyx_v_dflt = 0;
  PyObject *__pyx_v_expectedlen = 0;
  PyObject *__pyx_v_chunklen = 0;
  PyObject *__pyx_v_rootdir = 0;
  PyObject *__pyx_v_safe = 0;
  PyObject *__pyx_v_mode = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,&__pyx_n_s_cparams,&__pyx_n_s_dtype,&__pyx_n_s_dflt,&__pyx_n_s_expectedlen,&__pyx_n_s_chunklen,&__pyx_n_s_rootdir,&__pyx_n_s_safe,&__pyx_n_s_mode,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);

    /* "bcolz/carray_ext.pyx":1052
 * 
 *     def __cinit__(self, object array=None, object cparams=None,
 *                   object dtype=None, object dflt=None,             # <<<<<<<<<<<<<<
 *                   object expectedlen=None, object chunklen=None,
 *                   object rootdir=None, object safe=True, object mode="a"):
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);

    /* "bcolz/carray_ext.pyx":1053
 *     def __cinit__(self, object array=None, object cparams=None,
 *                   object dtype=None, object dflt=None,
 *                   object expectedlen=None, object chunklen=None,             # <<<<<<<<<<<<<<
 *                   object rootdir=None, object safe=True, object mode="a"):
 * 
 */
    values[4] = ((PyObject *)Py_None);
    values[5] = ((PyObject *)Py_None);

    /* "bcolz/carray_ext.pyx":1054
 *                   object dtype=None, object dflt=None,
 *                   object expectedlen=None, object chunklen=None,
 *                   object rootdir=None, object safe=True, object mode="a"):             # <<<<<<<<<<<<<<
 * 
 *         self._rootdir = rootdir
 */
    values[6] = ((PyObject *)Py_None);
    values[7] = ((PyObject *)Py_True);
    values[8] = ((PyObject *)__pyx_n_s_a);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        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_array);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cparams);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dflt);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_expectedlen);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunklen);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rootdir);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_safe);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1051, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        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_array = values[0];
    __pyx_v_cparams = values[1];
    __pyx_v_dtype = values[2];
    __pyx_v_dflt = values[3];
    __pyx_v_expectedlen = values[4];
    __pyx_v_chunklen = values[5];
    __pyx_v_rootdir = values[6];
    __pyx_v_safe = values[7];
    __pyx_v_mode = values[8];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1051, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray___cinit__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_array, __pyx_v_cparams, __pyx_v_dtype, __pyx_v_dflt, __pyx_v_expectedlen, __pyx_v_chunklen, __pyx_v_rootdir, __pyx_v_safe, __pyx_v_mode);

  /* "bcolz/carray_ext.pyx":1051
 *             self.chunks.rootdir = value
 * 
 *     def __cinit__(self, object array=None, object cparams=None,             # <<<<<<<<<<<<<<
 *                   object dtype=None, object dflt=None,
 *                   object expectedlen=None, object chunklen=None,
 */

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

static int __pyx_pf_5bcolz_10carray_ext_6carray___cinit__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_array, PyObject *__pyx_v_cparams, PyObject *__pyx_v_dtype, PyObject *__pyx_v_dflt, PyObject *__pyx_v_expectedlen, PyObject *__pyx_v_chunklen, PyObject *__pyx_v_rootdir, PyObject *__pyx_v_safe, PyObject *__pyx_v_mode) {
  int __pyx_v__new;
  PyObject *__pyx_v_meta_info = NULL;
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_TraceCall("__cinit__", __pyx_f[0], 1051, 0, __PYX_ERR(0, 1051, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1056
 *                   object rootdir=None, object safe=True, object mode="a"):
 * 
 *         self._rootdir = rootdir             # <<<<<<<<<<<<<<
 *         if mode not in ('r', 'w', 'a'):
 *             raise ValueError("mode should be 'r', 'w' or 'a'")
 */
  __Pyx_TraceLine(1056,0,__PYX_ERR(0, 1056, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_rootdir);
  __Pyx_GIVEREF(__pyx_v_rootdir);
  __Pyx_GOTREF(__pyx_v_self->_rootdir);
  __Pyx_DECREF(__pyx_v_self->_rootdir);
  __pyx_v_self->_rootdir = __pyx_v_rootdir;

  /* "bcolz/carray_ext.pyx":1057
 * 
 *         self._rootdir = rootdir
 *         if mode not in ('r', 'w', 'a'):             # <<<<<<<<<<<<<<
 *             raise ValueError("mode should be 'r', 'w' or 'a'")
 *         self._mode = mode
 */
  __Pyx_TraceLine(1057,0,__PYX_ERR(0, 1057, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_mode);
  __pyx_t_1 = __pyx_v_mode;
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_r, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1057, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_w, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1057, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_a, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1057, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1058
 *         self._rootdir = rootdir
 *         if mode not in ('r', 'w', 'a'):
 *             raise ValueError("mode should be 'r', 'w' or 'a'")             # <<<<<<<<<<<<<<
 *         self._mode = mode
 *         self._safe = safe
 */
    __Pyx_TraceLine(1058,0,__PYX_ERR(0, 1058, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1058, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1057
 * 
 *         self._rootdir = rootdir
 *         if mode not in ('r', 'w', 'a'):             # <<<<<<<<<<<<<<
 *             raise ValueError("mode should be 'r', 'w' or 'a'")
 *         self._mode = mode
 */
  }

  /* "bcolz/carray_ext.pyx":1059
 *         if mode not in ('r', 'w', 'a'):
 *             raise ValueError("mode should be 'r', 'w' or 'a'")
 *         self._mode = mode             # <<<<<<<<<<<<<<
 *         self._safe = safe
 * 
 */
  __Pyx_TraceLine(1059,0,__PYX_ERR(0, 1059, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_mode);
  __Pyx_GIVEREF(__pyx_v_mode);
  __Pyx_GOTREF(__pyx_v_self->_mode);
  __Pyx_DECREF(__pyx_v_self->_mode);
  __pyx_v_self->_mode = __pyx_v_mode;

  /* "bcolz/carray_ext.pyx":1060
 *             raise ValueError("mode should be 'r', 'w' or 'a'")
 *         self._mode = mode
 *         self._safe = safe             # <<<<<<<<<<<<<<
 * 
 *         if array is not None:
 */
  __Pyx_TraceLine(1060,0,__PYX_ERR(0, 1060, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_safe);
  __Pyx_GIVEREF(__pyx_v_safe);
  __Pyx_GOTREF(__pyx_v_self->_safe);
  __Pyx_DECREF(__pyx_v_self->_safe);
  __pyx_v_self->_safe = __pyx_v_safe;

  /* "bcolz/carray_ext.pyx":1062
 *         self._safe = safe
 * 
 *         if array is not None:             # <<<<<<<<<<<<<<
 *             self._create_carray(array, cparams, dtype, dflt,
 *                                 expectedlen, chunklen, rootdir, mode)
 */
  __Pyx_TraceLine(1062,0,__PYX_ERR(0, 1062, __pyx_L1_error))
  __pyx_t_3 = (__pyx_v_array != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1063
 * 
 *         if array is not None:
 *             self._create_carray(array, cparams, dtype, dflt,             # <<<<<<<<<<<<<<
 *                                 expectedlen, chunklen, rootdir, mode)
 *             _new = True
 */
    __Pyx_TraceLine(1063,0,__PYX_ERR(0, 1063, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_carray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "bcolz/carray_ext.pyx":1064
 *         if array is not None:
 *             self._create_carray(array, cparams, dtype, dflt,
 *                                 expectedlen, chunklen, rootdir, mode)             # <<<<<<<<<<<<<<
 *             _new = True
 *         elif rootdir is not None:
 */
    __Pyx_TraceLine(1064,0,__PYX_ERR(0, 1064, __pyx_L1_error))
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(8+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_array);
    __Pyx_GIVEREF(__pyx_v_array);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_array);
    __Pyx_INCREF(__pyx_v_cparams);
    __Pyx_GIVEREF(__pyx_v_cparams);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_cparams);
    __Pyx_INCREF(__pyx_v_dtype);
    __Pyx_GIVEREF(__pyx_v_dtype);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_dtype);
    __Pyx_INCREF(__pyx_v_dflt);
    __Pyx_GIVEREF(__pyx_v_dflt);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_dflt);
    __Pyx_INCREF(__pyx_v_expectedlen);
    __Pyx_GIVEREF(__pyx_v_expectedlen);
    PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_expectedlen);
    __Pyx_INCREF(__pyx_v_chunklen);
    __Pyx_GIVEREF(__pyx_v_chunklen);
    PyTuple_SET_ITEM(__pyx_t_7, 5+__pyx_t_6, __pyx_v_chunklen);
    __Pyx_INCREF(__pyx_v_rootdir);
    __Pyx_GIVEREF(__pyx_v_rootdir);
    PyTuple_SET_ITEM(__pyx_t_7, 6+__pyx_t_6, __pyx_v_rootdir);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    PyTuple_SET_ITEM(__pyx_t_7, 7+__pyx_t_6, __pyx_v_mode);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1065
 *             self._create_carray(array, cparams, dtype, dflt,
 *                                 expectedlen, chunklen, rootdir, mode)
 *             _new = True             # <<<<<<<<<<<<<<
 *         elif rootdir is not None:
 *             meta_info = self._read_meta()
 */
    __Pyx_TraceLine(1065,0,__PYX_ERR(0, 1065, __pyx_L1_error))
    __pyx_v__new = 1;

    /* "bcolz/carray_ext.pyx":1062
 *         self._safe = safe
 * 
 *         if array is not None:             # <<<<<<<<<<<<<<
 *             self._create_carray(array, cparams, dtype, dflt,
 *                                 expectedlen, chunklen, rootdir, mode)
 */
    goto __pyx_L7;
  }

  /* "bcolz/carray_ext.pyx":1066
 *                                 expectedlen, chunklen, rootdir, mode)
 *             _new = True
 *         elif rootdir is not None:             # <<<<<<<<<<<<<<
 *             meta_info = self._read_meta()
 *             self._open_carray(*meta_info)
 */
  __Pyx_TraceLine(1066,0,__PYX_ERR(0, 1066, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_rootdir != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1067
 *             _new = True
 *         elif rootdir is not None:
 *             meta_info = self._read_meta()             # <<<<<<<<<<<<<<
 *             self._open_carray(*meta_info)
 *             _new = False
 */
    __Pyx_TraceLine(1067,0,__PYX_ERR(0, 1067, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_meta); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_7) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_meta_info = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1068
 *         elif rootdir is not None:
 *             meta_info = self._read_meta()
 *             self._open_carray(*meta_info)             # <<<<<<<<<<<<<<
 *             _new = False
 *         else:
 */
    __Pyx_TraceLine(1068,0,__PYX_ERR(0, 1068, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open_carray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PySequence_Tuple(__pyx_v_meta_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "bcolz/carray_ext.pyx":1069
 *             meta_info = self._read_meta()
 *             self._open_carray(*meta_info)
 *             _new = False             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError(
 */
    __Pyx_TraceLine(1069,0,__PYX_ERR(0, 1069, __pyx_L1_error))
    __pyx_v__new = 0;

    /* "bcolz/carray_ext.pyx":1066
 *                                 expectedlen, chunklen, rootdir, mode)
 *             _new = True
 *         elif rootdir is not None:             # <<<<<<<<<<<<<<
 *             meta_info = self._read_meta()
 *             self._open_carray(*meta_info)
 */
    goto __pyx_L7;
  }

  /* "bcolz/carray_ext.pyx":1071
 *             _new = False
 *         else:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "You need at least to pass an array or/and a rootdir")
 * 
 */
  __Pyx_TraceLine(1071,0,__PYX_ERR(0, 1071, __pyx_L1_error))
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(0, 1071, __pyx_L1_error)
  }
  __pyx_L7:;

  /* "bcolz/carray_ext.pyx":1075
 * 
 *         # Attach the attrs to this object
 *         self._attrs = attrs.attrs(self._rootdir, self.mode, _new=_new)             # <<<<<<<<<<<<<<
 * 
 *         # Cache a len-1 array for accelerating self[int] case
 */
  __Pyx_TraceLine(1075,0,__PYX_ERR(0, 1075, __pyx_L1_error))
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->_rootdir);
  __Pyx_GIVEREF(__pyx_v_self->_rootdir);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_rootdir);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v__new); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_new, __pyx_t_5) < 0) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->_attrs);
  __Pyx_DECREF(__pyx_v_self->_attrs);
  __pyx_v_self->_attrs = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":1078
 * 
 *         # Cache a len-1 array for accelerating self[int] case
 *         self.arr1 = np.empty(shape=(1,), dtype=self._dtype)             # <<<<<<<<<<<<<<
 * 
 *         # Sentinels
 */
  __Pyx_TraceLine(1078,0,__PYX_ERR(0, 1078, __pyx_L1_error))
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_tuple__29) < 0) __PYX_ERR(0, 1078, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) __PYX_ERR(0, 1078, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arr1);
  __Pyx_DECREF(__pyx_v_self->arr1);
  __pyx_v_self->arr1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1081
 * 
 *         # Sentinels
 *         self.sss_mode = False             # <<<<<<<<<<<<<<
 *         self.wheretrue_mode = False
 *         self.where_mode = False
 */
  __Pyx_TraceLine(1081,0,__PYX_ERR(0, 1081, __pyx_L1_error))
  __pyx_v_self->sss_mode = 0;

  /* "bcolz/carray_ext.pyx":1082
 *         # Sentinels
 *         self.sss_mode = False
 *         self.wheretrue_mode = False             # <<<<<<<<<<<<<<
 *         self.where_mode = False
 *         self.idxcache = -1  # cache not initialized
 */
  __Pyx_TraceLine(1082,0,__PYX_ERR(0, 1082, __pyx_L1_error))
  __pyx_v_self->wheretrue_mode = 0;

  /* "bcolz/carray_ext.pyx":1083
 *         self.sss_mode = False
 *         self.wheretrue_mode = False
 *         self.where_mode = False             # <<<<<<<<<<<<<<
 *         self.idxcache = -1  # cache not initialized
 * 
 */
  __Pyx_TraceLine(1083,0,__PYX_ERR(0, 1083, __pyx_L1_error))
  __pyx_v_self->where_mode = 0;

  /* "bcolz/carray_ext.pyx":1084
 *         self.wheretrue_mode = False
 *         self.where_mode = False
 *         self.idxcache = -1  # cache not initialized             # <<<<<<<<<<<<<<
 * 
 *     cdef _adapt_dtype(self, dtype_, shape):
 */
  __Pyx_TraceLine(1084,0,__PYX_ERR(0, 1084, __pyx_L1_error))
  __pyx_v_self->idxcache = -1;

  /* "bcolz/carray_ext.pyx":1051
 *             self.chunks.rootdir = value
 * 
 *     def __cinit__(self, object array=None, object cparams=None,             # <<<<<<<<<<<<<<
 *                   object dtype=None, object dflt=None,
 *                   object expectedlen=None, object chunklen=None,
 */

  /* function exit code */
  __pyx_r = 0;
  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_7);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_meta_info);
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1086
 *         self.idxcache = -1  # cache not initialized
 * 
 *     cdef _adapt_dtype(self, dtype_, shape):             # <<<<<<<<<<<<<<
 *         """adapt the dtype to one supported in carray.
 *         returns the adapted type with the shape modified accordingly.
 */

static PyObject *__pyx_f_5bcolz_10carray_ext_6carray__adapt_dtype(CYTHON_UNUSED struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_dtype_, PyObject *__pyx_v_shape) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_adapt_dtype", 0);
  __Pyx_TraceCall("_adapt_dtype", __pyx_f[0], 1086, 0, __PYX_ERR(0, 1086, __pyx_L1_error));
  __Pyx_INCREF(__pyx_v_dtype_);

  /* "bcolz/carray_ext.pyx":1090
 *         returns the adapted type with the shape modified accordingly.
 *         """
 *         if dtype_.hasobject:             # <<<<<<<<<<<<<<
 *             if dtype_ != np.object_:
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")
 */
  __Pyx_TraceLine(1090,0,__PYX_ERR(0, 1090, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype_, __pyx_n_s_hasobject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1090, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1091
 *         """
 *         if dtype_.hasobject:
 *             if dtype_ != np.object_:             # <<<<<<<<<<<<<<
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")
 *         else:
 */
    __Pyx_TraceLine(1091,0,__PYX_ERR(0, 1091, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_dtype_, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1091, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1092
 *         if dtype_.hasobject:
 *             if dtype_ != np.object_:
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")             # <<<<<<<<<<<<<<
 *         else:
 *             dtype_ = np.dtype((dtype_, shape[1:]))
 */
      __Pyx_TraceLine(1092,0,__PYX_ERR(0, 1092, __pyx_L1_error))
      __pyx_t_1 = PyObject_Repr(__pyx_v_dtype_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s_is_not_a_supported_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1092, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1092, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1092, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1091
 *         """
 *         if dtype_.hasobject:
 *             if dtype_ != np.object_:             # <<<<<<<<<<<<<<
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")
 *         else:
 */
    }

    /* "bcolz/carray_ext.pyx":1090
 *         returns the adapted type with the shape modified accordingly.
 *         """
 *         if dtype_.hasobject:             # <<<<<<<<<<<<<<
 *             if dtype_ != np.object_:
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":1094
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")
 *         else:
 *             dtype_ = np.dtype((dtype_, shape[1:]))             # <<<<<<<<<<<<<<
 * 
 *         return dtype_
 */
  __Pyx_TraceLine(1094,0,__PYX_ERR(0, 1094, __pyx_L1_error))
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_shape, 1, 0, NULL, NULL, &__pyx_slice__30, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_dtype_);
    __Pyx_GIVEREF(__pyx_v_dtype_);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dtype_);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_dtype_, __pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":1096
 *             dtype_ = np.dtype((dtype_, shape[1:]))
 * 
 *         return dtype_             # <<<<<<<<<<<<<<
 * 
 *     def _create_carray(self, array, cparams, dtype, dflt,
 */
  __Pyx_TraceLine(1096,0,__PYX_ERR(0, 1096, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_dtype_);
  __pyx_r = __pyx_v_dtype_;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1086
 *         self.idxcache = -1  # cache not initialized
 * 
 *     cdef _adapt_dtype(self, dtype_, shape):             # <<<<<<<<<<<<<<
 *         """adapt the dtype to one supported in carray.
 *         returns the adapted type with the shape modified accordingly.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._adapt_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtype_);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1098
 *         return dtype_
 * 
 *     def _create_carray(self, array, cparams, dtype, dflt,             # <<<<<<<<<<<<<<
 *                       expectedlen, chunklen, rootdir, mode):
 *         """Create a new array.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_3_create_carray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_2_create_carray[] = "carray._create_carray(self, array, cparams, dtype, dflt, expectedlen, chunklen, rootdir, mode)\nCreate a new array.\n\n        There are restrictions creating carray objects with dtypes that have\n        objects (dtype.hasobject is True). The only case where this dtype is\n        supported is on unidimensional arrays whose dtype is object (objects in\n        composite dtypes are not supported).\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_3_create_carray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_array = 0;
  PyObject *__pyx_v_cparams = 0;
  PyObject *__pyx_v_dtype = 0;
  PyObject *__pyx_v_dflt = 0;
  PyObject *__pyx_v_expectedlen = 0;
  PyObject *__pyx_v_chunklen = 0;
  PyObject *__pyx_v_rootdir = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_carray (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,&__pyx_n_s_cparams,&__pyx_n_s_dtype,&__pyx_n_s_dflt,&__pyx_n_s_expectedlen,&__pyx_n_s_chunklen,&__pyx_n_s_rootdir,&__pyx_n_s_mode,0};
    PyObject* values[8] = {0,0,0,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  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        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 (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cparams)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_create_carray", 1, 8, 8, 1); __PYX_ERR(0, 1098, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_create_carray", 1, 8, 8, 2); __PYX_ERR(0, 1098, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dflt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_create_carray", 1, 8, 8, 3); __PYX_ERR(0, 1098, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_expectedlen)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_create_carray", 1, 8, 8, 4); __PYX_ERR(0, 1098, __pyx_L3_error)
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunklen)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_create_carray", 1, 8, 8, 5); __PYX_ERR(0, 1098, __pyx_L3_error)
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rootdir)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_create_carray", 1, 8, 8, 6); __PYX_ERR(0, 1098, __pyx_L3_error)
        }
        case  7:
        if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_create_carray", 1, 8, 8, 7); __PYX_ERR(0, 1098, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_carray") < 0)) __PYX_ERR(0, 1098, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      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);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_array = values[0];
    __pyx_v_cparams = values[1];
    __pyx_v_dtype = values[2];
    __pyx_v_dflt = values[3];
    __pyx_v_expectedlen = values[4];
    __pyx_v_chunklen = values[5];
    __pyx_v_rootdir = values[6];
    __pyx_v_mode = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_create_carray", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1098, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray._create_carray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_2_create_carray(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_array, __pyx_v_cparams, __pyx_v_dtype, __pyx_v_dflt, __pyx_v_expectedlen, __pyx_v_chunklen, __pyx_v_rootdir, __pyx_v_mode);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_2_create_carray(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_array, PyObject *__pyx_v_cparams, PyObject *__pyx_v_dtype, PyObject *__pyx_v_dflt, PyObject *__pyx_v_expectedlen, PyObject *__pyx_v_chunklen, PyObject *__pyx_v_rootdir, PyObject *__pyx_v_mode) {
  CYTHON_UNUSED int __pyx_v_itemsize;
  int __pyx_v_atomsize;
  int __pyx_v_chunksize;
  PyArrayObject *__pyx_v_lastchunkarr = 0;
  PyObject *__pyx_v_array_ = 0;
  PyObject *__pyx_v__dflt = 0;
  PyObject *__pyx_v_metainfo = NULL;
  PyObject *__pyx_v_obj = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  npy_intp __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  char *__pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  __Pyx_RefNannySetupContext("_create_carray", 0);
  __Pyx_TraceCall("_create_carray", __pyx_f[0], 1098, 0, __PYX_ERR(0, 1098, __pyx_L1_error));
  __Pyx_INCREF(__pyx_v_array);
  __Pyx_INCREF(__pyx_v_cparams);
  __Pyx_INCREF(__pyx_v_dtype);
  __Pyx_INCREF(__pyx_v_expectedlen);
  __Pyx_INCREF(__pyx_v_chunklen);

  /* "bcolz/carray_ext.pyx":1113
 * 
 *         # Check defaults for cparams
 *         if cparams is None:             # <<<<<<<<<<<<<<
 *             cparams = bcolz.cparams()
 * 
 */
  __Pyx_TraceLine(1113,0,__PYX_ERR(0, 1113, __pyx_L1_error))
  __pyx_t_1 = (__pyx_v_cparams == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1114
 *         # Check defaults for cparams
 *         if cparams is None:
 *             cparams = bcolz.cparams()             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(cparams, bcolz.cparams):
 */
    __Pyx_TraceLine(1114,0,__PYX_ERR(0, 1114, __pyx_L1_error))
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_bcolz); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cparams); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1114, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1114, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_cparams, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1113
 * 
 *         # Check defaults for cparams
 *         if cparams is None:             # <<<<<<<<<<<<<<
 *             cparams = bcolz.cparams()
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1116
 *             cparams = bcolz.cparams()
 * 
 *         if not isinstance(cparams, bcolz.cparams):             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "`cparams` param must be an instance of `cparams` class")
 */
  __Pyx_TraceLine(1116,0,__PYX_ERR(0, 1116, __pyx_L1_error))
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_bcolz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cparams); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_cparams, __pyx_t_5); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":1117
 * 
 *         if not isinstance(cparams, bcolz.cparams):
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "`cparams` param must be an instance of `cparams` class")
 * 
 */
    __Pyx_TraceLine(1117,0,__PYX_ERR(0, 1117, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1117, __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_ERR(0, 1117, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1116
 *             cparams = bcolz.cparams()
 * 
 *         if not isinstance(cparams, bcolz.cparams):             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "`cparams` param must be an instance of `cparams` class")
 */
  }

  /* "bcolz/carray_ext.pyx":1121
 * 
 *         # Convert input to an appropriate type
 *         if type(dtype) is str:             # <<<<<<<<<<<<<<
 *             dtype = np.dtype(dtype)
 * 
 */
  __Pyx_TraceLine(1121,0,__PYX_ERR(0, 1121, __pyx_L1_error))
  __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_dtype)) == ((PyObject *)(&PyString_Type)));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1122
 *         # Convert input to an appropriate type
 *         if type(dtype) is str:
 *             dtype = np.dtype(dtype)             # <<<<<<<<<<<<<<
 * 
 *         # avoid bad performance with another carray, as in utils it would
 */
    __Pyx_TraceLine(1122,0,__PYX_ERR(0, 1122, __pyx_L1_error))
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_dtype);
    __Pyx_GIVEREF(__pyx_v_dtype);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dtype);
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1121
 * 
 *         # Convert input to an appropriate type
 *         if type(dtype) is str:             # <<<<<<<<<<<<<<
 *             dtype = np.dtype(dtype)
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1129
 *         # TODO: There should be a fast path creating carrays from other carrays
 *         # (especially when dtypes and compression params match)
 *         if isinstance(array, carray):             # <<<<<<<<<<<<<<
 *             array = array[:]
 * 
 */
  __Pyx_TraceLine(1129,0,__PYX_ERR(0, 1129, __pyx_L1_error))
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_array, __pyx_ptype_5bcolz_10carray_ext_carray); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":1130
 *         # (especially when dtypes and compression params match)
 *         if isinstance(array, carray):
 *             array = array[:]             # <<<<<<<<<<<<<<
 * 
 *         array_ = utils.to_ndarray(array, dtype)
 */
    __Pyx_TraceLine(1130,0,__PYX_ERR(0, 1130, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_array, 0, 0, NULL, NULL, &__pyx_slice__32, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1129
 *         # TODO: There should be a fast path creating carrays from other carrays
 *         # (especially when dtypes and compression params match)
 *         if isinstance(array, carray):             # <<<<<<<<<<<<<<
 *             array = array[:]
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1132
 *             array = array[:]
 * 
 *         array_ = utils.to_ndarray(array, dtype)             # <<<<<<<<<<<<<<
 * 
 *         # if no base dtype is provided, use the dtype from the array.
 */
  __Pyx_TraceLine(1132,0,__PYX_ERR(0, 1132, __pyx_L1_error))
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_to_ndarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(__pyx_v_array);
  __Pyx_GIVEREF(__pyx_v_array);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_array);
  __Pyx_INCREF(__pyx_v_dtype);
  __Pyx_GIVEREF(__pyx_v_dtype);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_dtype);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_array_ = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1135
 * 
 *         # if no base dtype is provided, use the dtype from the array.
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             dtype = array_.dtype.base
 * 
 */
  __Pyx_TraceLine(1135,0,__PYX_ERR(0, 1135, __pyx_L1_error))
  __pyx_t_1 = (__pyx_v_dtype == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1136
 *         # if no base dtype is provided, use the dtype from the array.
 *         if dtype is None:
 *             dtype = array_.dtype.base             # <<<<<<<<<<<<<<
 * 
 *         # Multidimensional array.  The atom will have array_.shape[1:] dims.
 */
    __Pyx_TraceLine(1136,0,__PYX_ERR(0, 1136, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_array_, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":1135
 * 
 *         # if no base dtype is provided, use the dtype from the array.
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             dtype = array_.dtype.base
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1146
 *         # Note that objects are a special case. Carray does not support object
 *         # arrays of more than one dimension.
 *         self._dtype = dtype = self._adapt_dtype(dtype, array_.shape)             # <<<<<<<<<<<<<<
 * 
 *         # Check that atom size is less than 2 GB
 */
  __Pyx_TraceLine(1146,0,__PYX_ERR(0, 1146, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_array_, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_carray *)__pyx_v_self->__pyx_vtab)->_adapt_dtype(__pyx_v_self, __pyx_v_dtype, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->_dtype);
  __Pyx_DECREF(__pyx_v_self->_dtype);
  __pyx_v_self->_dtype = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1149
 * 
 *         # Check that atom size is less than 2 GB
 *         if dtype.itemsize >= 2 ** 31:             # <<<<<<<<<<<<<<
 *             raise ValueError("atomic size is too large (>= 2 GB)")
 * 
 */
  __Pyx_TraceLine(1149,0,__PYX_ERR(0, 1149, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_2147483648, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1150
 *         # Check that atom size is less than 2 GB
 *         if dtype.itemsize >= 2 ** 31:
 *             raise ValueError("atomic size is too large (>= 2 GB)")             # <<<<<<<<<<<<<<
 * 
 *         # Check that atom size is larger than 0
 */
    __Pyx_TraceLine(1150,0,__PYX_ERR(0, 1150, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1150, __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_ERR(0, 1150, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1149
 * 
 *         # Check that atom size is less than 2 GB
 *         if dtype.itemsize >= 2 ** 31:             # <<<<<<<<<<<<<<
 *             raise ValueError("atomic size is too large (>= 2 GB)")
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1153
 * 
 *         # Check that atom size is larger than 0
 *         if dtype.itemsize == 0:             # <<<<<<<<<<<<<<
 *             raise TypeError("atomic size cannot be zero")
 * 
 */
  __Pyx_TraceLine(1153,0,__PYX_ERR(0, 1153, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1154
 *         # Check that atom size is larger than 0
 *         if dtype.itemsize == 0:
 *             raise TypeError("atomic size cannot be zero")             # <<<<<<<<<<<<<<
 * 
 *         self.atomsize = atomsize = dtype.itemsize
 */
    __Pyx_TraceLine(1154,0,__PYX_ERR(0, 1154, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1154, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1153
 * 
 *         # Check that atom size is larger than 0
 *         if dtype.itemsize == 0:             # <<<<<<<<<<<<<<
 *             raise TypeError("atomic size cannot be zero")
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1156
 *             raise TypeError("atomic size cannot be zero")
 * 
 *         self.atomsize = atomsize = dtype.itemsize             # <<<<<<<<<<<<<<
 *         """The size in bytes of the atom (carray[0,:])."""
 *         self.itemsize = itemsize = dtype.base.itemsize
 */
  __Pyx_TraceLine(1156,0,__PYX_ERR(0, 1156, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->atomsize = __pyx_t_8;
  __pyx_v_atomsize = __pyx_t_8;

  /* "bcolz/carray_ext.pyx":1158
 *         self.atomsize = atomsize = dtype.itemsize
 *         """The size in bytes of the atom (carray[0,:])."""
 *         self.itemsize = itemsize = dtype.base.itemsize             # <<<<<<<<<<<<<<
 *         """The size in bytes of the elments of the carray."""
 * 
 */
  __Pyx_TraceLine(1158,0,__PYX_ERR(0, 1158, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->itemsize = __pyx_t_8;
  __pyx_v_itemsize = __pyx_t_8;

  /* "bcolz/carray_ext.pyx":1162
 * 
 *         # Check defaults for dflt
 *         _dflt = np.zeros((), dtype=dtype.base)             # <<<<<<<<<<<<<<
 *         if dflt is not None:
 *             _dflt[()] = dflt
 */
  __Pyx_TraceLine(1162,0,__PYX_ERR(0, 1162, __pyx_L1_error))
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__35, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v__dflt = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "bcolz/carray_ext.pyx":1163
 *         # Check defaults for dflt
 *         _dflt = np.zeros((), dtype=dtype.base)
 *         if dflt is not None:             # <<<<<<<<<<<<<<
 *             _dflt[()] = dflt
 *         self._dflt = _dflt
 */
  __Pyx_TraceLine(1163,0,__PYX_ERR(0, 1163, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_dflt != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":1164
 *         _dflt = np.zeros((), dtype=dtype.base)
 *         if dflt is not None:
 *             _dflt[()] = dflt             # <<<<<<<<<<<<<<
 *         self._dflt = _dflt
 * 
 */
    __Pyx_TraceLine(1164,0,__PYX_ERR(0, 1164, __pyx_L1_error))
    if (unlikely(PyObject_SetItem(__pyx_v__dflt, __pyx_empty_tuple, __pyx_v_dflt) < 0)) __PYX_ERR(0, 1164, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1163
 *         # Check defaults for dflt
 *         _dflt = np.zeros((), dtype=dtype.base)
 *         if dflt is not None:             # <<<<<<<<<<<<<<
 *             _dflt[()] = dflt
 *         self._dflt = _dflt
 */
  }

  /* "bcolz/carray_ext.pyx":1165
 *         if dflt is not None:
 *             _dflt[()] = dflt
 *         self._dflt = _dflt             # <<<<<<<<<<<<<<
 * 
 *         # Compute the chunklen/chunksize
 */
  __Pyx_TraceLine(1165,0,__PYX_ERR(0, 1165, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v__dflt);
  __Pyx_GIVEREF(__pyx_v__dflt);
  __Pyx_GOTREF(__pyx_v_self->_dflt);
  __Pyx_DECREF(__pyx_v_self->_dflt);
  __pyx_v_self->_dflt = __pyx_v__dflt;

  /* "bcolz/carray_ext.pyx":1168
 * 
 *         # Compute the chunklen/chunksize
 *         if expectedlen is None:             # <<<<<<<<<<<<<<
 *             # Try a guess
 *             try:
 */
  __Pyx_TraceLine(1168,0,__PYX_ERR(0, 1168, __pyx_L1_error))
  __pyx_t_1 = (__pyx_v_expectedlen == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1170
 *         if expectedlen is None:
 *             # Try a guess
 *             try:             # <<<<<<<<<<<<<<
 *                 expectedlen = len(array_)
 *             except TypeError:
 */
    __Pyx_TraceLine(1170,0,__PYX_ERR(0, 1170, __pyx_L12_error))
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      /*try:*/ {

        /* "bcolz/carray_ext.pyx":1171
 *             # Try a guess
 *             try:
 *                 expectedlen = len(array_)             # <<<<<<<<<<<<<<
 *             except TypeError:
 *                 raise NotImplementedError(
 */
        __Pyx_TraceLine(1171,0,__PYX_ERR(0, 1171, __pyx_L12_error))
        __pyx_t_6 = PyObject_Length(__pyx_v_array_); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1171, __pyx_L12_error)
        __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1171, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_expectedlen, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "bcolz/carray_ext.pyx":1170
 *         if expectedlen is None:
 *             # Try a guess
 *             try:             # <<<<<<<<<<<<<<
 *                 expectedlen = len(array_)
 *             except TypeError:
 */
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L19_try_end;
      __pyx_L12_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "bcolz/carray_ext.pyx":1172
 *             try:
 *                 expectedlen = len(array_)
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     "creating carrays from scalar objects is not supported")
 */
      __Pyx_TraceLine(1172,0,__PYX_ERR(0, 1172, __pyx_L14_except_error))
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_8) {
        __Pyx_AddTraceback("bcolz.carray_ext.carray._create_carray", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 1172, __pyx_L14_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_3);

        /* "bcolz/carray_ext.pyx":1173
 *                 expectedlen = len(array_)
 *             except TypeError:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "creating carrays from scalar objects is not supported")
 *         try:
 */
        __Pyx_TraceLine(1173,0,__PYX_ERR(0, 1173, __pyx_L14_except_error))
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1173, __pyx_L14_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(0, 1173, __pyx_L14_except_error)
      }
      goto __pyx_L14_except_error;
      __pyx_L14_except_error:;

      /* "bcolz/carray_ext.pyx":1170
 *         if expectedlen is None:
 *             # Try a guess
 *             try:             # <<<<<<<<<<<<<<
 *                 expectedlen = len(array_)
 *             except TypeError:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      goto __pyx_L1_error;
      __pyx_L19_try_end:;
    }

    /* "bcolz/carray_ext.pyx":1168
 * 
 *         # Compute the chunklen/chunksize
 *         if expectedlen is None:             # <<<<<<<<<<<<<<
 *             # Try a guess
 *             try:
 */
  }

  /* "bcolz/carray_ext.pyx":1175
 *                 raise NotImplementedError(
 *                     "creating carrays from scalar objects is not supported")
 *         try:             # <<<<<<<<<<<<<<
 *             self.expectedlen = expectedlen
 *         except OverflowError:
 */
  __Pyx_TraceLine(1175,0,__PYX_ERR(0, 1175, __pyx_L22_error))
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "bcolz/carray_ext.pyx":1176
 *                     "creating carrays from scalar objects is not supported")
 *         try:
 *             self.expectedlen = expectedlen             # <<<<<<<<<<<<<<
 *         except OverflowError:
 *             raise OverflowError(
 */
      __Pyx_TraceLine(1176,0,__PYX_ERR(0, 1176, __pyx_L22_error))
      __pyx_t_12 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_expectedlen); if (unlikely((__pyx_t_12 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1176, __pyx_L22_error)
      __pyx_v_self->expectedlen = __pyx_t_12;

      /* "bcolz/carray_ext.pyx":1175
 *                 raise NotImplementedError(
 *                     "creating carrays from scalar objects is not supported")
 *         try:             # <<<<<<<<<<<<<<
 *             self.expectedlen = expectedlen
 *         except OverflowError:
 */
    }
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L29_try_end;
    __pyx_L22_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1177
 *         try:
 *             self.expectedlen = expectedlen
 *         except OverflowError:             # <<<<<<<<<<<<<<
 *             raise OverflowError(
 *                 "The size cannot be larger than 2**31 on 32-bit platforms")
 */
    __Pyx_TraceLine(1177,0,__PYX_ERR(0, 1177, __pyx_L24_except_error))
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("bcolz.carray_ext.carray._create_carray", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 1177, __pyx_L24_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);

      /* "bcolz/carray_ext.pyx":1178
 *             self.expectedlen = expectedlen
 *         except OverflowError:
 *             raise OverflowError(             # <<<<<<<<<<<<<<
 *                 "The size cannot be larger than 2**31 on 32-bit platforms")
 *         if chunklen is None:
 */
      __Pyx_TraceLine(1178,0,__PYX_ERR(0, 1178, __pyx_L24_except_error))
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1178, __pyx_L24_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 1178, __pyx_L24_except_error)
    }
    goto __pyx_L24_except_error;
    __pyx_L24_except_error:;

    /* "bcolz/carray_ext.pyx":1175
 *                 raise NotImplementedError(
 *                     "creating carrays from scalar objects is not supported")
 *         try:             # <<<<<<<<<<<<<<
 *             self.expectedlen = expectedlen
 *         except OverflowError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L29_try_end:;
  }

  /* "bcolz/carray_ext.pyx":1180
 *             raise OverflowError(
 *                 "The size cannot be larger than 2**31 on 32-bit platforms")
 *         if chunklen is None:             # <<<<<<<<<<<<<<
 *             # Try a guess
 *             chunksize = utils.calc_chunksize(
 */
  __Pyx_TraceLine(1180,0,__PYX_ERR(0, 1180, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_chunklen == Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":1182
 *         if chunklen is None:
 *             # Try a guess
 *             chunksize = utils.calc_chunksize(             # <<<<<<<<<<<<<<
 *                 (expectedlen * atomsize) / float(_MB))
 *             # Chunksize must be a multiple of atomsize
 */
    __Pyx_TraceLine(1182,0,__PYX_ERR(0, 1182, __pyx_L1_error))
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_calc_chunksize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":1183
 *             # Try a guess
 *             chunksize = utils.calc_chunksize(
 *                 (expectedlen * atomsize) / float(_MB))             # <<<<<<<<<<<<<<
 *             # Chunksize must be a multiple of atomsize
 *             chunksize = cython.cdiv(chunksize, atomsize) * atomsize
 */
    __Pyx_TraceLine(1183,0,__PYX_ERR(0, 1183, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_atomsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Multiply(__pyx_v_expectedlen, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_MB); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_13 = __Pyx_PyNumber_Float(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_13) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_13); __pyx_t_13 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1182
 *         if chunklen is None:
 *             # Try a guess
 *             chunksize = utils.calc_chunksize(             # <<<<<<<<<<<<<<
 *                 (expectedlen * atomsize) / float(_MB))
 *             # Chunksize must be a multiple of atomsize
 */
    __Pyx_TraceLine(1182,0,__PYX_ERR(0, 1182, __pyx_L1_error))
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1182, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_chunksize = __pyx_t_8;

    /* "bcolz/carray_ext.pyx":1185
 *                 (expectedlen * atomsize) / float(_MB))
 *             # Chunksize must be a multiple of atomsize
 *             chunksize = cython.cdiv(chunksize, atomsize) * atomsize             # <<<<<<<<<<<<<<
 *             # Protection against large itemsizes
 *             if chunksize < atomsize:
 */
    __Pyx_TraceLine(1185,0,__PYX_ERR(0, 1185, __pyx_L1_error))
    __pyx_v_chunksize = ((__pyx_v_chunksize / __pyx_v_atomsize) * __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":1187
 *             chunksize = cython.cdiv(chunksize, atomsize) * atomsize
 *             # Protection against large itemsizes
 *             if chunksize < atomsize:             # <<<<<<<<<<<<<<
 *                 chunksize = atomsize
 *         else:
 */
    __Pyx_TraceLine(1187,0,__PYX_ERR(0, 1187, __pyx_L1_error))
    __pyx_t_1 = ((__pyx_v_chunksize < __pyx_v_atomsize) != 0);
    if (__pyx_t_1) {

      /* "bcolz/carray_ext.pyx":1188
 *             # Protection against large itemsizes
 *             if chunksize < atomsize:
 *                 chunksize = atomsize             # <<<<<<<<<<<<<<
 *         else:
 *             if not isinstance(chunklen, int) or chunklen < 1:
 */
      __Pyx_TraceLine(1188,0,__PYX_ERR(0, 1188, __pyx_L1_error))
      __pyx_v_chunksize = __pyx_v_atomsize;

      /* "bcolz/carray_ext.pyx":1187
 *             chunksize = cython.cdiv(chunksize, atomsize) * atomsize
 *             # Protection against large itemsizes
 *             if chunksize < atomsize:             # <<<<<<<<<<<<<<
 *                 chunksize = atomsize
 *         else:
 */
    }

    /* "bcolz/carray_ext.pyx":1180
 *             raise OverflowError(
 *                 "The size cannot be larger than 2**31 on 32-bit platforms")
 *         if chunklen is None:             # <<<<<<<<<<<<<<
 *             # Try a guess
 *             chunksize = utils.calc_chunksize(
 */
    goto __pyx_L32;
  }

  /* "bcolz/carray_ext.pyx":1190
 *                 chunksize = atomsize
 *         else:
 *             if not isinstance(chunklen, int) or chunklen < 1:             # <<<<<<<<<<<<<<
 *                 raise ValueError("chunklen must be a positive integer")
 *             chunksize = chunklen * atomsize
 */
  __Pyx_TraceLine(1190,0,__PYX_ERR(0, 1190, __pyx_L1_error))
  /*else*/ {
    __pyx_t_2 = PyInt_Check(__pyx_v_chunklen); 
    __pyx_t_14 = ((!(__pyx_t_2 != 0)) != 0);
    if (!__pyx_t_14) {
    } else {
      __pyx_t_1 = __pyx_t_14;
      goto __pyx_L35_bool_binop_done;
    }
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_chunklen, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1190, __pyx_L1_error)
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1190, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_1 = __pyx_t_14;
    __pyx_L35_bool_binop_done:;
    if (__pyx_t_1) {

      /* "bcolz/carray_ext.pyx":1191
 *         else:
 *             if not isinstance(chunklen, int) or chunklen < 1:
 *                 raise ValueError("chunklen must be a positive integer")             # <<<<<<<<<<<<<<
 *             chunksize = chunklen * atomsize
 *         chunklen = cython.cdiv(chunksize, atomsize)
 */
      __Pyx_TraceLine(1191,0,__PYX_ERR(0, 1191, __pyx_L1_error))
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1191, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_ERR(0, 1191, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1190
 *                 chunksize = atomsize
 *         else:
 *             if not isinstance(chunklen, int) or chunklen < 1:             # <<<<<<<<<<<<<<
 *                 raise ValueError("chunklen must be a positive integer")
 *             chunksize = chunklen * atomsize
 */
    }

    /* "bcolz/carray_ext.pyx":1192
 *             if not isinstance(chunklen, int) or chunklen < 1:
 *                 raise ValueError("chunklen must be a positive integer")
 *             chunksize = chunklen * atomsize             # <<<<<<<<<<<<<<
 *         chunklen = cython.cdiv(chunksize, atomsize)
 *         self._chunksize = chunksize
 */
    __Pyx_TraceLine(1192,0,__PYX_ERR(0, 1192, __pyx_L1_error))
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_atomsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyNumber_Multiply(__pyx_v_chunklen, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1192, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_chunksize = __pyx_t_8;
  }
  __pyx_L32:;

  /* "bcolz/carray_ext.pyx":1193
 *                 raise ValueError("chunklen must be a positive integer")
 *             chunksize = chunklen * atomsize
 *         chunklen = cython.cdiv(chunksize, atomsize)             # <<<<<<<<<<<<<<
 *         self._chunksize = chunksize
 *         self._chunklen = chunklen
 */
  __Pyx_TraceLine(1193,0,__PYX_ERR(0, 1193, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_chunksize / __pyx_v_atomsize)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_chunklen, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1194
 *             chunksize = chunklen * atomsize
 *         chunklen = cython.cdiv(chunksize, atomsize)
 *         self._chunksize = chunksize             # <<<<<<<<<<<<<<
 *         self._chunklen = chunklen
 * 
 */
  __Pyx_TraceLine(1194,0,__PYX_ERR(0, 1194, __pyx_L1_error))
  __pyx_v_self->_chunksize = __pyx_v_chunksize;

  /* "bcolz/carray_ext.pyx":1195
 *         chunklen = cython.cdiv(chunksize, atomsize)
 *         self._chunksize = chunksize
 *         self._chunklen = chunklen             # <<<<<<<<<<<<<<
 * 
 *         # Book memory for last chunk (uncompressed)
 */
  __Pyx_TraceLine(1195,0,__PYX_ERR(0, 1195, __pyx_L1_error))
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_chunklen); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error)
  __pyx_v_self->_chunklen = __pyx_t_8;

  /* "bcolz/carray_ext.pyx":1199
 *         # Book memory for last chunk (uncompressed)
 *         # Use np.zeros here because they compress better
 *         lastchunkarr = np.zeros(dtype=dtype, shape=(chunklen,))             # <<<<<<<<<<<<<<
 *         self.lastchunk = lastchunkarr.data
 *         self.lastchunkarr = lastchunkarr
 */
  __Pyx_TraceLine(1199,0,__PYX_ERR(0, 1199, __pyx_L1_error))
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 1199, __pyx_L1_error)
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_chunklen);
  __Pyx_GIVEREF(__pyx_v_chunklen);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chunklen);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1199, __pyx_L1_error)
  __pyx_v_lastchunkarr = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":1200
 *         # Use np.zeros here because they compress better
 *         lastchunkarr = np.zeros(dtype=dtype, shape=(chunklen,))
 *         self.lastchunk = lastchunkarr.data             # <<<<<<<<<<<<<<
 *         self.lastchunkarr = lastchunkarr
 * 
 */
  __Pyx_TraceLine(1200,0,__PYX_ERR(0, 1200, __pyx_L1_error))
  __pyx_t_15 = __pyx_v_lastchunkarr->data;
  __pyx_v_self->lastchunk = __pyx_t_15;

  /* "bcolz/carray_ext.pyx":1201
 *         lastchunkarr = np.zeros(dtype=dtype, shape=(chunklen,))
 *         self.lastchunk = lastchunkarr.data
 *         self.lastchunkarr = lastchunkarr             # <<<<<<<<<<<<<<
 * 
 *         # Create layout for data and metadata
 */
  __Pyx_TraceLine(1201,0,__PYX_ERR(0, 1201, __pyx_L1_error))
  __Pyx_INCREF(((PyObject *)__pyx_v_lastchunkarr));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lastchunkarr));
  __Pyx_GOTREF(__pyx_v_self->lastchunkarr);
  __Pyx_DECREF(__pyx_v_self->lastchunkarr);
  __pyx_v_self->lastchunkarr = ((PyObject *)__pyx_v_lastchunkarr);

  /* "bcolz/carray_ext.pyx":1204
 * 
 *         # Create layout for data and metadata
 *         self._cparams = cparams             # <<<<<<<<<<<<<<
 *         self.chunks = []
 *         """The chunks container"""
 */
  __Pyx_TraceLine(1204,0,__PYX_ERR(0, 1204, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_cparams);
  __Pyx_GIVEREF(__pyx_v_cparams);
  __Pyx_GOTREF(__pyx_v_self->_cparams);
  __Pyx_DECREF(__pyx_v_self->_cparams);
  __pyx_v_self->_cparams = __pyx_v_cparams;

  /* "bcolz/carray_ext.pyx":1205
 *         # Create layout for data and metadata
 *         self._cparams = cparams
 *         self.chunks = []             # <<<<<<<<<<<<<<
 *         """The chunks container"""
 *         if rootdir is not None:
 */
  __Pyx_TraceLine(1205,0,__PYX_ERR(0, 1205, __pyx_L1_error))
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->chunks);
  __Pyx_DECREF(__pyx_v_self->chunks);
  __pyx_v_self->chunks = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":1207
 *         self.chunks = []
 *         """The chunks container"""
 *         if rootdir is not None:             # <<<<<<<<<<<<<<
 *             self._mkdirs(rootdir, mode)
 *             metainfo = (
 */
  __Pyx_TraceLine(1207,0,__PYX_ERR(0, 1207, __pyx_L1_error))
  __pyx_t_1 = (__pyx_v_rootdir != Py_None);
  __pyx_t_14 = (__pyx_t_1 != 0);
  if (__pyx_t_14) {

    /* "bcolz/carray_ext.pyx":1208
 *         """The chunks container"""
 *         if rootdir is not None:
 *             self._mkdirs(rootdir, mode)             # <<<<<<<<<<<<<<
 *             metainfo = (
 *             dtype, cparams, self.shape[0], lastchunkarr, self._mode)
 */
    __Pyx_TraceLine(1208,0,__PYX_ERR(0, 1208, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mkdirs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(__pyx_v_rootdir);
    __Pyx_GIVEREF(__pyx_v_rootdir);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_rootdir);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_mode);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1210
 *             self._mkdirs(rootdir, mode)
 *             metainfo = (
 *             dtype, cparams, self.shape[0], lastchunkarr, self._mode)             # <<<<<<<<<<<<<<
 *             self.chunks = chunks(self._rootdir, metainfo=metainfo, _new=True)
 *             # We can write the metainfo already
 */
    __Pyx_TraceLine(1210,0,__PYX_ERR(0, 1210, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_dtype);
    __Pyx_GIVEREF(__pyx_v_dtype);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dtype);
    __Pyx_INCREF(__pyx_v_cparams);
    __Pyx_GIVEREF(__pyx_v_cparams);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_cparams);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_lastchunkarr));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_lastchunkarr));
    PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_lastchunkarr));
    __Pyx_INCREF(__pyx_v_self->_mode);
    __Pyx_GIVEREF(__pyx_v_self->_mode);
    PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_self->_mode);
    __pyx_t_3 = 0;
    __pyx_v_metainfo = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1211
 *             metainfo = (
 *             dtype, cparams, self.shape[0], lastchunkarr, self._mode)
 *             self.chunks = chunks(self._rootdir, metainfo=metainfo, _new=True)             # <<<<<<<<<<<<<<
 *             # We can write the metainfo already
 *             self._write_meta()
 */
    __Pyx_TraceLine(1211,0,__PYX_ERR(0, 1211, __pyx_L1_error))
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->_rootdir);
    __Pyx_GIVEREF(__pyx_v_self->_rootdir);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_rootdir);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_metainfo, __pyx_v_metainfo) < 0) __PYX_ERR(0, 1211, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new, Py_True) < 0) __PYX_ERR(0, 1211, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunks), __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->chunks);
    __Pyx_DECREF(__pyx_v_self->chunks);
    __pyx_v_self->chunks = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":1213
 *             self.chunks = chunks(self._rootdir, metainfo=metainfo, _new=True)
 *             # We can write the metainfo already
 *             self._write_meta()             # <<<<<<<<<<<<<<
 * 
 *         # Finally, fill the chunks
 */
    __Pyx_TraceLine(1213,0,__PYX_ERR(0, 1213, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_meta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":1207
 *         self.chunks = []
 *         """The chunks container"""
 *         if rootdir is not None:             # <<<<<<<<<<<<<<
 *             self._mkdirs(rootdir, mode)
 *             metainfo = (
 */
  }

  /* "bcolz/carray_ext.pyx":1217
 *         # Finally, fill the chunks
 *         # Object dtype requires special storage
 *         if array_.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *             for obj in array_:
 *                 self._store_obj(obj)
 */
  __Pyx_TraceLine(1217,0,__PYX_ERR(0, 1217, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_array_, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_char); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_14) {

    /* "bcolz/carray_ext.pyx":1218
 *         # Object dtype requires special storage
 *         if array_.dtype.char == 'O':
 *             for obj in array_:             # <<<<<<<<<<<<<<
 *                 self._store_obj(obj)
 *         else:
 */
    __Pyx_TraceLine(1218,0,__PYX_ERR(0, 1218, __pyx_L1_error))
    if (likely(PyList_CheckExact(__pyx_v_array_)) || PyTuple_CheckExact(__pyx_v_array_)) {
      __pyx_t_3 = __pyx_v_array_; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_16 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_array_); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_16 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1218, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_16)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1218, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1218, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_16(__pyx_t_3);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1218, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "bcolz/carray_ext.pyx":1219
 *         if array_.dtype.char == 'O':
 *             for obj in array_:
 *                 self._store_obj(obj)             # <<<<<<<<<<<<<<
 *         else:
 *             self._fill_chunks(array_)
 */
      __Pyx_TraceLine(1219,0,__PYX_ERR(0, 1219, __pyx_L1_error))
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_store_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_obj);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "bcolz/carray_ext.pyx":1218
 *         # Object dtype requires special storage
 *         if array_.dtype.char == 'O':
 *             for obj in array_:             # <<<<<<<<<<<<<<
 *                 self._store_obj(obj)
 *         else:
 */
      __Pyx_TraceLine(1218,0,__PYX_ERR(0, 1218, __pyx_L1_error))
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1217
 *         # Finally, fill the chunks
 *         # Object dtype requires special storage
 *         if array_.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *             for obj in array_:
 *                 self._store_obj(obj)
 */
    goto __pyx_L38;
  }

  /* "bcolz/carray_ext.pyx":1221
 *                 self._store_obj(obj)
 *         else:
 *             self._fill_chunks(array_)             # <<<<<<<<<<<<<<
 * 
 *         # and flush the data pending...
 */
  __Pyx_TraceLine(1221,0,__PYX_ERR(0, 1221, __pyx_L1_error))
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fill_chunks); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_array_); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_array_);
      __Pyx_GIVEREF(__pyx_v_array_);
      PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_array_);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L38:;

  /* "bcolz/carray_ext.pyx":1224
 * 
 *         # and flush the data pending...
 *         self.flush()             # <<<<<<<<<<<<<<
 * 
 *     def _open_carray(self, shape, cparams, dtype, dflt,
 */
  __Pyx_TraceLine(1224,0,__PYX_ERR(0, 1224, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flush); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_13) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1098
 *         return dtype_
 * 
 *     def _create_carray(self, array, cparams, dtype, dflt,             # <<<<<<<<<<<<<<
 *                       expectedlen, chunklen, rootdir, mode):
 *         """Create a new array.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._create_carray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lastchunkarr);
  __Pyx_XDECREF(__pyx_v_array_);
  __Pyx_XDECREF(__pyx_v__dflt);
  __Pyx_XDECREF(__pyx_v_metainfo);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_array);
  __Pyx_XDECREF(__pyx_v_cparams);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XDECREF(__pyx_v_expectedlen);
  __Pyx_XDECREF(__pyx_v_chunklen);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1226
 *         self.flush()
 * 
 *     def _open_carray(self, shape, cparams, dtype, dflt,             # <<<<<<<<<<<<<<
 *                     expectedlen, cbytes, chunklen, xchunks=None):
 *         """Open an existing array."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_5_open_carray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_4_open_carray[] = "carray._open_carray(self, shape, cparams, dtype, dflt, expectedlen, cbytes, chunklen, xchunks=None)\nOpen an existing array.";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_5_open_carray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_shape = 0;
  PyObject *__pyx_v_cparams = 0;
  PyObject *__pyx_v_dtype = 0;
  PyObject *__pyx_v_dflt = 0;
  PyObject *__pyx_v_expectedlen = 0;
  PyObject *__pyx_v_cbytes = 0;
  PyObject *__pyx_v_chunklen = 0;
  PyObject *__pyx_v_xchunks = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open_carray (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_cparams,&__pyx_n_s_dtype,&__pyx_n_s_dflt,&__pyx_n_s_expectedlen,&__pyx_n_s_cbytes,&__pyx_n_s_chunklen,&__pyx_n_s_xchunks,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};

    /* "bcolz/carray_ext.pyx":1227
 * 
 *     def _open_carray(self, shape, cparams, dtype, dflt,
 *                     expectedlen, cbytes, chunklen, xchunks=None):             # <<<<<<<<<<<<<<
 *         """Open an existing array."""
 *         cdef ndarray lastchunkarr
 */
    values[7] = ((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  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        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 (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cparams)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_open_carray", 0, 7, 8, 1); __PYX_ERR(0, 1226, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_open_carray", 0, 7, 8, 2); __PYX_ERR(0, 1226, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dflt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_open_carray", 0, 7, 8, 3); __PYX_ERR(0, 1226, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_expectedlen)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_open_carray", 0, 7, 8, 4); __PYX_ERR(0, 1226, __pyx_L3_error)
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cbytes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_open_carray", 0, 7, 8, 5); __PYX_ERR(0, 1226, __pyx_L3_error)
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunklen)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_open_carray", 0, 7, 8, 6); __PYX_ERR(0, 1226, __pyx_L3_error)
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xchunks);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open_carray") < 0)) __PYX_ERR(0, 1226, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_shape = values[0];
    __pyx_v_cparams = values[1];
    __pyx_v_dtype = values[2];
    __pyx_v_dflt = values[3];
    __pyx_v_expectedlen = values[4];
    __pyx_v_cbytes = values[5];
    __pyx_v_chunklen = values[6];
    __pyx_v_xchunks = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_open_carray", 0, 7, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1226, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray._open_carray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_4_open_carray(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_shape, __pyx_v_cparams, __pyx_v_dtype, __pyx_v_dflt, __pyx_v_expectedlen, __pyx_v_cbytes, __pyx_v_chunklen, __pyx_v_xchunks);

  /* "bcolz/carray_ext.pyx":1226
 *         self.flush()
 * 
 *     def _open_carray(self, shape, cparams, dtype, dflt,             # <<<<<<<<<<<<<<
 *                     expectedlen, cbytes, chunklen, xchunks=None):
 *         """Open an existing array."""
 */

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_4_open_carray(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_cparams, PyObject *__pyx_v_dtype, PyObject *__pyx_v_dflt, PyObject *__pyx_v_expectedlen, PyObject *__pyx_v_cbytes, PyObject *__pyx_v_chunklen, PyObject *__pyx_v_xchunks) {
  PyArrayObject *__pyx_v_lastchunkarr = 0;
  npy_intp __pyx_v_calen;
  PyObject *__pyx_v_metainfo = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  npy_intp __pyx_t_7;
  char *__pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  __Pyx_RefNannySetupContext("_open_carray", 0);
  __Pyx_TraceCall("_open_carray", __pyx_f[0], 1226, 0, __PYX_ERR(0, 1226, __pyx_L1_error));
  __Pyx_INCREF(__pyx_v_dtype);

  /* "bcolz/carray_ext.pyx":1233
 *         cdef npy_intp calen
 * 
 *         if len(shape) == 1:             # <<<<<<<<<<<<<<
 *             self._dtype = dtype
 *         else:
 */
  __Pyx_TraceLine(1233,0,__PYX_ERR(0, 1233, __pyx_L1_error))
  __pyx_t_1 = PyObject_Length(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1233, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 == 1) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1234
 * 
 *         if len(shape) == 1:
 *             self._dtype = dtype             # <<<<<<<<<<<<<<
 *         else:
 *             # Multidimensional array.  The atom will have array_.shape[1:]
 */
    __Pyx_TraceLine(1234,0,__PYX_ERR(0, 1234, __pyx_L1_error))
    __Pyx_INCREF(__pyx_v_dtype);
    __Pyx_GIVEREF(__pyx_v_dtype);
    __Pyx_GOTREF(__pyx_v_self->_dtype);
    __Pyx_DECREF(__pyx_v_self->_dtype);
    __pyx_v_self->_dtype = __pyx_v_dtype;

    /* "bcolz/carray_ext.pyx":1233
 *         cdef npy_intp calen
 * 
 *         if len(shape) == 1:             # <<<<<<<<<<<<<<
 *             self._dtype = dtype
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":1243
 *             # from `self.shape`.  `self.dtype` will always be scalar (NumPy
 *             # convention).
 *             self._dtype = dtype = np.dtype((dtype.base, shape[1:]))             # <<<<<<<<<<<<<<
 * 
 *         self._cparams = cparams
 */
  __Pyx_TraceLine(1243,0,__PYX_ERR(0, 1243, __pyx_L1_error))
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_shape, 1, 0, NULL, NULL, &__pyx_slice__39, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->_dtype);
    __Pyx_DECREF(__pyx_v_self->_dtype);
    __pyx_v_self->_dtype = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":1245
 *             self._dtype = dtype = np.dtype((dtype.base, shape[1:]))
 * 
 *         self._cparams = cparams             # <<<<<<<<<<<<<<
 *         self.atomsize = dtype.itemsize
 *         self.itemsize = dtype.base.itemsize
 */
  __Pyx_TraceLine(1245,0,__PYX_ERR(0, 1245, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_cparams);
  __Pyx_GIVEREF(__pyx_v_cparams);
  __Pyx_GOTREF(__pyx_v_self->_cparams);
  __Pyx_DECREF(__pyx_v_self->_cparams);
  __pyx_v_self->_cparams = __pyx_v_cparams;

  /* "bcolz/carray_ext.pyx":1246
 * 
 *         self._cparams = cparams
 *         self.atomsize = dtype.itemsize             # <<<<<<<<<<<<<<
 *         self.itemsize = dtype.base.itemsize
 *         self._chunklen = chunklen
 */
  __Pyx_TraceLine(1246,0,__PYX_ERR(0, 1246, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_self->atomsize = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":1247
 *         self._cparams = cparams
 *         self.atomsize = dtype.itemsize
 *         self.itemsize = dtype.base.itemsize             # <<<<<<<<<<<<<<
 *         self._chunklen = chunklen
 *         self._chunksize = chunklen * self.atomsize
 */
  __Pyx_TraceLine(1247,0,__PYX_ERR(0, 1247, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->itemsize = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":1248
 *         self.atomsize = dtype.itemsize
 *         self.itemsize = dtype.base.itemsize
 *         self._chunklen = chunklen             # <<<<<<<<<<<<<<
 *         self._chunksize = chunklen * self.atomsize
 *         self._dflt = dflt
 */
  __Pyx_TraceLine(1248,0,__PYX_ERR(0, 1248, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_chunklen); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1248, __pyx_L1_error)
  __pyx_v_self->_chunklen = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":1249
 *         self.itemsize = dtype.base.itemsize
 *         self._chunklen = chunklen
 *         self._chunksize = chunklen * self.atomsize             # <<<<<<<<<<<<<<
 *         self._dflt = dflt
 *         self.expectedlen = expectedlen
 */
  __Pyx_TraceLine(1249,0,__PYX_ERR(0, 1249, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->atomsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Multiply(__pyx_v_chunklen, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_self->_chunksize = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":1250
 *         self._chunklen = chunklen
 *         self._chunksize = chunklen * self.atomsize
 *         self._dflt = dflt             # <<<<<<<<<<<<<<
 *         self.expectedlen = expectedlen
 * 
 */
  __Pyx_TraceLine(1250,0,__PYX_ERR(0, 1250, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_dflt);
  __Pyx_GIVEREF(__pyx_v_dflt);
  __Pyx_GOTREF(__pyx_v_self->_dflt);
  __Pyx_DECREF(__pyx_v_self->_dflt);
  __pyx_v_self->_dflt = __pyx_v_dflt;

  /* "bcolz/carray_ext.pyx":1251
 *         self._chunksize = chunklen * self.atomsize
 *         self._dflt = dflt
 *         self.expectedlen = expectedlen             # <<<<<<<<<<<<<<
 * 
 *         # Book memory for last chunk (uncompressed)
 */
  __Pyx_TraceLine(1251,0,__PYX_ERR(0, 1251, __pyx_L1_error))
  __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_expectedlen); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1251, __pyx_L1_error)
  __pyx_v_self->expectedlen = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1255
 *         # Book memory for last chunk (uncompressed)
 *         # Use np.zeros here because they compress better
 *         lastchunkarr = np.zeros(dtype=dtype, shape=(chunklen,))             # <<<<<<<<<<<<<<
 *         self.lastchunk = lastchunkarr.data
 *         self.lastchunkarr = lastchunkarr
 */
  __Pyx_TraceLine(1255,0,__PYX_ERR(0, 1255, __pyx_L1_error))
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 1255, __pyx_L1_error)
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_chunklen);
  __Pyx_GIVEREF(__pyx_v_chunklen);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_chunklen);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 1255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __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;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1255, __pyx_L1_error)
  __pyx_v_lastchunkarr = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1256
 *         # Use np.zeros here because they compress better
 *         lastchunkarr = np.zeros(dtype=dtype, shape=(chunklen,))
 *         self.lastchunk = lastchunkarr.data             # <<<<<<<<<<<<<<
 *         self.lastchunkarr = lastchunkarr
 * 
 */
  __Pyx_TraceLine(1256,0,__PYX_ERR(0, 1256, __pyx_L1_error))
  __pyx_t_8 = __pyx_v_lastchunkarr->data;
  __pyx_v_self->lastchunk = __pyx_t_8;

  /* "bcolz/carray_ext.pyx":1257
 *         lastchunkarr = np.zeros(dtype=dtype, shape=(chunklen,))
 *         self.lastchunk = lastchunkarr.data
 *         self.lastchunkarr = lastchunkarr             # <<<<<<<<<<<<<<
 * 
 *         if xchunks is None:
 */
  __Pyx_TraceLine(1257,0,__PYX_ERR(0, 1257, __pyx_L1_error))
  __Pyx_INCREF(((PyObject *)__pyx_v_lastchunkarr));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_lastchunkarr));
  __Pyx_GOTREF(__pyx_v_self->lastchunkarr);
  __Pyx_DECREF(__pyx_v_self->lastchunkarr);
  __pyx_v_self->lastchunkarr = ((PyObject *)__pyx_v_lastchunkarr);

  /* "bcolz/carray_ext.pyx":1259
 *         self.lastchunkarr = lastchunkarr
 * 
 *         if xchunks is None:             # <<<<<<<<<<<<<<
 *             # No chunks container, so read meta info from disk
 *             # Check rootdir hierarchy
 */
  __Pyx_TraceLine(1259,0,__PYX_ERR(0, 1259, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_xchunks == Py_None);
  __pyx_t_9 = (__pyx_t_2 != 0);
  if (__pyx_t_9) {

    /* "bcolz/carray_ext.pyx":1262
 *             # No chunks container, so read meta info from disk
 *             # Check rootdir hierarchy
 *             if not os.path.isdir(self._rootdir):             # <<<<<<<<<<<<<<
 *                 raise IOError("root directory does not exist")
 *             self.datadir = os.path.join(self._rootdir, DATA_DIR)
 */
    __Pyx_TraceLine(1262,0,__PYX_ERR(0, 1262, __pyx_L1_error))
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isdir); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->_rootdir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_self->_rootdir);
      __Pyx_GIVEREF(__pyx_v_self->_rootdir);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_self->_rootdir);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = ((!__pyx_t_9) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1263
 *             # Check rootdir hierarchy
 *             if not os.path.isdir(self._rootdir):
 *                 raise IOError("root directory does not exist")             # <<<<<<<<<<<<<<
 *             self.datadir = os.path.join(self._rootdir, DATA_DIR)
 *             if not os.path.isdir(self.datadir):
 */
      __Pyx_TraceLine(1263,0,__PYX_ERR(0, 1263, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1263, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1262
 *             # No chunks container, so read meta info from disk
 *             # Check rootdir hierarchy
 *             if not os.path.isdir(self._rootdir):             # <<<<<<<<<<<<<<
 *                 raise IOError("root directory does not exist")
 *             self.datadir = os.path.join(self._rootdir, DATA_DIR)
 */
    }

    /* "bcolz/carray_ext.pyx":1264
 *             if not os.path.isdir(self._rootdir):
 *                 raise IOError("root directory does not exist")
 *             self.datadir = os.path.join(self._rootdir, DATA_DIR)             # <<<<<<<<<<<<<<
 *             if not os.path.isdir(self.datadir):
 *                 raise IOError("data directory does not exist")
 */
    __Pyx_TraceLine(1264,0,__PYX_ERR(0, 1264, __pyx_L1_error))
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_join); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_DATA_DIR); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_1 = 1;
      }
    }
    __pyx_t_11 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self->_rootdir);
    __Pyx_GIVEREF(__pyx_v_self->_rootdir);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_1, __pyx_v_self->_rootdir);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_1, __pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->datadir);
    __Pyx_DECREF(__pyx_v_self->datadir);
    __pyx_v_self->datadir = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1265
 *                 raise IOError("root directory does not exist")
 *             self.datadir = os.path.join(self._rootdir, DATA_DIR)
 *             if not os.path.isdir(self.datadir):             # <<<<<<<<<<<<<<
 *                 raise IOError("data directory does not exist")
 *             self.metadir = os.path.join(self._rootdir, META_DIR)
 */
    __Pyx_TraceLine(1265,0,__PYX_ERR(0, 1265, __pyx_L1_error))
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_isdir); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_11) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->datadir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
      __Pyx_INCREF(__pyx_v_self->datadir);
      __Pyx_GIVEREF(__pyx_v_self->datadir);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_self->datadir);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1265, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = ((!__pyx_t_2) != 0);
    if (__pyx_t_9) {

      /* "bcolz/carray_ext.pyx":1266
 *             self.datadir = os.path.join(self._rootdir, DATA_DIR)
 *             if not os.path.isdir(self.datadir):
 *                 raise IOError("data directory does not exist")             # <<<<<<<<<<<<<<
 *             self.metadir = os.path.join(self._rootdir, META_DIR)
 *             if not os.path.isdir(self.metadir):
 */
      __Pyx_TraceLine(1266,0,__PYX_ERR(0, 1266, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1266, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1265
 *                 raise IOError("root directory does not exist")
 *             self.datadir = os.path.join(self._rootdir, DATA_DIR)
 *             if not os.path.isdir(self.datadir):             # <<<<<<<<<<<<<<
 *                 raise IOError("data directory does not exist")
 *             self.metadir = os.path.join(self._rootdir, META_DIR)
 */
    }

    /* "bcolz/carray_ext.pyx":1267
 *             if not os.path.isdir(self.datadir):
 *                 raise IOError("data directory does not exist")
 *             self.metadir = os.path.join(self._rootdir, META_DIR)             # <<<<<<<<<<<<<<
 *             if not os.path.isdir(self.metadir):
 *                 raise IOError("meta directory does not exist")
 */
    __Pyx_TraceLine(1267,0,__PYX_ERR(0, 1267, __pyx_L1_error))
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_join); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_META_DIR); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_1 = 1;
      }
    }
    __pyx_t_4 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_11) {
      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __pyx_t_11 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self->_rootdir);
    __Pyx_GIVEREF(__pyx_v_self->_rootdir);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_1, __pyx_v_self->_rootdir);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_1, __pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1267, __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_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->metadir);
    __Pyx_DECREF(__pyx_v_self->metadir);
    __pyx_v_self->metadir = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1268
 *                 raise IOError("data directory does not exist")
 *             self.metadir = os.path.join(self._rootdir, META_DIR)
 *             if not os.path.isdir(self.metadir):             # <<<<<<<<<<<<<<
 *                 raise IOError("meta directory does not exist")
 * 
 */
    __Pyx_TraceLine(1268,0,__PYX_ERR(0, 1268, __pyx_L1_error))
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isdir); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->metadir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_self->metadir);
      __Pyx_GIVEREF(__pyx_v_self->metadir);
      PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_self->metadir);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1268, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = ((!__pyx_t_9) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1269
 *             self.metadir = os.path.join(self._rootdir, META_DIR)
 *             if not os.path.isdir(self.metadir):
 *                 raise IOError("meta directory does not exist")             # <<<<<<<<<<<<<<
 * 
 *             # Finally, open data directory
 */
      __Pyx_TraceLine(1269,0,__PYX_ERR(0, 1269, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1269, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1268
 *                 raise IOError("data directory does not exist")
 *             self.metadir = os.path.join(self._rootdir, META_DIR)
 *             if not os.path.isdir(self.metadir):             # <<<<<<<<<<<<<<
 *                 raise IOError("meta directory does not exist")
 * 
 */
    }

    /* "bcolz/carray_ext.pyx":1272
 * 
 *             # Finally, open data directory
 *             metainfo = (dtype, cparams, shape[0], lastchunkarr, self._mode)             # <<<<<<<<<<<<<<
 *             self.chunks = chunks(self._rootdir, metainfo=metainfo, _new=False)
 *         else:
 */
    __Pyx_TraceLine(1272,0,__PYX_ERR(0, 1272, __pyx_L1_error))
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_dtype);
    __Pyx_GIVEREF(__pyx_v_dtype);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dtype);
    __Pyx_INCREF(__pyx_v_cparams);
    __Pyx_GIVEREF(__pyx_v_cparams);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_cparams);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_lastchunkarr));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_lastchunkarr));
    PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_lastchunkarr));
    __Pyx_INCREF(__pyx_v_self->_mode);
    __Pyx_GIVEREF(__pyx_v_self->_mode);
    PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_self->_mode);
    __pyx_t_3 = 0;
    __pyx_v_metainfo = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1273
 *             # Finally, open data directory
 *             metainfo = (dtype, cparams, shape[0], lastchunkarr, self._mode)
 *             self.chunks = chunks(self._rootdir, metainfo=metainfo, _new=False)             # <<<<<<<<<<<<<<
 *         else:
 *             self.chunks, lastchunkarr[:] = xchunks
 */
    __Pyx_TraceLine(1273,0,__PYX_ERR(0, 1273, __pyx_L1_error))
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->_rootdir);
    __Pyx_GIVEREF(__pyx_v_self->_rootdir);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_rootdir);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_metainfo, __pyx_v_metainfo) < 0) __PYX_ERR(0, 1273, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new, Py_False) < 0) __PYX_ERR(0, 1273, __pyx_L1_error)
    __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunks), __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GIVEREF(__pyx_t_10);
    __Pyx_GOTREF(__pyx_v_self->chunks);
    __Pyx_DECREF(__pyx_v_self->chunks);
    __pyx_v_self->chunks = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "bcolz/carray_ext.pyx":1259
 *         self.lastchunkarr = lastchunkarr
 * 
 *         if xchunks is None:             # <<<<<<<<<<<<<<
 *             # No chunks container, so read meta info from disk
 *             # Check rootdir hierarchy
 */
    goto __pyx_L4;
  }

  /* "bcolz/carray_ext.pyx":1275
 *             self.chunks = chunks(self._rootdir, metainfo=metainfo, _new=False)
 *         else:
 *             self.chunks, lastchunkarr[:] = xchunks             # <<<<<<<<<<<<<<
 * 
 *         # Update some counters
 */
  __Pyx_TraceLine(1275,0,__PYX_ERR(0, 1275, __pyx_L1_error))
  /*else*/ {
    if ((likely(PyTuple_CheckExact(__pyx_v_xchunks))) || (PyList_CheckExact(__pyx_v_xchunks))) {
      PyObject* sequence = __pyx_v_xchunks;
      #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_ERR(0, 1275, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_v_xchunks); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_5); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_5), 2) < 0) __PYX_ERR(0, 1275, __pyx_L1_error)
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_unpacking_done;
      __pyx_L8_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1275, __pyx_L1_error)
      __pyx_L9_unpacking_done:;
    }
    __Pyx_GIVEREF(__pyx_t_10);
    __Pyx_GOTREF(__pyx_v_self->chunks);
    __Pyx_DECREF(__pyx_v_self->chunks);
    __pyx_v_self->chunks = __pyx_t_10;
    __pyx_t_10 = 0;
    if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_lastchunkarr), __pyx_t_3, 0, 0, NULL, NULL, &__pyx_slice__43, 0, 0, 1) < 0) __PYX_ERR(0, 1275, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "bcolz/carray_ext.pyx":1278
 * 
 *         # Update some counters
 *         calen = shape[0]  # the length ot the carray             # <<<<<<<<<<<<<<
 *         self.leftover = cython.cmod(calen, chunklen) * self.atomsize
 *         self._cbytes = cbytes
 */
  __Pyx_TraceLine(1278,0,__PYX_ERR(0, 1278, __pyx_L1_error))
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_calen = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1279
 *         # Update some counters
 *         calen = shape[0]  # the length ot the carray
 *         self.leftover = cython.cmod(calen, chunklen) * self.atomsize             # <<<<<<<<<<<<<<
 *         self._cbytes = cbytes
 *         self._nbytes = calen * self.atomsize
 */
  __Pyx_TraceLine(1279,0,__PYX_ERR(0, 1279, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_calen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = PyNumber_Remainder(__pyx_t_3, __pyx_v_chunklen); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->atomsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_self->leftover = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":1280
 *         calen = shape[0]  # the length ot the carray
 *         self.leftover = cython.cmod(calen, chunklen) * self.atomsize
 *         self._cbytes = cbytes             # <<<<<<<<<<<<<<
 *         self._nbytes = calen * self.atomsize
 * 
 */
  __Pyx_TraceLine(1280,0,__PYX_ERR(0, 1280, __pyx_L1_error))
  __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_cbytes); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1280, __pyx_L1_error)
  __pyx_v_self->_cbytes = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1281
 *         self.leftover = cython.cmod(calen, chunklen) * self.atomsize
 *         self._cbytes = cbytes
 *         self._nbytes = calen * self.atomsize             # <<<<<<<<<<<<<<
 * 
 *         if self._mode == "w":
 */
  __Pyx_TraceLine(1281,0,__PYX_ERR(0, 1281, __pyx_L1_error))
  __pyx_v_self->_nbytes = (__pyx_v_calen * __pyx_v_self->atomsize);

  /* "bcolz/carray_ext.pyx":1283
 *         self._nbytes = calen * self.atomsize
 * 
 *         if self._mode == "w":             # <<<<<<<<<<<<<<
 *             # Remove all entries when mode is 'w'
 *             self.resize(0)
 */
  __Pyx_TraceLine(1283,0,__PYX_ERR(0, 1283, __pyx_L1_error))
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1283, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1285
 *         if self._mode == "w":
 *             # Remove all entries when mode is 'w'
 *             self.resize(0)             # <<<<<<<<<<<<<<
 * 
 *     def _fill_chunks(self, object array_):
 */
    __Pyx_TraceLine(1285,0,__PYX_ERR(0, 1285, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1283
 *         self._nbytes = calen * self.atomsize
 * 
 *         if self._mode == "w":             # <<<<<<<<<<<<<<
 *             # Remove all entries when mode is 'w'
 *             self.resize(0)
 */
  }

  /* "bcolz/carray_ext.pyx":1226
 *         self.flush()
 * 
 *     def _open_carray(self, shape, cparams, dtype, dflt,             # <<<<<<<<<<<<<<
 *                     expectedlen, cbytes, chunklen, xchunks=None):
 *         """Open an existing array."""
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._open_carray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_lastchunkarr);
  __Pyx_XDECREF(__pyx_v_metainfo);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1287
 *             self.resize(0)
 * 
 *     def _fill_chunks(self, object array_):             # <<<<<<<<<<<<<<
 *         """Fill chunks, either in-memory or on-disk."""
 *         cdef int leftover, chunklen
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_7_fill_chunks(PyObject *__pyx_v_self, PyObject *__pyx_v_array_); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_6_fill_chunks[] = "carray._fill_chunks(self, array_)\nFill chunks, either in-memory or on-disk.";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_7_fill_chunks(PyObject *__pyx_v_self, PyObject *__pyx_v_array_) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_fill_chunks (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_6_fill_chunks(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_array_));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_6_fill_chunks(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_array_) {
  int __pyx_v_leftover;
  int __pyx_v_chunklen;
  npy_intp __pyx_v_i;
  npy_intp __pyx_v_nchunks;
  npy_intp __pyx_v_nbytes;
  npy_intp __pyx_v_cbytes;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = 0;
  PyArrayObject *__pyx_v_remainder = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("_fill_chunks", 0);
  __Pyx_TraceCall("_fill_chunks", __pyx_f[0], 1287, 0, __PYX_ERR(0, 1287, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1296
 * 
 *         # The number of bytes in incoming array
 *         nbytes = self.itemsize * array_.size             # <<<<<<<<<<<<<<
 *         self._nbytes = nbytes
 * 
 */
  __Pyx_TraceLine(1296,0,__PYX_ERR(0, 1296, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_array_, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_nbytes = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":1297
 *         # The number of bytes in incoming array
 *         nbytes = self.itemsize * array_.size
 *         self._nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         # Compress data in chunks
 */
  __Pyx_TraceLine(1297,0,__PYX_ERR(0, 1297, __pyx_L1_error))
  __pyx_v_self->_nbytes = __pyx_v_nbytes;

  /* "bcolz/carray_ext.pyx":1300
 * 
 *         # Compress data in chunks
 *         cbytes = 0             # <<<<<<<<<<<<<<
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(nbytes, self._chunksize)
 */
  __Pyx_TraceLine(1300,0,__PYX_ERR(0, 1300, __pyx_L1_error))
  __pyx_v_cbytes = 0;

  /* "bcolz/carray_ext.pyx":1301
 *         # Compress data in chunks
 *         cbytes = 0
 *         chunklen = self._chunklen             # <<<<<<<<<<<<<<
 *         nchunks = <npy_intp> cython.cdiv(nbytes, self._chunksize)
 *         for i from 0 <= i < nchunks:
 */
  __Pyx_TraceLine(1301,0,__PYX_ERR(0, 1301, __pyx_L1_error))
  __pyx_t_5 = __pyx_v_self->_chunklen;
  __pyx_v_chunklen = __pyx_t_5;

  /* "bcolz/carray_ext.pyx":1302
 *         cbytes = 0
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nchunks:
 *             assert i * chunklen < array_.size, "i, nchunks: %d, %d" % (
 */
  __Pyx_TraceLine(1302,0,__PYX_ERR(0, 1302, __pyx_L1_error))
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":1303
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(nbytes, self._chunksize)
 *         for i from 0 <= i < nchunks:             # <<<<<<<<<<<<<<
 *             assert i * chunklen < array_.size, "i, nchunks: %d, %d" % (
 *             i, nchunks)
 */
  __Pyx_TraceLine(1303,0,__PYX_ERR(0, 1303, __pyx_L1_error))
  __pyx_t_4 = __pyx_v_nchunks;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "bcolz/carray_ext.pyx":1304
 *         nchunks = <npy_intp> cython.cdiv(nbytes, self._chunksize)
 *         for i from 0 <= i < nchunks:
 *             assert i * chunklen < array_.size, "i, nchunks: %d, %d" % (             # <<<<<<<<<<<<<<
 *             i, nchunks)
 *             chunk_ = chunk(array_[i * chunklen:(i + 1) * chunklen],
 */
    __Pyx_TraceLine(1304,0,__PYX_ERR(0, 1304, __pyx_L1_error))
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_i * __pyx_v_chunklen)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_array_, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1304, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_6)) {

        /* "bcolz/carray_ext.pyx":1305
 *         for i from 0 <= i < nchunks:
 *             assert i * chunklen < array_.size, "i, nchunks: %d, %d" % (
 *             i, nchunks)             # <<<<<<<<<<<<<<
 *             chunk_ = chunk(array_[i * chunklen:(i + 1) * chunklen],
 *                            self._dtype, self._cparams,
 */
        __Pyx_TraceLine(1305,0,__PYX_ERR(0, 1305, __pyx_L1_error))
        __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_nchunks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1305, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
        __pyx_t_1 = 0;
        __pyx_t_2 = 0;

        /* "bcolz/carray_ext.pyx":1304
 *         nchunks = <npy_intp> cython.cdiv(nbytes, self._chunksize)
 *         for i from 0 <= i < nchunks:
 *             assert i * chunklen < array_.size, "i, nchunks: %d, %d" % (             # <<<<<<<<<<<<<<
 *             i, nchunks)
 *             chunk_ = chunk(array_[i * chunklen:(i + 1) * chunklen],
 */
        __Pyx_TraceLine(1304,0,__PYX_ERR(0, 1304, __pyx_L1_error))
        __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_i_nchunks_d_d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 1304, __pyx_L1_error)
      }
    }
    #endif

    /* "bcolz/carray_ext.pyx":1306
 *             assert i * chunklen < array_.size, "i, nchunks: %d, %d" % (
 *             i, nchunks)
 *             chunk_ = chunk(array_[i * chunklen:(i + 1) * chunklen],             # <<<<<<<<<<<<<<
 *                            self._dtype, self._cparams,
 *                            _memory=self._rootdir is None)
 */
    __Pyx_TraceLine(1306,0,__PYX_ERR(0, 1306, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_array_, (__pyx_v_i * __pyx_v_chunklen), ((__pyx_v_i + 1) * __pyx_v_chunklen), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "bcolz/carray_ext.pyx":1307
 *             i, nchunks)
 *             chunk_ = chunk(array_[i * chunklen:(i + 1) * chunklen],
 *                            self._dtype, self._cparams,             # <<<<<<<<<<<<<<
 *                            _memory=self._rootdir is None)
 *             self.chunks.append(chunk_)
 */
    __Pyx_TraceLine(1307,0,__PYX_ERR(0, 1307, __pyx_L1_error))
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_INCREF(__pyx_v_self->_dtype);
    __Pyx_GIVEREF(__pyx_v_self->_dtype);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->_dtype);
    __Pyx_INCREF(__pyx_v_self->_cparams);
    __Pyx_GIVEREF(__pyx_v_self->_cparams);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->_cparams);
    __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":1308
 *             chunk_ = chunk(array_[i * chunklen:(i + 1) * chunklen],
 *                            self._dtype, self._cparams,
 *                            _memory=self._rootdir is None)             # <<<<<<<<<<<<<<
 *             self.chunks.append(chunk_)
 *             cbytes += chunk_.cbytes
 */
    __Pyx_TraceLine(1308,0,__PYX_ERR(0, 1308, __pyx_L1_error))
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = (__pyx_v_self->_rootdir == Py_None);
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_memory, __pyx_t_1) < 0) __PYX_ERR(0, 1308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1306
 *             assert i * chunklen < array_.size, "i, nchunks: %d, %d" % (
 *             i, nchunks)
 *             chunk_ = chunk(array_[i * chunklen:(i + 1) * chunklen],             # <<<<<<<<<<<<<<
 *                            self._dtype, self._cparams,
 *                            _memory=self._rootdir is None)
 */
    __Pyx_TraceLine(1306,0,__PYX_ERR(0, 1306, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_chunk_, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1309
 *                            self._dtype, self._cparams,
 *                            _memory=self._rootdir is None)
 *             self.chunks.append(chunk_)             # <<<<<<<<<<<<<<
 *             cbytes += chunk_.cbytes
 *         self.leftover = leftover = cython.cmod(nbytes, self._chunksize)
 */
    __Pyx_TraceLine(1309,0,__PYX_ERR(0, 1309, __pyx_L1_error))
    __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_self->chunks, ((PyObject *)__pyx_v_chunk_)); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1309, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1310
 *                            _memory=self._rootdir is None)
 *             self.chunks.append(chunk_)
 *             cbytes += chunk_.cbytes             # <<<<<<<<<<<<<<
 *         self.leftover = leftover = cython.cmod(nbytes, self._chunksize)
 *         if leftover:
 */
    __Pyx_TraceLine(1310,0,__PYX_ERR(0, 1310, __pyx_L1_error))
    __pyx_v_cbytes = (__pyx_v_cbytes + __pyx_v_chunk_->cbytes);
  }

  /* "bcolz/carray_ext.pyx":1311
 *             self.chunks.append(chunk_)
 *             cbytes += chunk_.cbytes
 *         self.leftover = leftover = cython.cmod(nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         if leftover:
 *             remainder = array_[nchunks * chunklen:]
 */
  __Pyx_TraceLine(1311,0,__PYX_ERR(0, 1311, __pyx_L1_error))
  __pyx_t_4 = (__pyx_v_nbytes % __pyx_v_self->_chunksize);
  __pyx_v_self->leftover = __pyx_t_4;
  __pyx_v_leftover = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":1312
 *             cbytes += chunk_.cbytes
 *         self.leftover = leftover = cython.cmod(nbytes, self._chunksize)
 *         if leftover:             # <<<<<<<<<<<<<<
 *             remainder = array_[nchunks * chunklen:]
 *             memcpy(self.lastchunk, remainder.data, leftover)
 */
  __Pyx_TraceLine(1312,0,__PYX_ERR(0, 1312, __pyx_L1_error))
  __pyx_t_6 = (__pyx_v_leftover != 0);
  if (__pyx_t_6) {

    /* "bcolz/carray_ext.pyx":1313
 *         self.leftover = leftover = cython.cmod(nbytes, self._chunksize)
 *         if leftover:
 *             remainder = array_[nchunks * chunklen:]             # <<<<<<<<<<<<<<
 *             memcpy(self.lastchunk, remainder.data, leftover)
 *         cbytes += self._chunksize  # count the space in last chunk
 */
    __Pyx_TraceLine(1313,0,__PYX_ERR(0, 1313, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_array_, (__pyx_v_nchunks * __pyx_v_chunklen), 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1313, __pyx_L1_error)
    __pyx_v_remainder = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1314
 *         if leftover:
 *             remainder = array_[nchunks * chunklen:]
 *             memcpy(self.lastchunk, remainder.data, leftover)             # <<<<<<<<<<<<<<
 *         cbytes += self._chunksize  # count the space in last chunk
 *         self._cbytes = cbytes
 */
    __Pyx_TraceLine(1314,0,__PYX_ERR(0, 1314, __pyx_L1_error))
    memcpy(__pyx_v_self->lastchunk, __pyx_v_remainder->data, __pyx_v_leftover);

    /* "bcolz/carray_ext.pyx":1312
 *             cbytes += chunk_.cbytes
 *         self.leftover = leftover = cython.cmod(nbytes, self._chunksize)
 *         if leftover:             # <<<<<<<<<<<<<<
 *             remainder = array_[nchunks * chunklen:]
 *             memcpy(self.lastchunk, remainder.data, leftover)
 */
  }

  /* "bcolz/carray_ext.pyx":1315
 *             remainder = array_[nchunks * chunklen:]
 *             memcpy(self.lastchunk, remainder.data, leftover)
 *         cbytes += self._chunksize  # count the space in last chunk             # <<<<<<<<<<<<<<
 *         self._cbytes = cbytes
 * 
 */
  __Pyx_TraceLine(1315,0,__PYX_ERR(0, 1315, __pyx_L1_error))
  __pyx_v_cbytes = (__pyx_v_cbytes + __pyx_v_self->_chunksize);

  /* "bcolz/carray_ext.pyx":1316
 *             memcpy(self.lastchunk, remainder.data, leftover)
 *         cbytes += self._chunksize  # count the space in last chunk
 *         self._cbytes = cbytes             # <<<<<<<<<<<<<<
 * 
 *     def _mkdirs(self, object rootdir, object mode):
 */
  __Pyx_TraceLine(1316,0,__PYX_ERR(0, 1316, __pyx_L1_error))
  __pyx_v_self->_cbytes = __pyx_v_cbytes;

  /* "bcolz/carray_ext.pyx":1287
 *             self.resize(0)
 * 
 *     def _fill_chunks(self, object array_):             # <<<<<<<<<<<<<<
 *         """Fill chunks, either in-memory or on-disk."""
 *         cdef int leftover, chunklen
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._fill_chunks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_XDECREF((PyObject *)__pyx_v_remainder);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1318
 *         self._cbytes = cbytes
 * 
 *     def _mkdirs(self, object rootdir, object mode):             # <<<<<<<<<<<<<<
 *         """Create the basic directory layout for persistent storage."""
 *         if os.path.exists(rootdir):
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_9_mkdirs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_8_mkdirs[] = "carray._mkdirs(self, rootdir, mode)\nCreate the basic directory layout for persistent storage.";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_9_mkdirs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_rootdir = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_mkdirs (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rootdir,&__pyx_n_s_mode,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_rootdir)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_mkdirs", 1, 2, 2, 1); __PYX_ERR(0, 1318, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mkdirs") < 0)) __PYX_ERR(0, 1318, __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_rootdir = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_mkdirs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1318, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray._mkdirs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_8_mkdirs(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_rootdir, __pyx_v_mode);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_8_mkdirs(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_rootdir, PyObject *__pyx_v_mode) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("_mkdirs", 0);
  __Pyx_TraceCall("_mkdirs", __pyx_f[0], 1318, 0, __PYX_ERR(0, 1318, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1320
 *     def _mkdirs(self, object rootdir, object mode):
 *         """Create the basic directory layout for persistent storage."""
 *         if os.path.exists(rootdir):             # <<<<<<<<<<<<<<
 *             if self._mode != "w":
 *                 raise IOError(
 */
  __Pyx_TraceLine(1320,0,__PYX_ERR(0, 1320, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_rootdir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_rootdir);
    __Pyx_GIVEREF(__pyx_v_rootdir);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_rootdir);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1321
 *         """Create the basic directory layout for persistent storage."""
 *         if os.path.exists(rootdir):
 *             if self._mode != "w":             # <<<<<<<<<<<<<<
 *                 raise IOError(
 *                     "specified rootdir path '%s' already exists "
 */
    __Pyx_TraceLine(1321,0,__PYX_ERR(0, 1321, __pyx_L1_error))
    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_self->_mode, __pyx_n_s_w, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1321, __pyx_L1_error)
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":1324
 *                 raise IOError(
 *                     "specified rootdir path '%s' already exists "
 *                     "and creation mode is '%s'" % (rootdir, mode))             # <<<<<<<<<<<<<<
 *             if os.path.isdir(rootdir):
 *                 shutil.rmtree(rootdir)
 */
      __Pyx_TraceLine(1324,0,__PYX_ERR(0, 1324, __pyx_L1_error))
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_rootdir);
      __Pyx_GIVEREF(__pyx_v_rootdir);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_rootdir);
      __Pyx_INCREF(__pyx_v_mode);
      __Pyx_GIVEREF(__pyx_v_mode);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_mode);
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_specified_rootdir_path_s_already, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":1322
 *         if os.path.exists(rootdir):
 *             if self._mode != "w":
 *                 raise IOError(             # <<<<<<<<<<<<<<
 *                     "specified rootdir path '%s' already exists "
 *                     "and creation mode is '%s'" % (rootdir, mode))
 */
      __Pyx_TraceLine(1322,0,__PYX_ERR(0, 1322, __pyx_L1_error))
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__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_ERR(0, 1322, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1321
 *         """Create the basic directory layout for persistent storage."""
 *         if os.path.exists(rootdir):
 *             if self._mode != "w":             # <<<<<<<<<<<<<<
 *                 raise IOError(
 *                     "specified rootdir path '%s' already exists "
 */
    }

    /* "bcolz/carray_ext.pyx":1325
 *                     "specified rootdir path '%s' already exists "
 *                     "and creation mode is '%s'" % (rootdir, mode))
 *             if os.path.isdir(rootdir):             # <<<<<<<<<<<<<<
 *                 shutil.rmtree(rootdir)
 *             else:
 */
    __Pyx_TraceLine(1325,0,__PYX_ERR(0, 1325, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isdir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rootdir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_rootdir);
      __Pyx_GIVEREF(__pyx_v_rootdir);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_rootdir);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1325, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":1326
 *                     "and creation mode is '%s'" % (rootdir, mode))
 *             if os.path.isdir(rootdir):
 *                 shutil.rmtree(rootdir)             # <<<<<<<<<<<<<<
 *             else:
 *                 os.remove(rootdir)
 */
      __Pyx_TraceLine(1326,0,__PYX_ERR(0, 1326, __pyx_L1_error))
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_shutil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_rmtree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_rootdir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
        __Pyx_INCREF(__pyx_v_rootdir);
        __Pyx_GIVEREF(__pyx_v_rootdir);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_rootdir);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "bcolz/carray_ext.pyx":1325
 *                     "specified rootdir path '%s' already exists "
 *                     "and creation mode is '%s'" % (rootdir, mode))
 *             if os.path.isdir(rootdir):             # <<<<<<<<<<<<<<
 *                 shutil.rmtree(rootdir)
 *             else:
 */
      goto __pyx_L5;
    }

    /* "bcolz/carray_ext.pyx":1328
 *                 shutil.rmtree(rootdir)
 *             else:
 *                 os.remove(rootdir)             # <<<<<<<<<<<<<<
 *         os.mkdir(rootdir)
 *         self.datadir = os.path.join(rootdir, DATA_DIR)
 */
    __Pyx_TraceLine(1328,0,__PYX_ERR(0, 1328, __pyx_L1_error))
    /*else*/ {
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_remove); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rootdir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1328, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_rootdir);
        __Pyx_GIVEREF(__pyx_v_rootdir);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_rootdir);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1328, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L5:;

    /* "bcolz/carray_ext.pyx":1320
 *     def _mkdirs(self, object rootdir, object mode):
 *         """Create the basic directory layout for persistent storage."""
 *         if os.path.exists(rootdir):             # <<<<<<<<<<<<<<
 *             if self._mode != "w":
 *                 raise IOError(
 */
  }

  /* "bcolz/carray_ext.pyx":1329
 *             else:
 *                 os.remove(rootdir)
 *         os.mkdir(rootdir)             # <<<<<<<<<<<<<<
 *         self.datadir = os.path.join(rootdir, DATA_DIR)
 *         os.mkdir(self.datadir)
 */
  __Pyx_TraceLine(1329,0,__PYX_ERR(0, 1329, __pyx_L1_error))
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_mkdir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rootdir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_rootdir);
    __Pyx_GIVEREF(__pyx_v_rootdir);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_rootdir);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1330
 *                 os.remove(rootdir)
 *         os.mkdir(rootdir)
 *         self.datadir = os.path.join(rootdir, DATA_DIR)             # <<<<<<<<<<<<<<
 *         os.mkdir(self.datadir)
 *         self.metadir = os.path.join(rootdir, META_DIR)
 */
  __Pyx_TraceLine(1330,0,__PYX_ERR(0, 1330, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DATA_DIR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_rootdir);
  __Pyx_GIVEREF(__pyx_v_rootdir);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_rootdir);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->datadir);
  __Pyx_DECREF(__pyx_v_self->datadir);
  __pyx_v_self->datadir = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1331
 *         os.mkdir(rootdir)
 *         self.datadir = os.path.join(rootdir, DATA_DIR)
 *         os.mkdir(self.datadir)             # <<<<<<<<<<<<<<
 *         self.metadir = os.path.join(rootdir, META_DIR)
 *         os.mkdir(self.metadir)
 */
  __Pyx_TraceLine(1331,0,__PYX_ERR(0, 1331, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mkdir); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->datadir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_self->datadir);
    __Pyx_GIVEREF(__pyx_v_self->datadir);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_self->datadir);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1332
 *         self.datadir = os.path.join(rootdir, DATA_DIR)
 *         os.mkdir(self.datadir)
 *         self.metadir = os.path.join(rootdir, META_DIR)             # <<<<<<<<<<<<<<
 *         os.mkdir(self.metadir)
 * 
 */
  __Pyx_TraceLine(1332,0,__PYX_ERR(0, 1332, __pyx_L1_error))
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_META_DIR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_1) {
    __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
  }
  __Pyx_INCREF(__pyx_v_rootdir);
  __Pyx_GIVEREF(__pyx_v_rootdir);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_rootdir);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->metadir);
  __Pyx_DECREF(__pyx_v_self->metadir);
  __pyx_v_self->metadir = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1333
 *         os.mkdir(self.datadir)
 *         self.metadir = os.path.join(rootdir, META_DIR)
 *         os.mkdir(self.metadir)             # <<<<<<<<<<<<<<
 * 
 *     def _write_meta(self):
 */
  __Pyx_TraceLine(1333,0,__PYX_ERR(0, 1333, __pyx_L1_error))
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_mkdir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->metadir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_INCREF(__pyx_v_self->metadir);
    __Pyx_GIVEREF(__pyx_v_self->metadir);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_self->metadir);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1318
 *         self._cbytes = cbytes
 * 
 *     def _mkdirs(self, object rootdir, object mode):             # <<<<<<<<<<<<<<
 *         """Create the basic directory layout for persistent storage."""
 *         if os.path.exists(rootdir):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._mkdirs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1335
 *         os.mkdir(self.metadir)
 * 
 *     def _write_meta(self):             # <<<<<<<<<<<<<<
 *         """Write metadata persistently."""
 *         storagef = os.path.join(self.metadir, STORAGE_FILE)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_11_write_meta(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_10_write_meta[] = "carray._write_meta(self)\nWrite metadata persistently.";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_11_write_meta(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_write_meta (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_10_write_meta(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_10_write_meta(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_v_storagef = NULL;
  PyObject *__pyx_v_storagefh = NULL;
  PyObject *__pyx_v_dflt_list = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  __Pyx_RefNannySetupContext("_write_meta", 0);
  __Pyx_TraceCall("_write_meta", __pyx_f[0], 1335, 0, __PYX_ERR(0, 1335, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1337
 *     def _write_meta(self):
 *         """Write metadata persistently."""
 *         storagef = os.path.join(self.metadir, STORAGE_FILE)             # <<<<<<<<<<<<<<
 *         with open(storagef, 'wb') as storagefh:
 *             dflt_list = self.dflt.tolist()
 */
  __Pyx_TraceLine(1337,0,__PYX_ERR(0, 1337, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_STORAGE_FILE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self->metadir);
  __Pyx_GIVEREF(__pyx_v_self->metadir);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self->metadir);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_storagef = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1338
 *         """Write metadata persistently."""
 *         storagef = os.path.join(self.metadir, STORAGE_FILE)
 *         with open(storagef, 'wb') as storagefh:             # <<<<<<<<<<<<<<
 *             dflt_list = self.dflt.tolist()
 *             if type(dflt_list) in (datetime.datetime,
 */
  __Pyx_TraceLine(1338,0,__PYX_ERR(0, 1338, __pyx_L1_error))
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_storagef);
    __Pyx_GIVEREF(__pyx_v_storagef);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_storagef);
    __Pyx_INCREF(__pyx_n_s_wb);
    __Pyx_GIVEREF(__pyx_n_s_wb);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_wb);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1338, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {
          __pyx_v_storagefh = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "bcolz/carray_ext.pyx":1339
 *         storagef = os.path.join(self.metadir, STORAGE_FILE)
 *         with open(storagef, 'wb') as storagefh:
 *             dflt_list = self.dflt.tolist()             # <<<<<<<<<<<<<<
 *             if type(dflt_list) in (datetime.datetime,
 *                                    datetime.date, datetime.time):
 */
          __Pyx_TraceLine(1339,0,__PYX_ERR(0, 1339, __pyx_L7_error))
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dflt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1339, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tolist); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          if (__pyx_t_2) {
            __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1339, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          } else {
            __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1339, __pyx_L7_error)
          }
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_dflt_list = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "bcolz/carray_ext.pyx":1340
 *         with open(storagef, 'wb') as storagefh:
 *             dflt_list = self.dflt.tolist()
 *             if type(dflt_list) in (datetime.datetime,             # <<<<<<<<<<<<<<
 *                                    datetime.date, datetime.time):
 *                 # The datetime cannot be serialized with JSON.  Use a 0 int.
 */
          __Pyx_TraceLine(1340,0,__PYX_ERR(0, 1340, __pyx_L7_error))
          __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_dflt_list)));
          __pyx_t_6 = ((PyObject *)Py_TYPE(__pyx_v_dflt_list));
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1340, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_t_6), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1340, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (!__pyx_t_12) {
          } else {
            __pyx_t_11 = __pyx_t_12;
            goto __pyx_L16_bool_binop_done;
          }

          /* "bcolz/carray_ext.pyx":1341
 *             dflt_list = self.dflt.tolist()
 *             if type(dflt_list) in (datetime.datetime,
 *                                    datetime.date, datetime.time):             # <<<<<<<<<<<<<<
 *                 # The datetime cannot be serialized with JSON.  Use a 0 int.
 *                 dflt_list = 0
 */
          __Pyx_TraceLine(1341,0,__PYX_ERR(0, 1341, __pyx_L7_error))
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_t_6), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "bcolz/carray_ext.pyx":1340
 *         with open(storagef, 'wb') as storagefh:
 *             dflt_list = self.dflt.tolist()
 *             if type(dflt_list) in (datetime.datetime,             # <<<<<<<<<<<<<<
 *                                    datetime.date, datetime.time):
 *                 # The datetime cannot be serialized with JSON.  Use a 0 int.
 */
          __Pyx_TraceLine(1340,0,__PYX_ERR(0, 1340, __pyx_L7_error))
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1340, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (!__pyx_t_12) {
          } else {
            __pyx_t_11 = __pyx_t_12;
            goto __pyx_L16_bool_binop_done;
          }

          /* "bcolz/carray_ext.pyx":1341
 *             dflt_list = self.dflt.tolist()
 *             if type(dflt_list) in (datetime.datetime,
 *                                    datetime.date, datetime.time):             # <<<<<<<<<<<<<<
 *                 # The datetime cannot be serialized with JSON.  Use a 0 int.
 *                 dflt_list = 0
 */
          __Pyx_TraceLine(1341,0,__PYX_ERR(0, 1341, __pyx_L7_error))
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_t_6), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "bcolz/carray_ext.pyx":1340
 *         with open(storagef, 'wb') as storagefh:
 *             dflt_list = self.dflt.tolist()
 *             if type(dflt_list) in (datetime.datetime,             # <<<<<<<<<<<<<<
 *                                    datetime.date, datetime.time):
 *                 # The datetime cannot be serialized with JSON.  Use a 0 int.
 */
          __Pyx_TraceLine(1340,0,__PYX_ERR(0, 1340, __pyx_L7_error))
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1340, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_11 = __pyx_t_12;
          __pyx_L16_bool_binop_done:;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_12 = (__pyx_t_11 != 0);
          if (__pyx_t_12) {

            /* "bcolz/carray_ext.pyx":1343
 *                                    datetime.date, datetime.time):
 *                 # The datetime cannot be serialized with JSON.  Use a 0 int.
 *                 dflt_list = 0             # <<<<<<<<<<<<<<
 *             # In Python 3, the json encoder doesn't accept bytes objects
 *             if sys.version_info >= (3, 0):
 */
            __Pyx_TraceLine(1343,0,__PYX_ERR(0, 1343, __pyx_L7_error))
            __Pyx_INCREF(__pyx_int_0);
            __Pyx_DECREF_SET(__pyx_v_dflt_list, __pyx_int_0);

            /* "bcolz/carray_ext.pyx":1340
 *         with open(storagef, 'wb') as storagefh:
 *             dflt_list = self.dflt.tolist()
 *             if type(dflt_list) in (datetime.datetime,             # <<<<<<<<<<<<<<
 *                                    datetime.date, datetime.time):
 *                 # The datetime cannot be serialized with JSON.  Use a 0 int.
 */
          }

          /* "bcolz/carray_ext.pyx":1345
 *                 dflt_list = 0
 *             # In Python 3, the json encoder doesn't accept bytes objects
 *             if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *                 dflt_list = list_bytes_to_str(dflt_list)
 *             storagefh.write(json.dumps({
 */
          __Pyx_TraceLine(1345,0,__PYX_ERR(0, 1345, __pyx_L7_error))
          __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1345, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__45, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1345, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1345, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (__pyx_t_12) {

            /* "bcolz/carray_ext.pyx":1346
 *             # In Python 3, the json encoder doesn't accept bytes objects
 *             if sys.version_info >= (3, 0):
 *                 dflt_list = list_bytes_to_str(dflt_list)             # <<<<<<<<<<<<<<
 *             storagefh.write(json.dumps({
 *                 # str(self.dtype) produces bytes by default in cython.py3.
 */
            __Pyx_TraceLine(1346,0,__PYX_ERR(0, 1346, __pyx_L7_error))
            __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_bytes_to_str); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
              }
            }
            if (!__pyx_t_2) {
              __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dflt_list); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1346, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_6);
            } else {
              __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
              __Pyx_INCREF(__pyx_v_dflt_list);
              __Pyx_GIVEREF(__pyx_v_dflt_list);
              PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_dflt_list);
              __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1346, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF_SET(__pyx_v_dflt_list, __pyx_t_6);
            __pyx_t_6 = 0;

            /* "bcolz/carray_ext.pyx":1345
 *                 dflt_list = 0
 *             # In Python 3, the json encoder doesn't accept bytes objects
 *             if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *                 dflt_list = list_bytes_to_str(dflt_list)
 *             storagefh.write(json.dumps({
 */
          }

          /* "bcolz/carray_ext.pyx":1347
 *             if sys.version_info >= (3, 0):
 *                 dflt_list = list_bytes_to_str(dflt_list)
 *             storagefh.write(json.dumps({             # <<<<<<<<<<<<<<
 *                 # str(self.dtype) produces bytes by default in cython.py3.
 *                 # Calling .__str__() is a workaround.
 */
          __Pyx_TraceLine(1347,0,__PYX_ERR(0, 1347, __pyx_L7_error))
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_storagefh, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1347, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dumps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "bcolz/carray_ext.pyx":1350
 *                 # str(self.dtype) produces bytes by default in cython.py3.
 *                 # Calling .__str__() is a workaround.
 *                 "dtype": self.dtype.__str__(),             # <<<<<<<<<<<<<<
 *                 "cparams": {
 *                     "clevel": self.cparams.clevel,
 */
          __Pyx_TraceLine(1350,0,__PYX_ERR(0, 1350, __pyx_L7_error))
          __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1350, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1350, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_str); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1350, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
            }
          }
          if (__pyx_t_13) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1350, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          } else {
            __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1350, __pyx_L7_error)
          }
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 1350, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":1352
 *                 "dtype": self.dtype.__str__(),
 *                 "cparams": {
 *                     "clevel": self.cparams.clevel,             # <<<<<<<<<<<<<<
 *                     "shuffle": self.cparams.shuffle,
 *                     "cname": self.cparams.cname,
 */
          __Pyx_TraceLine(1352,0,__PYX_ERR(0, 1352, __pyx_L7_error))
          __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1352, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1352, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_clevel); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1352, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_clevel, __pyx_t_13) < 0) __PYX_ERR(0, 1352, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "bcolz/carray_ext.pyx":1353
 *                 "cparams": {
 *                     "clevel": self.cparams.clevel,
 *                     "shuffle": self.cparams.shuffle,             # <<<<<<<<<<<<<<
 *                     "cname": self.cparams.cname,
 *                     "quantize": self.cparams.quantize,
 */
          __Pyx_TraceLine(1353,0,__PYX_ERR(0, 1353, __pyx_L7_error))
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1353, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1353, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shuffle, __pyx_t_14) < 0) __PYX_ERR(0, 1352, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

          /* "bcolz/carray_ext.pyx":1354
 *                     "clevel": self.cparams.clevel,
 *                     "shuffle": self.cparams.shuffle,
 *                     "cname": self.cparams.cname,             # <<<<<<<<<<<<<<
 *                     "quantize": self.cparams.quantize,
 *                 },
 */
          __Pyx_TraceLine(1354,0,__PYX_ERR(0, 1354, __pyx_L7_error))
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1354, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_cname); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1354, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cname, __pyx_t_13) < 0) __PYX_ERR(0, 1352, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "bcolz/carray_ext.pyx":1355
 *                     "shuffle": self.cparams.shuffle,
 *                     "cname": self.cparams.cname,
 *                     "quantize": self.cparams.quantize,             # <<<<<<<<<<<<<<
 *                 },
 *                 "chunklen": self._chunklen,
 */
          __Pyx_TraceLine(1355,0,__PYX_ERR(0, 1355, __pyx_L7_error))
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1355, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_quantize); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1355, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_quantize, __pyx_t_14) < 0) __PYX_ERR(0, 1352, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_cparams, __pyx_t_4) < 0) __PYX_ERR(0, 1350, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":1357
 *                     "quantize": self.cparams.quantize,
 *                 },
 *                 "chunklen": self._chunklen,             # <<<<<<<<<<<<<<
 *                 "expectedlen": self.expectedlen,
 *                 "dflt": dflt_list,
 */
          __Pyx_TraceLine(1357,0,__PYX_ERR(0, 1357, __pyx_L7_error))
          __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->_chunklen); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1357, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chunklen, __pyx_t_4) < 0) __PYX_ERR(0, 1350, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":1358
 *                 },
 *                 "chunklen": self._chunklen,
 *                 "expectedlen": self.expectedlen,             # <<<<<<<<<<<<<<
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))
 */
          __Pyx_TraceLine(1358,0,__PYX_ERR(0, 1358, __pyx_L7_error))
          __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->expectedlen); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1358, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_expectedlen, __pyx_t_4) < 0) __PYX_ERR(0, 1350, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":1359
 *                 "chunklen": self._chunklen,
 *                 "expectedlen": self.expectedlen,
 *                 "dflt": dflt_list,             # <<<<<<<<<<<<<<
 *             }, ensure_ascii=True).encode('ascii'))
 *             storagefh.write(b"\n")
 */
          __Pyx_TraceLine(1359,0,__PYX_ERR(0, 1359, __pyx_L7_error))
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dflt, __pyx_v_dflt_list) < 0) __PYX_ERR(0, 1350, __pyx_L7_error)

          /* "bcolz/carray_ext.pyx":1347
 *             if sys.version_info >= (3, 0):
 *                 dflt_list = list_bytes_to_str(dflt_list)
 *             storagefh.write(json.dumps({             # <<<<<<<<<<<<<<
 *                 # str(self.dtype) produces bytes by default in cython.py3.
 *                 # Calling .__str__() is a workaround.
 */
          __Pyx_TraceLine(1347,0,__PYX_ERR(0, 1347, __pyx_L7_error))
          __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1347, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "bcolz/carray_ext.pyx":1360
 *                 "expectedlen": self.expectedlen,
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))             # <<<<<<<<<<<<<<
 *             storagefh.write(b"\n")
 * 
 */
          __Pyx_TraceLine(1360,0,__PYX_ERR(0, 1360, __pyx_L7_error))
          __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1360, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ensure_ascii, Py_True) < 0) __PYX_ERR(0, 1360, __pyx_L7_error)

          /* "bcolz/carray_ext.pyx":1347
 *             if sys.version_info >= (3, 0):
 *                 dflt_list = list_bytes_to_str(dflt_list)
 *             storagefh.write(json.dumps({             # <<<<<<<<<<<<<<
 *                 # str(self.dtype) produces bytes by default in cython.py3.
 *                 # Calling .__str__() is a workaround.
 */
          __Pyx_TraceLine(1347,0,__PYX_ERR(0, 1347, __pyx_L7_error))
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1347, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "bcolz/carray_ext.pyx":1360
 *                 "expectedlen": self.expectedlen,
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))             # <<<<<<<<<<<<<<
 *             storagefh.write(b"\n")
 * 
 */
          __Pyx_TraceLine(1360,0,__PYX_ERR(0, 1360, __pyx_L7_error))
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1360, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1360, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          if (!__pyx_t_3) {
            __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1347, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else {
            __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1347, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
            __Pyx_GIVEREF(__pyx_t_14);
            PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_14);
            __pyx_t_14 = 0;
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1347, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "bcolz/carray_ext.pyx":1361
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))
 *             storagefh.write(b"\n")             # <<<<<<<<<<<<<<
 * 
 *     def _read_meta(self):
 */
          __Pyx_TraceLine(1361,0,__PYX_ERR(0, 1361, __pyx_L7_error))
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_storagefh, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1361, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "bcolz/carray_ext.pyx":1338
 *         """Write metadata persistently."""
 *         storagef = os.path.join(self.metadir, STORAGE_FILE)
 *         with open(storagef, 'wb') as storagefh:             # <<<<<<<<<<<<<<
 *             dflt_list = self.dflt.tolist()
 *             if type(dflt_list) in (datetime.datetime,
 */
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("bcolz.carray_ext.carray._write_meta", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 1338, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_14 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1338, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1338, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (__pyx_t_12 < 0) __PYX_ERR(0, 1338, __pyx_L9_except_error)
          __pyx_t_11 = ((!(__pyx_t_12 != 0)) != 0);
          if (__pyx_t_11) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_XGIVEREF(__pyx_t_4);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_6, __pyx_t_4);
            __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_4 = 0; 
            __PYX_ERR(0, 1338, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__49, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1338, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L23;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L23:;
  }

  /* "bcolz/carray_ext.pyx":1335
 *         os.mkdir(self.metadir)
 * 
 *     def _write_meta(self):             # <<<<<<<<<<<<<<
 *         """Write metadata persistently."""
 *         storagef = os.path.join(self.metadir, STORAGE_FILE)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._write_meta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_storagef);
  __Pyx_XDECREF(__pyx_v_storagefh);
  __Pyx_XDECREF(__pyx_v_dflt_list);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1363
 *             storagefh.write(b"\n")
 * 
 *     def _read_meta(self):             # <<<<<<<<<<<<<<
 *         """Read persistent metadata."""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_13_read_meta(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_12_read_meta[] = "carray._read_meta(self)\nRead persistent metadata.";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_13_read_meta(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_meta (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_12_read_meta(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_12_read_meta(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_v_metadir = NULL;
  PyObject *__pyx_v_shapef = NULL;
  PyObject *__pyx_v_shapefh = NULL;
  PyObject *__pyx_v_sizes = NULL;
  PyObject *__pyx_v_shape = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_nbytes = NULL;
  PyObject *__pyx_v_cbytes = NULL;
  PyObject *__pyx_v_storagef = NULL;
  PyObject *__pyx_v_storagefh = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_v_dtype_ = NULL;
  PyObject *__pyx_v_chunklen = NULL;
  PyObject *__pyx_v_cparams = NULL;
  PyObject *__pyx_v_cname = NULL;
  PyObject *__pyx_v_quantize = NULL;
  PyObject *__pyx_v_expectedlen = NULL;
  PyObject *__pyx_v_dflt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("_read_meta", 0);
  __Pyx_TraceCall("_read_meta", __pyx_f[0], 1363, 0, __PYX_ERR(0, 1363, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1367
 * 
 *         # First read the size info
 *         metadir = os.path.join(self._rootdir, META_DIR)             # <<<<<<<<<<<<<<
 *         shapef = os.path.join(metadir, SIZES_FILE)
 *         with open(shapef, 'rb') as shapefh:
 */
  __Pyx_TraceLine(1367,0,__PYX_ERR(0, 1367, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_META_DIR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self->_rootdir);
  __Pyx_GIVEREF(__pyx_v_self->_rootdir);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self->_rootdir);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_metadir = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1368
 *         # First read the size info
 *         metadir = os.path.join(self._rootdir, META_DIR)
 *         shapef = os.path.join(metadir, SIZES_FILE)             # <<<<<<<<<<<<<<
 *         with open(shapef, 'rb') as shapefh:
 *             sizes = json.loads(shapefh.read().decode('ascii'))
 */
  __Pyx_TraceLine(1368,0,__PYX_ERR(0, 1368, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_SIZES_FILE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_metadir);
  __Pyx_GIVEREF(__pyx_v_metadir);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_metadir);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_shapef = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1369
 *         metadir = os.path.join(self._rootdir, META_DIR)
 *         shapef = os.path.join(metadir, SIZES_FILE)
 *         with open(shapef, 'rb') as shapefh:             # <<<<<<<<<<<<<<
 *             sizes = json.loads(shapefh.read().decode('ascii'))
 *         shape = sizes['shape']
 */
  __Pyx_TraceLine(1369,0,__PYX_ERR(0, 1369, __pyx_L1_error))
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_shapef);
    __Pyx_GIVEREF(__pyx_v_shapef);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shapef);
    __Pyx_INCREF(__pyx_n_s_rb);
    __Pyx_GIVEREF(__pyx_n_s_rb);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_rb);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1369, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {
          __pyx_v_shapefh = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":1370
 *         shapef = os.path.join(metadir, SIZES_FILE)
 *         with open(shapef, 'rb') as shapefh:
 *             sizes = json.loads(shapefh.read().decode('ascii'))             # <<<<<<<<<<<<<<
 *         shape = sizes['shape']
 *         if type(shape) == list:
 */
          __Pyx_TraceLine(1370,0,__PYX_ERR(0, 1370, __pyx_L7_error))
          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapefh, __pyx_n_s_read); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1370, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_3 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          if (__pyx_t_3) {
            __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          } else {
            __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L7_error)
          }
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1370, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          if (!__pyx_t_6) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1370, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1370, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_2);
            __pyx_t_2 = 0;
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1370, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_v_sizes = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":1369
 *         metadir = os.path.join(self._rootdir, META_DIR)
 *         shapef = os.path.join(metadir, SIZES_FILE)
 *         with open(shapef, 'rb') as shapefh:             # <<<<<<<<<<<<<<
 *             sizes = json.loads(shapefh.read().decode('ascii'))
 *         shape = sizes['shape']
 */
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("bcolz.carray_ext.carray._read_meta", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 1369, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1369, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_12 < 0) __PYX_ERR(0, 1369, __pyx_L9_except_error)
          __pyx_t_13 = ((!(__pyx_t_12 != 0)) != 0);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_1, __pyx_t_3);
            __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; 
            __PYX_ERR(0, 1369, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__51, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1369, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L18;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L18:;
  }

  /* "bcolz/carray_ext.pyx":1371
 *         with open(shapef, 'rb') as shapefh:
 *             sizes = json.loads(shapefh.read().decode('ascii'))
 *         shape = sizes['shape']             # <<<<<<<<<<<<<<
 *         if type(shape) == list:
 *             shape = tuple(shape)
 */
  __Pyx_TraceLine(1371,0,__PYX_ERR(0, 1371, __pyx_L1_error))
  if (unlikely(!__pyx_v_sizes)) { __Pyx_RaiseUnboundLocalError("sizes"); __PYX_ERR(0, 1371, __pyx_L1_error) }
  __pyx_t_3 = PyObject_GetItem(__pyx_v_sizes, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_shape = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1372
 *             sizes = json.loads(shapefh.read().decode('ascii'))
 *         shape = sizes['shape']
 *         if type(shape) == list:             # <<<<<<<<<<<<<<
 *             shape = tuple(shape)
 *         nbytes = sizes["nbytes"]
 */
  __Pyx_TraceLine(1372,0,__PYX_ERR(0, 1372, __pyx_L1_error))
  __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_shape)), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_13) {

    /* "bcolz/carray_ext.pyx":1373
 *         shape = sizes['shape']
 *         if type(shape) == list:
 *             shape = tuple(shape)             # <<<<<<<<<<<<<<
 *         nbytes = sizes["nbytes"]
 *         cbytes = sizes["cbytes"]
 */
    __Pyx_TraceLine(1373,0,__PYX_ERR(0, 1373, __pyx_L1_error))
    __pyx_t_3 = PySequence_Tuple(__pyx_v_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_shape, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1372
 *             sizes = json.loads(shapefh.read().decode('ascii'))
 *         shape = sizes['shape']
 *         if type(shape) == list:             # <<<<<<<<<<<<<<
 *             shape = tuple(shape)
 *         nbytes = sizes["nbytes"]
 */
  }

  /* "bcolz/carray_ext.pyx":1374
 *         if type(shape) == list:
 *             shape = tuple(shape)
 *         nbytes = sizes["nbytes"]             # <<<<<<<<<<<<<<
 *         cbytes = sizes["cbytes"]
 * 
 */
  __Pyx_TraceLine(1374,0,__PYX_ERR(0, 1374, __pyx_L1_error))
  if (unlikely(!__pyx_v_sizes)) { __Pyx_RaiseUnboundLocalError("sizes"); __PYX_ERR(0, 1374, __pyx_L1_error) }
  __pyx_t_3 = PyObject_GetItem(__pyx_v_sizes, __pyx_n_s_nbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_nbytes = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1375
 *             shape = tuple(shape)
 *         nbytes = sizes["nbytes"]
 *         cbytes = sizes["cbytes"]             # <<<<<<<<<<<<<<
 * 
 *         # Then the rest of metadata
 */
  __Pyx_TraceLine(1375,0,__PYX_ERR(0, 1375, __pyx_L1_error))
  if (unlikely(!__pyx_v_sizes)) { __Pyx_RaiseUnboundLocalError("sizes"); __PYX_ERR(0, 1375, __pyx_L1_error) }
  __pyx_t_3 = PyObject_GetItem(__pyx_v_sizes, __pyx_n_s_cbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_cbytes = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1378
 * 
 *         # Then the rest of metadata
 *         storagef = os.path.join(metadir, STORAGE_FILE)             # <<<<<<<<<<<<<<
 *         with open(storagef, 'rb') as storagefh:
 *             data = json.loads(storagefh.read().decode('ascii'))
 */
  __Pyx_TraceLine(1378,0,__PYX_ERR(0, 1378, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_STORAGE_FILE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_v_metadir);
  __Pyx_GIVEREF(__pyx_v_metadir);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_metadir);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_storagef = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1379
 *         # Then the rest of metadata
 *         storagef = os.path.join(metadir, STORAGE_FILE)
 *         with open(storagef, 'rb') as storagefh:             # <<<<<<<<<<<<<<
 *             data = json.loads(storagefh.read().decode('ascii'))
 *         dtype_ = np.dtype(data["dtype"])
 */
  __Pyx_TraceLine(1379,0,__PYX_ERR(0, 1379, __pyx_L1_error))
  /*with:*/ {
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_storagef);
    __Pyx_GIVEREF(__pyx_v_storagef);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_storagef);
    __Pyx_INCREF(__pyx_n_s_rb);
    __Pyx_GIVEREF(__pyx_n_s_rb);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_rb);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1379, __pyx_L20_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L20_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L20_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {
          __pyx_v_storagefh = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "bcolz/carray_ext.pyx":1380
 *         storagef = os.path.join(metadir, STORAGE_FILE)
 *         with open(storagef, 'rb') as storagefh:
 *             data = json.loads(storagefh.read().decode('ascii'))             # <<<<<<<<<<<<<<
 *         dtype_ = np.dtype(data["dtype"])
 *         chunklen = data["chunklen"]
 */
          __Pyx_TraceLine(1380,0,__PYX_ERR(0, 1380, __pyx_L24_error))
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1380, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_storagefh, __pyx_n_s_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1380, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
            }
          }
          if (__pyx_t_2) {
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L24_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          } else {
            __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L24_error)
          }
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1380, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L24_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          if (!__pyx_t_4) {
            __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1380, __pyx_L24_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else {
            __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1380, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_1);
            __pyx_t_1 = 0;
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1380, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_data = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "bcolz/carray_ext.pyx":1379
 *         # Then the rest of metadata
 *         storagef = os.path.join(metadir, STORAGE_FILE)
 *         with open(storagef, 'rb') as storagefh:             # <<<<<<<<<<<<<<
 *             data = json.loads(storagefh.read().decode('ascii'))
 *         dtype_ = np.dtype(data["dtype"])
 */
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L31_try_end;
        __pyx_L24_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("bcolz.carray_ext.carray._read_meta", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 1379, __pyx_L26_except_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L26_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1379, __pyx_L26_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_13 < 0) __PYX_ERR(0, 1379, __pyx_L26_except_error)
          __pyx_t_12 = ((!(__pyx_t_13 != 0)) != 0);
          if (__pyx_t_12) {
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_3, __pyx_t_2);
            __pyx_t_6 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
            __PYX_ERR(0, 1379, __pyx_L26_except_error)
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L25_exception_handled;
        }
        __pyx_L26_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L25_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        __pyx_L31_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_7) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__53, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1379, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L23;
      }
      __pyx_L23:;
    }
    goto __pyx_L35;
    __pyx_L20_error:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L1_error;
    __pyx_L35:;
  }

  /* "bcolz/carray_ext.pyx":1381
 *         with open(storagef, 'rb') as storagefh:
 *             data = json.loads(storagefh.read().decode('ascii'))
 *         dtype_ = np.dtype(data["dtype"])             # <<<<<<<<<<<<<<
 *         chunklen = data["chunklen"]
 *         cparams = data["cparams"]
 */
  __Pyx_TraceLine(1381,0,__PYX_ERR(0, 1381, __pyx_L1_error))
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 1381, __pyx_L1_error) }
  __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_dtype_ = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1382
 *             data = json.loads(storagefh.read().decode('ascii'))
 *         dtype_ = np.dtype(data["dtype"])
 *         chunklen = data["chunklen"]             # <<<<<<<<<<<<<<
 *         cparams = data["cparams"]
 *         cname = cparams['cname'] if 'cname' in cparams else 'blosclz'
 */
  __Pyx_TraceLine(1382,0,__PYX_ERR(0, 1382, __pyx_L1_error))
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 1382, __pyx_L1_error) }
  __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_chunklen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_chunklen = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1383
 *         dtype_ = np.dtype(data["dtype"])
 *         chunklen = data["chunklen"]
 *         cparams = data["cparams"]             # <<<<<<<<<<<<<<
 *         cname = cparams['cname'] if 'cname' in cparams else 'blosclz'
 *         quantize = cparams['quantize'] if 'quantize' in cparams else None
 */
  __Pyx_TraceLine(1383,0,__PYX_ERR(0, 1383, __pyx_L1_error))
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 1383, __pyx_L1_error) }
  __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_cparams); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_cparams = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1384
 *         chunklen = data["chunklen"]
 *         cparams = data["cparams"]
 *         cname = cparams['cname'] if 'cname' in cparams else 'blosclz'             # <<<<<<<<<<<<<<
 *         quantize = cparams['quantize'] if 'quantize' in cparams else None
 *         cparams = bcolz.cparams(
 */
  __Pyx_TraceLine(1384,0,__PYX_ERR(0, 1384, __pyx_L1_error))
  __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_cname, __pyx_v_cparams, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1384, __pyx_L1_error)
  if ((__pyx_t_12 != 0)) {
    __pyx_t_3 = PyObject_GetItem(__pyx_v_cparams, __pyx_n_s_cname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_n_s_blosclz);
    __pyx_t_2 = __pyx_n_s_blosclz;
  }
  __pyx_v_cname = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1385
 *         cparams = data["cparams"]
 *         cname = cparams['cname'] if 'cname' in cparams else 'blosclz'
 *         quantize = cparams['quantize'] if 'quantize' in cparams else None             # <<<<<<<<<<<<<<
 *         cparams = bcolz.cparams(
 *             clevel=data["cparams"]["clevel"],
 */
  __Pyx_TraceLine(1385,0,__PYX_ERR(0, 1385, __pyx_L1_error))
  __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_quantize, __pyx_v_cparams, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 1385, __pyx_L1_error)
  if ((__pyx_t_12 != 0)) {
    __pyx_t_3 = PyObject_GetItem(__pyx_v_cparams, __pyx_n_s_quantize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_2 = Py_None;
  }
  __pyx_v_quantize = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1386
 *         cname = cparams['cname'] if 'cname' in cparams else 'blosclz'
 *         quantize = cparams['quantize'] if 'quantize' in cparams else None
 *         cparams = bcolz.cparams(             # <<<<<<<<<<<<<<
 *             clevel=data["cparams"]["clevel"],
 *             shuffle=data["cparams"]["shuffle"],
 */
  __Pyx_TraceLine(1386,0,__PYX_ERR(0, 1386, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bcolz); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cparams); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1387
 *         quantize = cparams['quantize'] if 'quantize' in cparams else None
 *         cparams = bcolz.cparams(
 *             clevel=data["cparams"]["clevel"],             # <<<<<<<<<<<<<<
 *             shuffle=data["cparams"]["shuffle"],
 *             cname=cname,
 */
  __Pyx_TraceLine(1387,0,__PYX_ERR(0, 1387, __pyx_L1_error))
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 1387, __pyx_L1_error) }
  __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_cparams); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_6, __pyx_n_s_clevel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_clevel, __pyx_t_1) < 0) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1388
 *         cparams = bcolz.cparams(
 *             clevel=data["cparams"]["clevel"],
 *             shuffle=data["cparams"]["shuffle"],             # <<<<<<<<<<<<<<
 *             cname=cname,
 *             quantize=quantize)
 */
  __Pyx_TraceLine(1388,0,__PYX_ERR(0, 1388, __pyx_L1_error))
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 1388, __pyx_L1_error) }
  __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_cparams); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shuffle, __pyx_t_6) < 0) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1389
 *             clevel=data["cparams"]["clevel"],
 *             shuffle=data["cparams"]["shuffle"],
 *             cname=cname,             # <<<<<<<<<<<<<<
 *             quantize=quantize)
 *         expectedlen = data["expectedlen"]
 */
  __Pyx_TraceLine(1389,0,__PYX_ERR(0, 1389, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cname, __pyx_v_cname) < 0) __PYX_ERR(0, 1387, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":1390
 *             shuffle=data["cparams"]["shuffle"],
 *             cname=cname,
 *             quantize=quantize)             # <<<<<<<<<<<<<<
 *         expectedlen = data["expectedlen"]
 *         dflt = data["dflt"]
 */
  __Pyx_TraceLine(1390,0,__PYX_ERR(0, 1390, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_quantize, __pyx_v_quantize) < 0) __PYX_ERR(0, 1387, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":1386
 *         cname = cparams['cname'] if 'cname' in cparams else 'blosclz'
 *         quantize = cparams['quantize'] if 'quantize' in cparams else None
 *         cparams = bcolz.cparams(             # <<<<<<<<<<<<<<
 *             clevel=data["cparams"]["clevel"],
 *             shuffle=data["cparams"]["shuffle"],
 */
  __Pyx_TraceLine(1386,0,__PYX_ERR(0, 1386, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_cparams, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1391
 *             cname=cname,
 *             quantize=quantize)
 *         expectedlen = data["expectedlen"]             # <<<<<<<<<<<<<<
 *         dflt = data["dflt"]
 *         return (shape, cparams, dtype_, dflt, expectedlen, cbytes, chunklen)
 */
  __Pyx_TraceLine(1391,0,__PYX_ERR(0, 1391, __pyx_L1_error))
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 1391, __pyx_L1_error) }
  __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_expectedlen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_expectedlen = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1392
 *             quantize=quantize)
 *         expectedlen = data["expectedlen"]
 *         dflt = data["dflt"]             # <<<<<<<<<<<<<<
 *         return (shape, cparams, dtype_, dflt, expectedlen, cbytes, chunklen)
 * 
 */
  __Pyx_TraceLine(1392,0,__PYX_ERR(0, 1392, __pyx_L1_error))
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); __PYX_ERR(0, 1392, __pyx_L1_error) }
  __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_dflt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_dflt = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1393
 *         expectedlen = data["expectedlen"]
 *         dflt = data["dflt"]
 *         return (shape, cparams, dtype_, dflt, expectedlen, cbytes, chunklen)             # <<<<<<<<<<<<<<
 * 
 *     def _store_obj(self, object arrobj):
 */
  __Pyx_TraceLine(1393,0,__PYX_ERR(0, 1393, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_shape);
  __Pyx_GIVEREF(__pyx_v_shape);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_shape);
  __Pyx_INCREF(__pyx_v_cparams);
  __Pyx_GIVEREF(__pyx_v_cparams);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_cparams);
  __Pyx_INCREF(__pyx_v_dtype_);
  __Pyx_GIVEREF(__pyx_v_dtype_);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_dtype_);
  __Pyx_INCREF(__pyx_v_dflt);
  __Pyx_GIVEREF(__pyx_v_dflt);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_dflt);
  __Pyx_INCREF(__pyx_v_expectedlen);
  __Pyx_GIVEREF(__pyx_v_expectedlen);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_expectedlen);
  __Pyx_INCREF(__pyx_v_cbytes);
  __Pyx_GIVEREF(__pyx_v_cbytes);
  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_v_cbytes);
  __Pyx_INCREF(__pyx_v_chunklen);
  __Pyx_GIVEREF(__pyx_v_chunklen);
  PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_v_chunklen);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1363
 *             storagefh.write(b"\n")
 * 
 *     def _read_meta(self):             # <<<<<<<<<<<<<<
 *         """Read persistent metadata."""
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._read_meta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_metadir);
  __Pyx_XDECREF(__pyx_v_shapef);
  __Pyx_XDECREF(__pyx_v_shapefh);
  __Pyx_XDECREF(__pyx_v_sizes);
  __Pyx_XDECREF(__pyx_v_shape);
  __Pyx_XDECREF(__pyx_v_nbytes);
  __Pyx_XDECREF(__pyx_v_cbytes);
  __Pyx_XDECREF(__pyx_v_storagef);
  __Pyx_XDECREF(__pyx_v_storagefh);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_dtype_);
  __Pyx_XDECREF(__pyx_v_chunklen);
  __Pyx_XDECREF(__pyx_v_cparams);
  __Pyx_XDECREF(__pyx_v_cname);
  __Pyx_XDECREF(__pyx_v_quantize);
  __Pyx_XDECREF(__pyx_v_expectedlen);
  __Pyx_XDECREF(__pyx_v_dflt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1395
 *         return (shape, cparams, dtype_, dflt, expectedlen, cbytes, chunklen)
 * 
 *     def _store_obj(self, object arrobj):             # <<<<<<<<<<<<<<
 *         cdef chunk chunk_
 *         import pickle
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_15_store_obj(PyObject *__pyx_v_self, PyObject *__pyx_v_arrobj); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_14_store_obj[] = "carray._store_obj(self, arrobj)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_15_store_obj(PyObject *__pyx_v_self, PyObject *__pyx_v_arrobj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_store_obj (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_14_store_obj(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_arrobj));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_14_store_obj(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_arrobj) {
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = 0;
  PyObject *__pyx_v_pickle = NULL;
  PyObject *__pyx_v_pick_obj = NULL;
  PyObject *__pyx_v_nbytes = NULL;
  PyObject *__pyx_v_cbytes = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  npy_intp __pyx_t_9;
  __Pyx_RefNannySetupContext("_store_obj", 0);
  __Pyx_TraceCall("_store_obj", __pyx_f[0], 1395, 0, __PYX_ERR(0, 1395, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1397
 *     def _store_obj(self, object arrobj):
 *         cdef chunk chunk_
 *         import pickle             # <<<<<<<<<<<<<<
 * 
 *         pick_obj = pickle.dumps(arrobj, pickle.HIGHEST_PROTOCOL)
 */
  __Pyx_TraceLine(1397,0,__PYX_ERR(0, 1397, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pickle, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pickle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1399
 *         import pickle
 * 
 *         pick_obj = pickle.dumps(arrobj, pickle.HIGHEST_PROTOCOL)             # <<<<<<<<<<<<<<
 *         chunk_ = chunk(pick_obj, np.dtype('O'), self._cparams,
 *                        _memory=self._rootdir is None)
 */
  __Pyx_TraceLine(1399,0,__PYX_ERR(0, 1399, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pickle, __pyx_n_s_dumps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pickle, __pyx_n_s_HIGHEST_PROTOCOL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_arrobj);
  __Pyx_GIVEREF(__pyx_v_arrobj);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_arrobj);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_pick_obj = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1400
 * 
 *         pick_obj = pickle.dumps(arrobj, pickle.HIGHEST_PROTOCOL)
 *         chunk_ = chunk(pick_obj, np.dtype('O'), self._cparams,             # <<<<<<<<<<<<<<
 *                        _memory=self._rootdir is None)
 * 
 */
  __Pyx_TraceLine(1400,0,__PYX_ERR(0, 1400, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_pick_obj);
  __Pyx_GIVEREF(__pyx_v_pick_obj);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pick_obj);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->_cparams);
  __Pyx_GIVEREF(__pyx_v_self->_cparams);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_self->_cparams);
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1401
 *         pick_obj = pickle.dumps(arrobj, pickle.HIGHEST_PROTOCOL)
 *         chunk_ = chunk(pick_obj, np.dtype('O'), self._cparams,
 *                        _memory=self._rootdir is None)             # <<<<<<<<<<<<<<
 * 
 *         self.chunks.append(chunk_)
 */
  __Pyx_TraceLine(1401,0,__PYX_ERR(0, 1401, __pyx_L1_error))
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = (__pyx_v_self->_rootdir == Py_None);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_memory, __pyx_t_6) < 0) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1400
 * 
 *         pick_obj = pickle.dumps(arrobj, pickle.HIGHEST_PROTOCOL)
 *         chunk_ = chunk(pick_obj, np.dtype('O'), self._cparams,             # <<<<<<<<<<<<<<
 *                        _memory=self._rootdir is None)
 * 
 */
  __Pyx_TraceLine(1400,0,__PYX_ERR(0, 1400, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_chunk_ = ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1403
 *                        _memory=self._rootdir is None)
 * 
 *         self.chunks.append(chunk_)             # <<<<<<<<<<<<<<
 *         # Update some counters
 *         nbytes, cbytes = chunk_.nbytes, chunk_.cbytes
 */
  __Pyx_TraceLine(1403,0,__PYX_ERR(0, 1403, __pyx_L1_error))
  __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_self->chunks, ((PyObject *)__pyx_v_chunk_)); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 1403, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":1405
 *         self.chunks.append(chunk_)
 *         # Update some counters
 *         nbytes, cbytes = chunk_.nbytes, chunk_.cbytes             # <<<<<<<<<<<<<<
 *         self._cbytes += cbytes
 *         self._nbytes += nbytes
 */
  __Pyx_TraceLine(1405,0,__PYX_ERR(0, 1405, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_chunk_->nbytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_chunk_->cbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nbytes = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_cbytes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1406
 *         # Update some counters
 *         nbytes, cbytes = chunk_.nbytes, chunk_.cbytes
 *         self._cbytes += cbytes             # <<<<<<<<<<<<<<
 *         self._nbytes += nbytes
 * 
 */
  __Pyx_TraceLine(1406,0,__PYX_ERR(0, 1406, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_cbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_cbytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_self->_cbytes = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":1407
 *         nbytes, cbytes = chunk_.nbytes, chunk_.cbytes
 *         self._cbytes += cbytes
 *         self._nbytes += nbytes             # <<<<<<<<<<<<<<
 * 
 *     def append(self, object array):
 */
  __Pyx_TraceLine(1407,0,__PYX_ERR(0, 1407, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_nbytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_nbytes = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":1395
 *         return (shape, cparams, dtype_, dflt, expectedlen, cbytes, chunklen)
 * 
 *     def _store_obj(self, object arrobj):             # <<<<<<<<<<<<<<
 *         cdef chunk chunk_
 *         import pickle
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._store_obj", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_XDECREF(__pyx_v_pickle);
  __Pyx_XDECREF(__pyx_v_pick_obj);
  __Pyx_XDECREF(__pyx_v_nbytes);
  __Pyx_XDECREF(__pyx_v_cbytes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1409
 *         self._nbytes += nbytes
 * 
 *     def append(self, object array):             # <<<<<<<<<<<<<<
 *         """Append a numpy `array` to this instance.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_17append(PyObject *__pyx_v_self, PyObject *__pyx_v_array); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_16append[] = "carray.append(self, array)\nAppend a numpy `array` to this instance.\n\n        Parameters\n        ----------\n        array : NumPy-like object\n            The array to be appended.  Must be compatible with shape and\n            type of\n            the carray.\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_17append(PyObject *__pyx_v_self, PyObject *__pyx_v_array) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_16append(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_array));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_16append(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_array) {
  int __pyx_v_atomsize;
  int __pyx_v_itemsize;
  int __pyx_v_chunksize;
  int __pyx_v_leftover;
  int __pyx_v_nbytesfirst;
  int __pyx_v_chunklen;
  int __pyx_v_start;
  int __pyx_v_stop;
  npy_intp __pyx_v_nbytes;
  npy_intp __pyx_v_cbytes;
  npy_intp __pyx_v_bsize;
  npy_intp __pyx_v_i;
  npy_intp __pyx_v_nchunks;
  npy_intp __pyx_v_j;
  PyArrayObject *__pyx_v_remainder = 0;
  PyArrayObject *__pyx_v_arrcpy = 0;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = 0;
  PyObject *__pyx_v_chunks = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  npy_intp __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("append", 0);
  __Pyx_TraceCall("append", __pyx_f[0], 1409, 0, __PYX_ERR(0, 1409, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1426
 *         cdef chunk chunk_
 * 
 *         if self.safe:             # <<<<<<<<<<<<<<
 *             if self.mode == "r":
 *                 raise IOError(
 */
  __Pyx_TraceLine(1426,0,__PYX_ERR(0, 1426, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_safe); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1426, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1427
 * 
 *         if self.safe:
 *             if self.mode == "r":             # <<<<<<<<<<<<<<
 *                 raise IOError(
 *                     "cannot modify data because mode is '%s'" % self.mode)
 */
    __Pyx_TraceLine(1427,0,__PYX_ERR(0, 1427, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1427, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1429
 *             if self.mode == "r":
 *                 raise IOError(
 *                     "cannot modify data because mode is '%s'" % self.mode)             # <<<<<<<<<<<<<<
 * 
 *             arrcpy = utils.to_ndarray(array, self._dtype, safe=self._safe)
 */
      __Pyx_TraceLine(1429,0,__PYX_ERR(0, 1429, __pyx_L1_error))
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_cannot_modify_data_because_mode, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":1428
 *         if self.safe:
 *             if self.mode == "r":
 *                 raise IOError(             # <<<<<<<<<<<<<<
 *                     "cannot modify data because mode is '%s'" % self.mode)
 * 
 */
      __Pyx_TraceLine(1428,0,__PYX_ERR(0, 1428, __pyx_L1_error))
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1428, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1428, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1427
 * 
 *         if self.safe:
 *             if self.mode == "r":             # <<<<<<<<<<<<<<
 *                 raise IOError(
 *                     "cannot modify data because mode is '%s'" % self.mode)
 */
    }

    /* "bcolz/carray_ext.pyx":1431
 *                     "cannot modify data because mode is '%s'" % self.mode)
 * 
 *             arrcpy = utils.to_ndarray(array, self._dtype, safe=self._safe)             # <<<<<<<<<<<<<<
 *             if arrcpy.dtype != self._dtype.base:
 *                 raise TypeError("array dtype does not match with self")
 */
    __Pyx_TraceLine(1431,0,__PYX_ERR(0, 1431, __pyx_L1_error))
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_to_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_array);
    __Pyx_GIVEREF(__pyx_v_array);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_array);
    __Pyx_INCREF(__pyx_v_self->_dtype);
    __Pyx_GIVEREF(__pyx_v_self->_dtype);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->_dtype);
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_safe, __pyx_v_self->_safe) < 0) __PYX_ERR(0, 1431, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1431, __pyx_L1_error)
    __pyx_v_arrcpy = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1432
 * 
 *             arrcpy = utils.to_ndarray(array, self._dtype, safe=self._safe)
 *             if arrcpy.dtype != self._dtype.base:             # <<<<<<<<<<<<<<
 *                 raise TypeError("array dtype does not match with self")
 * 
 */
    __Pyx_TraceLine(1432,0,__PYX_ERR(0, 1432, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arrcpy), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1432, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1432, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1433
 *             arrcpy = utils.to_ndarray(array, self._dtype, safe=self._safe)
 *             if arrcpy.dtype != self._dtype.base:
 *                 raise TypeError("array dtype does not match with self")             # <<<<<<<<<<<<<<
 * 
 *             # Object dtype requires special storage
 */
      __Pyx_TraceLine(1433,0,__PYX_ERR(0, 1433, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1433, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1432
 * 
 *             arrcpy = utils.to_ndarray(array, self._dtype, safe=self._safe)
 *             if arrcpy.dtype != self._dtype.base:             # <<<<<<<<<<<<<<
 *                 raise TypeError("array dtype does not match with self")
 * 
 */
    }

    /* "bcolz/carray_ext.pyx":1436
 * 
 *             # Object dtype requires special storage
 *             if arrcpy.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *                 for j in range(len(arrcpy)):
 *                     self._store_obj(arrcpy[j])
 */
    __Pyx_TraceLine(1436,0,__PYX_ERR(0, 1436, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arrcpy), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_char); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1436, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1437
 *             # Object dtype requires special storage
 *             if arrcpy.dtype.char == 'O':
 *                 for j in range(len(arrcpy)):             # <<<<<<<<<<<<<<
 *                     self._store_obj(arrcpy[j])
 *                 return
 */
      __Pyx_TraceLine(1437,0,__PYX_ERR(0, 1437, __pyx_L1_error))
      __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_arrcpy)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1437, __pyx_L1_error)
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_j = __pyx_t_7;

        /* "bcolz/carray_ext.pyx":1438
 *             if arrcpy.dtype.char == 'O':
 *                 for j in range(len(arrcpy)):
 *                     self._store_obj(arrcpy[j])             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
        __Pyx_TraceLine(1438,0,__PYX_ERR(0, 1438, __pyx_L1_error))
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_store_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arrcpy), __pyx_v_j, npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1438, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1438, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }

      /* "bcolz/carray_ext.pyx":1439
 *                 for j in range(len(arrcpy)):
 *                     self._store_obj(arrcpy[j])
 *                 return             # <<<<<<<<<<<<<<
 * 
 *             # Appending a single row should be supported
 */
      __Pyx_TraceLine(1439,0,__PYX_ERR(0, 1439, __pyx_L1_error))
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":1436
 * 
 *             # Object dtype requires special storage
 *             if arrcpy.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *                 for j in range(len(arrcpy)):
 *                     self._store_obj(arrcpy[j])
 */
    }

    /* "bcolz/carray_ext.pyx":1442
 * 
 *             # Appending a single row should be supported
 *             if np.shape(arrcpy) == self._dtype.shape:             # <<<<<<<<<<<<<<
 *                 arrcpy = arrcpy.reshape((1,) + np.shape(arrcpy))
 *             if np.shape(arrcpy)[1:] != self._dtype.shape:
 */
    __Pyx_TraceLine(1442,0,__PYX_ERR(0, 1442, __pyx_L1_error))
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_v_arrcpy)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_arrcpy));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_arrcpy));
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_arrcpy));
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1442, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1442, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1443
 *             # Appending a single row should be supported
 *             if np.shape(arrcpy) == self._dtype.shape:
 *                 arrcpy = arrcpy.reshape((1,) + np.shape(arrcpy))             # <<<<<<<<<<<<<<
 *             if np.shape(arrcpy)[1:] != self._dtype.shape:
 *                 raise ValueError(
 */
      __Pyx_TraceLine(1443,0,__PYX_ERR(0, 1443, __pyx_L1_error))
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arrcpy), __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_arrcpy)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1443, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1443, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_arrcpy));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_arrcpy));
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, ((PyObject *)__pyx_v_arrcpy));
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1443, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_tuple__56, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1443, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1443, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1443, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1443, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_arrcpy, ((PyArrayObject *)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":1442
 * 
 *             # Appending a single row should be supported
 *             if np.shape(arrcpy) == self._dtype.shape:             # <<<<<<<<<<<<<<
 *                 arrcpy = arrcpy.reshape((1,) + np.shape(arrcpy))
 *             if np.shape(arrcpy)[1:] != self._dtype.shape:
 */
    }

    /* "bcolz/carray_ext.pyx":1444
 *             if np.shape(arrcpy) == self._dtype.shape:
 *                 arrcpy = arrcpy.reshape((1,) + np.shape(arrcpy))
 *             if np.shape(arrcpy)[1:] != self._dtype.shape:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "array trailing dimensions do not match with self")
 */
    __Pyx_TraceLine(1444,0,__PYX_ERR(0, 1444, __pyx_L1_error))
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_v_arrcpy)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_arrcpy));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_arrcpy));
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_arrcpy));
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_slice__57, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_9, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1445
 *                 arrcpy = arrcpy.reshape((1,) + np.shape(arrcpy))
 *             if np.shape(arrcpy)[1:] != self._dtype.shape:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "array trailing dimensions do not match with self")
 *         else:
 */
      __Pyx_TraceLine(1445,0,__PYX_ERR(0, 1445, __pyx_L1_error))
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 1445, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1444
 *             if np.shape(arrcpy) == self._dtype.shape:
 *                 arrcpy = arrcpy.reshape((1,) + np.shape(arrcpy))
 *             if np.shape(arrcpy)[1:] != self._dtype.shape:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "array trailing dimensions do not match with self")
 */
    }

    /* "bcolz/carray_ext.pyx":1426
 *         cdef chunk chunk_
 * 
 *         if self.safe:             # <<<<<<<<<<<<<<
 *             if self.mode == "r":
 *                 raise IOError(
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":1448
 *                     "array trailing dimensions do not match with self")
 *         else:
 *             arrcpy = array             # <<<<<<<<<<<<<<
 * 
 *         atomsize = self.atomsize
 */
  __Pyx_TraceLine(1448,0,__PYX_ERR(0, 1448, __pyx_L1_error))
  /*else*/ {
    if (!(likely(((__pyx_v_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_array, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1448, __pyx_L1_error)
    __pyx_t_1 = __pyx_v_array;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v_arrcpy = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":1450
 *             arrcpy = array
 * 
 *         atomsize = self.atomsize             # <<<<<<<<<<<<<<
 *         itemsize = self.itemsize
 *         chunksize = self._chunksize
 */
  __Pyx_TraceLine(1450,0,__PYX_ERR(0, 1450, __pyx_L1_error))
  __pyx_t_10 = __pyx_v_self->atomsize;
  __pyx_v_atomsize = __pyx_t_10;

  /* "bcolz/carray_ext.pyx":1451
 * 
 *         atomsize = self.atomsize
 *         itemsize = self.itemsize             # <<<<<<<<<<<<<<
 *         chunksize = self._chunksize
 *         chunks = self.chunks
 */
  __Pyx_TraceLine(1451,0,__PYX_ERR(0, 1451, __pyx_L1_error))
  __pyx_t_10 = __pyx_v_self->itemsize;
  __pyx_v_itemsize = __pyx_t_10;

  /* "bcolz/carray_ext.pyx":1452
 *         atomsize = self.atomsize
 *         itemsize = self.itemsize
 *         chunksize = self._chunksize             # <<<<<<<<<<<<<<
 *         chunks = self.chunks
 *         leftover = self.leftover
 */
  __Pyx_TraceLine(1452,0,__PYX_ERR(0, 1452, __pyx_L1_error))
  __pyx_t_10 = __pyx_v_self->_chunksize;
  __pyx_v_chunksize = __pyx_t_10;

  /* "bcolz/carray_ext.pyx":1453
 *         itemsize = self.itemsize
 *         chunksize = self._chunksize
 *         chunks = self.chunks             # <<<<<<<<<<<<<<
 *         leftover = self.leftover
 *         bsize = arrcpy.size * itemsize
 */
  __Pyx_TraceLine(1453,0,__PYX_ERR(0, 1453, __pyx_L1_error))
  __pyx_t_1 = __pyx_v_self->chunks;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_chunks = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1454
 *         chunksize = self._chunksize
 *         chunks = self.chunks
 *         leftover = self.leftover             # <<<<<<<<<<<<<<
 *         bsize = arrcpy.size * itemsize
 *         cbytes = 0
 */
  __Pyx_TraceLine(1454,0,__PYX_ERR(0, 1454, __pyx_L1_error))
  __pyx_t_10 = __pyx_v_self->leftover;
  __pyx_v_leftover = __pyx_t_10;

  /* "bcolz/carray_ext.pyx":1455
 *         chunks = self.chunks
 *         leftover = self.leftover
 *         bsize = arrcpy.size * itemsize             # <<<<<<<<<<<<<<
 *         cbytes = 0
 * 
 */
  __Pyx_TraceLine(1455,0,__PYX_ERR(0, 1455, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arrcpy), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_itemsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = PyNumber_Multiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_9); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_v_bsize = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1456
 *         leftover = self.leftover
 *         bsize = arrcpy.size * itemsize
 *         cbytes = 0             # <<<<<<<<<<<<<<
 * 
 *         # Check if array fits in existing buffer
 */
  __Pyx_TraceLine(1456,0,__PYX_ERR(0, 1456, __pyx_L1_error))
  __pyx_v_cbytes = 0;

  /* "bcolz/carray_ext.pyx":1459
 * 
 *         # Check if array fits in existing buffer
 *         if (bsize + leftover) < chunksize:             # <<<<<<<<<<<<<<
 *             # Data fits in lastchunk buffer.  Just copy it
 *             if arrcpy.strides[0] > 0:
 */
  __Pyx_TraceLine(1459,0,__PYX_ERR(0, 1459, __pyx_L1_error))
  __pyx_t_2 = (((__pyx_v_bsize + __pyx_v_leftover) < __pyx_v_chunksize) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1461
 *         if (bsize + leftover) < chunksize:
 *             # Data fits in lastchunk buffer.  Just copy it
 *             if arrcpy.strides[0] > 0:             # <<<<<<<<<<<<<<
 *                 memcpy(self.lastchunk + leftover, arrcpy.data, bsize)
 *             else:
 */
    __Pyx_TraceLine(1461,0,__PYX_ERR(0, 1461, __pyx_L1_error))
    __pyx_t_2 = (((__pyx_v_arrcpy->strides[0]) > 0) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1462
 *             # Data fits in lastchunk buffer.  Just copy it
 *             if arrcpy.strides[0] > 0:
 *                 memcpy(self.lastchunk + leftover, arrcpy.data, bsize)             # <<<<<<<<<<<<<<
 *             else:
 *                 start = cython.cdiv(leftover, atomsize)
 */
      __Pyx_TraceLine(1462,0,__PYX_ERR(0, 1462, __pyx_L1_error))
      memcpy((__pyx_v_self->lastchunk + __pyx_v_leftover), __pyx_v_arrcpy->data, __pyx_v_bsize);

      /* "bcolz/carray_ext.pyx":1461
 *         if (bsize + leftover) < chunksize:
 *             # Data fits in lastchunk buffer.  Just copy it
 *             if arrcpy.strides[0] > 0:             # <<<<<<<<<<<<<<
 *                 memcpy(self.lastchunk + leftover, arrcpy.data, bsize)
 *             else:
 */
      goto __pyx_L12;
    }

    /* "bcolz/carray_ext.pyx":1464
 *                 memcpy(self.lastchunk + leftover, arrcpy.data, bsize)
 *             else:
 *                 start = cython.cdiv(leftover, atomsize)             # <<<<<<<<<<<<<<
 *                 stop = cython.cdiv((leftover + bsize), atomsize)
 *                 self.lastchunkarr[start:stop] = arrcpy
 */
    __Pyx_TraceLine(1464,0,__PYX_ERR(0, 1464, __pyx_L1_error))
    /*else*/ {
      __pyx_v_start = (__pyx_v_leftover / __pyx_v_atomsize);

      /* "bcolz/carray_ext.pyx":1465
 *             else:
 *                 start = cython.cdiv(leftover, atomsize)
 *                 stop = cython.cdiv((leftover + bsize), atomsize)             # <<<<<<<<<<<<<<
 *                 self.lastchunkarr[start:stop] = arrcpy
 *             leftover += bsize
 */
      __Pyx_TraceLine(1465,0,__PYX_ERR(0, 1465, __pyx_L1_error))
      __pyx_v_stop = ((__pyx_v_leftover + __pyx_v_bsize) / __pyx_v_atomsize);

      /* "bcolz/carray_ext.pyx":1466
 *                 start = cython.cdiv(leftover, atomsize)
 *                 stop = cython.cdiv((leftover + bsize), atomsize)
 *                 self.lastchunkarr[start:stop] = arrcpy             # <<<<<<<<<<<<<<
 *             leftover += bsize
 *         else:
 */
      __Pyx_TraceLine(1466,0,__PYX_ERR(0, 1466, __pyx_L1_error))
      if (__Pyx_PyObject_SetSlice(__pyx_v_self->lastchunkarr, ((PyObject *)__pyx_v_arrcpy), __pyx_v_start, __pyx_v_stop, NULL, NULL, NULL, 1, 1, 1) < 0) __PYX_ERR(0, 1466, __pyx_L1_error)
    }
    __pyx_L12:;

    /* "bcolz/carray_ext.pyx":1467
 *                 stop = cython.cdiv((leftover + bsize), atomsize)
 *                 self.lastchunkarr[start:stop] = arrcpy
 *             leftover += bsize             # <<<<<<<<<<<<<<
 *         else:
 *             # Data does not fit in buffer.  Break it in chunks.
 */
    __Pyx_TraceLine(1467,0,__PYX_ERR(0, 1467, __pyx_L1_error))
    __pyx_v_leftover = (__pyx_v_leftover + __pyx_v_bsize);

    /* "bcolz/carray_ext.pyx":1459
 * 
 *         # Check if array fits in existing buffer
 *         if (bsize + leftover) < chunksize:             # <<<<<<<<<<<<<<
 *             # Data fits in lastchunk buffer.  Just copy it
 *             if arrcpy.strides[0] > 0:
 */
    goto __pyx_L11;
  }

  /* "bcolz/carray_ext.pyx":1472
 * 
 *             # First, fill the last buffer completely (if needed)
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 nbytesfirst = chunksize - leftover
 *                 if arrcpy.strides[0] > 0:
 */
  __Pyx_TraceLine(1472,0,__PYX_ERR(0, 1472, __pyx_L1_error))
  /*else*/ {
    __pyx_t_2 = (__pyx_v_leftover != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1473
 *             # First, fill the last buffer completely (if needed)
 *             if leftover:
 *                 nbytesfirst = chunksize - leftover             # <<<<<<<<<<<<<<
 *                 if arrcpy.strides[0] > 0:
 *                     memcpy(self.lastchunk + leftover, arrcpy.data, nbytesfirst)
 */
      __Pyx_TraceLine(1473,0,__PYX_ERR(0, 1473, __pyx_L1_error))
      __pyx_v_nbytesfirst = (__pyx_v_chunksize - __pyx_v_leftover);

      /* "bcolz/carray_ext.pyx":1474
 *             if leftover:
 *                 nbytesfirst = chunksize - leftover
 *                 if arrcpy.strides[0] > 0:             # <<<<<<<<<<<<<<
 *                     memcpy(self.lastchunk + leftover, arrcpy.data, nbytesfirst)
 *                 else:
 */
      __Pyx_TraceLine(1474,0,__PYX_ERR(0, 1474, __pyx_L1_error))
      __pyx_t_2 = (((__pyx_v_arrcpy->strides[0]) > 0) != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":1475
 *                 nbytesfirst = chunksize - leftover
 *                 if arrcpy.strides[0] > 0:
 *                     memcpy(self.lastchunk + leftover, arrcpy.data, nbytesfirst)             # <<<<<<<<<<<<<<
 *                 else:
 *                     start = cython.cdiv(leftover, atomsize)
 */
        __Pyx_TraceLine(1475,0,__PYX_ERR(0, 1475, __pyx_L1_error))
        memcpy((__pyx_v_self->lastchunk + __pyx_v_leftover), __pyx_v_arrcpy->data, __pyx_v_nbytesfirst);

        /* "bcolz/carray_ext.pyx":1474
 *             if leftover:
 *                 nbytesfirst = chunksize - leftover
 *                 if arrcpy.strides[0] > 0:             # <<<<<<<<<<<<<<
 *                     memcpy(self.lastchunk + leftover, arrcpy.data, nbytesfirst)
 *                 else:
 */
        goto __pyx_L14;
      }

      /* "bcolz/carray_ext.pyx":1477
 *                     memcpy(self.lastchunk + leftover, arrcpy.data, nbytesfirst)
 *                 else:
 *                     start = cython.cdiv(leftover, atomsize)             # <<<<<<<<<<<<<<
 *                     stop = cython.cdiv((leftover + nbytesfirst), atomsize)
 *                     self.lastchunkarr[start:stop] = arrcpy[start:stop]
 */
      __Pyx_TraceLine(1477,0,__PYX_ERR(0, 1477, __pyx_L1_error))
      /*else*/ {
        __pyx_v_start = (__pyx_v_leftover / __pyx_v_atomsize);

        /* "bcolz/carray_ext.pyx":1478
 *                 else:
 *                     start = cython.cdiv(leftover, atomsize)
 *                     stop = cython.cdiv((leftover + nbytesfirst), atomsize)             # <<<<<<<<<<<<<<
 *                     self.lastchunkarr[start:stop] = arrcpy[start:stop]
 *                 # Compress the last chunk and add it to the list
 */
        __Pyx_TraceLine(1478,0,__PYX_ERR(0, 1478, __pyx_L1_error))
        __pyx_v_stop = ((__pyx_v_leftover + __pyx_v_nbytesfirst) / __pyx_v_atomsize);

        /* "bcolz/carray_ext.pyx":1479
 *                     start = cython.cdiv(leftover, atomsize)
 *                     stop = cython.cdiv((leftover + nbytesfirst), atomsize)
 *                     self.lastchunkarr[start:stop] = arrcpy[start:stop]             # <<<<<<<<<<<<<<
 *                 # Compress the last chunk and add it to the list
 *                 chunk_ = chunk(self.lastchunkarr, self._dtype, self._cparams,
 */
        __Pyx_TraceLine(1479,0,__PYX_ERR(0, 1479, __pyx_L1_error))
        __pyx_t_9 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_arrcpy), __pyx_v_start, __pyx_v_stop, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1479, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_PyObject_SetSlice(__pyx_v_self->lastchunkarr, __pyx_t_9, __pyx_v_start, __pyx_v_stop, NULL, NULL, NULL, 1, 1, 1) < 0) __PYX_ERR(0, 1479, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_L14:;

      /* "bcolz/carray_ext.pyx":1481
 *                     self.lastchunkarr[start:stop] = arrcpy[start:stop]
 *                 # Compress the last chunk and add it to the list
 *                 chunk_ = chunk(self.lastchunkarr, self._dtype, self._cparams,             # <<<<<<<<<<<<<<
 *                                _memory=self._rootdir is None)
 *                 chunks.append(chunk_)
 */
      __Pyx_TraceLine(1481,0,__PYX_ERR(0, 1481, __pyx_L1_error))
      __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_self->lastchunkarr);
      __Pyx_GIVEREF(__pyx_v_self->lastchunkarr);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_self->lastchunkarr);
      __Pyx_INCREF(__pyx_v_self->_dtype);
      __Pyx_GIVEREF(__pyx_v_self->_dtype);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_self->_dtype);
      __Pyx_INCREF(__pyx_v_self->_cparams);
      __Pyx_GIVEREF(__pyx_v_self->_cparams);
      PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_self->_cparams);

      /* "bcolz/carray_ext.pyx":1482
 *                 # Compress the last chunk and add it to the list
 *                 chunk_ = chunk(self.lastchunkarr, self._dtype, self._cparams,
 *                                _memory=self._rootdir is None)             # <<<<<<<<<<<<<<
 *                 chunks.append(chunk_)
 *                 cbytes = chunk_.cbytes
 */
      __Pyx_TraceLine(1482,0,__PYX_ERR(0, 1482, __pyx_L1_error))
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1482, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = (__pyx_v_self->_rootdir == Py_None);
      __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory, __pyx_t_1) < 0) __PYX_ERR(0, 1482, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":1481
 *                     self.lastchunkarr[start:stop] = arrcpy[start:stop]
 *                 # Compress the last chunk and add it to the list
 *                 chunk_ = chunk(self.lastchunkarr, self._dtype, self._cparams,             # <<<<<<<<<<<<<<
 *                                _memory=self._rootdir is None)
 *                 chunks.append(chunk_)
 */
      __Pyx_TraceLine(1481,0,__PYX_ERR(0, 1481, __pyx_L1_error))
      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_chunk_ = ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":1483
 *                 chunk_ = chunk(self.lastchunkarr, self._dtype, self._cparams,
 *                                _memory=self._rootdir is None)
 *                 chunks.append(chunk_)             # <<<<<<<<<<<<<<
 *                 cbytes = chunk_.cbytes
 *             else:
 */
      __Pyx_TraceLine(1483,0,__PYX_ERR(0, 1483, __pyx_L1_error))
      __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_chunks, ((PyObject *)__pyx_v_chunk_)); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1483, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1484
 *                                _memory=self._rootdir is None)
 *                 chunks.append(chunk_)
 *                 cbytes = chunk_.cbytes             # <<<<<<<<<<<<<<
 *             else:
 *                 nbytesfirst = 0
 */
      __Pyx_TraceLine(1484,0,__PYX_ERR(0, 1484, __pyx_L1_error))
      __pyx_t_10 = __pyx_v_chunk_->cbytes;
      __pyx_v_cbytes = __pyx_t_10;

      /* "bcolz/carray_ext.pyx":1472
 * 
 *             # First, fill the last buffer completely (if needed)
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 nbytesfirst = chunksize - leftover
 *                 if arrcpy.strides[0] > 0:
 */
      goto __pyx_L13;
    }

    /* "bcolz/carray_ext.pyx":1486
 *                 cbytes = chunk_.cbytes
 *             else:
 *                 nbytesfirst = 0             # <<<<<<<<<<<<<<
 * 
 *             # Then fill other possible chunks
 */
    __Pyx_TraceLine(1486,0,__PYX_ERR(0, 1486, __pyx_L1_error))
    /*else*/ {
      __pyx_v_nbytesfirst = 0;
    }
    __pyx_L13:;

    /* "bcolz/carray_ext.pyx":1489
 * 
 *             # Then fill other possible chunks
 *             nbytes = bsize - nbytesfirst             # <<<<<<<<<<<<<<
 *             nchunks = <npy_intp> cython.cdiv(nbytes, chunksize)
 *             chunklen = self._chunklen
 */
    __Pyx_TraceLine(1489,0,__PYX_ERR(0, 1489, __pyx_L1_error))
    __pyx_v_nbytes = (__pyx_v_bsize - __pyx_v_nbytesfirst);

    /* "bcolz/carray_ext.pyx":1490
 *             # Then fill other possible chunks
 *             nbytes = bsize - nbytesfirst
 *             nchunks = <npy_intp> cython.cdiv(nbytes, chunksize)             # <<<<<<<<<<<<<<
 *             chunklen = self._chunklen
 *             # Get a new view skipping the elements that have been already
 */
    __Pyx_TraceLine(1490,0,__PYX_ERR(0, 1490, __pyx_L1_error))
    __pyx_v_nchunks = ((npy_intp)(__pyx_v_nbytes / __pyx_v_chunksize));

    /* "bcolz/carray_ext.pyx":1491
 *             nbytes = bsize - nbytesfirst
 *             nchunks = <npy_intp> cython.cdiv(nbytes, chunksize)
 *             chunklen = self._chunklen             # <<<<<<<<<<<<<<
 *             # Get a new view skipping the elements that have been already
 *             # copied
 */
    __Pyx_TraceLine(1491,0,__PYX_ERR(0, 1491, __pyx_L1_error))
    __pyx_t_10 = __pyx_v_self->_chunklen;
    __pyx_v_chunklen = __pyx_t_10;

    /* "bcolz/carray_ext.pyx":1494
 *             # Get a new view skipping the elements that have been already
 *             # copied
 *             remainder = arrcpy[cython.cdiv(nbytesfirst, atomsize):]             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < nchunks:
 *                 chunk_ = chunk(
 */
    __Pyx_TraceLine(1494,0,__PYX_ERR(0, 1494, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_arrcpy), (__pyx_v_nbytesfirst / __pyx_v_atomsize), 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1494, __pyx_L1_error)
    __pyx_v_remainder = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1495
 *             # copied
 *             remainder = arrcpy[cython.cdiv(nbytesfirst, atomsize):]
 *             for i from 0 <= i < nchunks:             # <<<<<<<<<<<<<<
 *                 chunk_ = chunk(
 *                     remainder[i * chunklen:(i + 1) * chunklen], self._dtype,
 */
    __Pyx_TraceLine(1495,0,__PYX_ERR(0, 1495, __pyx_L1_error))
    __pyx_t_7 = __pyx_v_nchunks;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "bcolz/carray_ext.pyx":1497
 *             for i from 0 <= i < nchunks:
 *                 chunk_ = chunk(
 *                     remainder[i * chunklen:(i + 1) * chunklen], self._dtype,             # <<<<<<<<<<<<<<
 *                     self._cparams,
 *                     _memory=self._rootdir is None)
 */
      __Pyx_TraceLine(1497,0,__PYX_ERR(0, 1497, __pyx_L1_error))
      __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_remainder), (__pyx_v_i * __pyx_v_chunklen), ((__pyx_v_i + 1) * __pyx_v_chunklen), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1497, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "bcolz/carray_ext.pyx":1496
 *             remainder = arrcpy[cython.cdiv(nbytesfirst, atomsize):]
 *             for i from 0 <= i < nchunks:
 *                 chunk_ = chunk(             # <<<<<<<<<<<<<<
 *                     remainder[i * chunklen:(i + 1) * chunklen], self._dtype,
 *                     self._cparams,
 */
      __Pyx_TraceLine(1496,0,__PYX_ERR(0, 1496, __pyx_L1_error))
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1496, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __Pyx_INCREF(__pyx_v_self->_dtype);
      __Pyx_GIVEREF(__pyx_v_self->_dtype);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->_dtype);
      __Pyx_INCREF(__pyx_v_self->_cparams);
      __Pyx_GIVEREF(__pyx_v_self->_cparams);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_cparams);
      __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":1499
 *                     remainder[i * chunklen:(i + 1) * chunklen], self._dtype,
 *                     self._cparams,
 *                     _memory=self._rootdir is None)             # <<<<<<<<<<<<<<
 *                 chunks.append(chunk_)
 *                 cbytes += chunk_.cbytes
 */
      __Pyx_TraceLine(1499,0,__PYX_ERR(0, 1499, __pyx_L1_error))
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = (__pyx_v_self->_rootdir == Py_None);
      __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_memory, __pyx_t_9) < 0) __PYX_ERR(0, 1499, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "bcolz/carray_ext.pyx":1496
 *             remainder = arrcpy[cython.cdiv(nbytesfirst, atomsize):]
 *             for i from 0 <= i < nchunks:
 *                 chunk_ = chunk(             # <<<<<<<<<<<<<<
 *                     remainder[i * chunklen:(i + 1) * chunklen], self._dtype,
 *                     self._cparams,
 */
      __Pyx_TraceLine(1496,0,__PYX_ERR(0, 1496, __pyx_L1_error))
      __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1496, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_chunk_, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_9));
      __pyx_t_9 = 0;

      /* "bcolz/carray_ext.pyx":1500
 *                     self._cparams,
 *                     _memory=self._rootdir is None)
 *                 chunks.append(chunk_)             # <<<<<<<<<<<<<<
 *                 cbytes += chunk_.cbytes
 * 
 */
      __Pyx_TraceLine(1500,0,__PYX_ERR(0, 1500, __pyx_L1_error))
      __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_chunks, ((PyObject *)__pyx_v_chunk_)); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 1500, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1501
 *                     _memory=self._rootdir is None)
 *                 chunks.append(chunk_)
 *                 cbytes += chunk_.cbytes             # <<<<<<<<<<<<<<
 * 
 *             # Finally, deal with the leftover
 */
      __Pyx_TraceLine(1501,0,__PYX_ERR(0, 1501, __pyx_L1_error))
      __pyx_v_cbytes = (__pyx_v_cbytes + __pyx_v_chunk_->cbytes);
    }

    /* "bcolz/carray_ext.pyx":1504
 * 
 *             # Finally, deal with the leftover
 *             leftover = cython.cmod(nbytes, chunksize)             # <<<<<<<<<<<<<<
 *             if leftover:
 *                 remainder = remainder[nchunks * chunklen:]
 */
    __Pyx_TraceLine(1504,0,__PYX_ERR(0, 1504, __pyx_L1_error))
    __pyx_v_leftover = (__pyx_v_nbytes % __pyx_v_chunksize);

    /* "bcolz/carray_ext.pyx":1505
 *             # Finally, deal with the leftover
 *             leftover = cython.cmod(nbytes, chunksize)
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 remainder = remainder[nchunks * chunklen:]
 *                 if arrcpy.strides[0] > 0:
 */
    __Pyx_TraceLine(1505,0,__PYX_ERR(0, 1505, __pyx_L1_error))
    __pyx_t_2 = (__pyx_v_leftover != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1506
 *             leftover = cython.cmod(nbytes, chunksize)
 *             if leftover:
 *                 remainder = remainder[nchunks * chunklen:]             # <<<<<<<<<<<<<<
 *                 if arrcpy.strides[0] > 0:
 *                     memcpy(self.lastchunk, remainder.data, leftover)
 */
      __Pyx_TraceLine(1506,0,__PYX_ERR(0, 1506, __pyx_L1_error))
      __pyx_t_9 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_remainder), (__pyx_v_nchunks * __pyx_v_chunklen), 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1506, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1506, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_remainder, ((PyArrayObject *)__pyx_t_9));
      __pyx_t_9 = 0;

      /* "bcolz/carray_ext.pyx":1507
 *             if leftover:
 *                 remainder = remainder[nchunks * chunklen:]
 *                 if arrcpy.strides[0] > 0:             # <<<<<<<<<<<<<<
 *                     memcpy(self.lastchunk, remainder.data, leftover)
 *                 else:
 */
      __Pyx_TraceLine(1507,0,__PYX_ERR(0, 1507, __pyx_L1_error))
      __pyx_t_2 = (((__pyx_v_arrcpy->strides[0]) > 0) != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":1508
 *                 remainder = remainder[nchunks * chunklen:]
 *                 if arrcpy.strides[0] > 0:
 *                     memcpy(self.lastchunk, remainder.data, leftover)             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.lastchunkarr[:len(remainder)] = remainder
 */
        __Pyx_TraceLine(1508,0,__PYX_ERR(0, 1508, __pyx_L1_error))
        memcpy(__pyx_v_self->lastchunk, __pyx_v_remainder->data, __pyx_v_leftover);

        /* "bcolz/carray_ext.pyx":1507
 *             if leftover:
 *                 remainder = remainder[nchunks * chunklen:]
 *                 if arrcpy.strides[0] > 0:             # <<<<<<<<<<<<<<
 *                     memcpy(self.lastchunk, remainder.data, leftover)
 *                 else:
 */
        goto __pyx_L18;
      }

      /* "bcolz/carray_ext.pyx":1510
 *                     memcpy(self.lastchunk, remainder.data, leftover)
 *                 else:
 *                     self.lastchunkarr[:len(remainder)] = remainder             # <<<<<<<<<<<<<<
 * 
 *         # Update some counters
 */
      __Pyx_TraceLine(1510,0,__PYX_ERR(0, 1510, __pyx_L1_error))
      /*else*/ {
        __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_remainder)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1510, __pyx_L1_error)
        if (__Pyx_PyObject_SetSlice(__pyx_v_self->lastchunkarr, ((PyObject *)__pyx_v_remainder), 0, __pyx_t_6, NULL, NULL, NULL, 0, 1, 1) < 0) __PYX_ERR(0, 1510, __pyx_L1_error)
      }
      __pyx_L18:;

      /* "bcolz/carray_ext.pyx":1505
 *             # Finally, deal with the leftover
 *             leftover = cython.cmod(nbytes, chunksize)
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 remainder = remainder[nchunks * chunklen:]
 *                 if arrcpy.strides[0] > 0:
 */
    }
  }
  __pyx_L11:;

  /* "bcolz/carray_ext.pyx":1513
 * 
 *         # Update some counters
 *         self.leftover = leftover             # <<<<<<<<<<<<<<
 *         self._cbytes += cbytes
 *         self._nbytes += bsize
 */
  __Pyx_TraceLine(1513,0,__PYX_ERR(0, 1513, __pyx_L1_error))
  __pyx_v_self->leftover = __pyx_v_leftover;

  /* "bcolz/carray_ext.pyx":1514
 *         # Update some counters
 *         self.leftover = leftover
 *         self._cbytes += cbytes             # <<<<<<<<<<<<<<
 *         self._nbytes += bsize
 *         return
 */
  __Pyx_TraceLine(1514,0,__PYX_ERR(0, 1514, __pyx_L1_error))
  __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes + __pyx_v_cbytes);

  /* "bcolz/carray_ext.pyx":1515
 *         self.leftover = leftover
 *         self._cbytes += cbytes
 *         self._nbytes += bsize             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __Pyx_TraceLine(1515,0,__PYX_ERR(0, 1515, __pyx_L1_error))
  __pyx_v_self->_nbytes = (__pyx_v_self->_nbytes + __pyx_v_bsize);

  /* "bcolz/carray_ext.pyx":1516
 *         self._cbytes += cbytes
 *         self._nbytes += bsize
 *         return             # <<<<<<<<<<<<<<
 * 
 *     def trim(self, object nitems):
 */
  __Pyx_TraceLine(1516,0,__PYX_ERR(0, 1516, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1409
 *         self._nbytes += nbytes
 * 
 *     def append(self, object array):             # <<<<<<<<<<<<<<
 *         """Append a numpy `array` to this instance.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_remainder);
  __Pyx_XDECREF((PyObject *)__pyx_v_arrcpy);
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_XDECREF(__pyx_v_chunks);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1518
 *         return
 * 
 *     def trim(self, object nitems):             # <<<<<<<<<<<<<<
 *         """Remove the trailing `nitems` from this instance.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_19trim(PyObject *__pyx_v_self, PyObject *__pyx_v_nitems); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_18trim[] = "carray.trim(self, nitems)\nRemove the trailing `nitems` from this instance.\n\n        Parameters\n        ----------\n        nitems : int\n            The number of trailing items to be trimmed.  If negative,\n            the object\n            is enlarged instead.\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_19trim(PyObject *__pyx_v_self, PyObject *__pyx_v_nitems) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("trim (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_18trim(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_nitems));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_18trim(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_nitems) {
  int __pyx_v_atomsize;
  int __pyx_v_leftover;
  int __pyx_v_leftover2;
  npy_intp __pyx_v_cbytes;
  npy_intp __pyx_v_bsize;
  npy_intp __pyx_v_nchunk2;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = 0;
  PyObject *__pyx_v_chunks = NULL;
  PyObject *__pyx_v_nchunk = NULL;
  CYTHON_UNUSED npy_intp __pyx_v_lnchunk;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  npy_intp __pyx_t_9;
  __Pyx_RefNannySetupContext("trim", 0);
  __Pyx_TraceCall("trim", __pyx_f[0], 1518, 0, __PYX_ERR(0, 1518, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1533
 *         cdef chunk chunk_
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):             # <<<<<<<<<<<<<<
 *             raise TypeError("`nitems` must be an integer")
 * 
 */
  __Pyx_TraceLine(1533,0,__PYX_ERR(0, 1533, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyFloat_Type)));
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_nitems, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0);
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1534
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):
 *             raise TypeError("`nitems` must be an integer")             # <<<<<<<<<<<<<<
 * 
 *         # Check that we don't run out of space
 */
    __Pyx_TraceLine(1534,0,__PYX_ERR(0, 1534, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1534, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1533
 *         cdef chunk chunk_
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):             # <<<<<<<<<<<<<<
 *             raise TypeError("`nitems` must be an integer")
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1537
 * 
 *         # Check that we don't run out of space
 *         if nitems > self.len:             # <<<<<<<<<<<<<<
 *             raise ValueError("`nitems` must be less than total length")
 *         # A negative number of items means that we want to grow the object
 */
  __Pyx_TraceLine(1537,0,__PYX_ERR(0, 1537, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_nitems, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1538
 *         # Check that we don't run out of space
 *         if nitems > self.len:
 *             raise ValueError("`nitems` must be less than total length")             # <<<<<<<<<<<<<<
 *         # A negative number of items means that we want to grow the object
 *         if nitems <= 0:
 */
    __Pyx_TraceLine(1538,0,__PYX_ERR(0, 1538, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1538, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1537
 * 
 *         # Check that we don't run out of space
 *         if nitems > self.len:             # <<<<<<<<<<<<<<
 *             raise ValueError("`nitems` must be less than total length")
 *         # A negative number of items means that we want to grow the object
 */
  }

  /* "bcolz/carray_ext.pyx":1540
 *             raise ValueError("`nitems` must be less than total length")
 *         # A negative number of items means that we want to grow the object
 *         if nitems <= 0:             # <<<<<<<<<<<<<<
 *             self.resize(self.len - nitems)
 *             return
 */
  __Pyx_TraceLine(1540,0,__PYX_ERR(0, 1540, __pyx_L1_error))
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_nitems, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1541
 *         # A negative number of items means that we want to grow the object
 *         if nitems <= 0:
 *             self.resize(self.len - nitems)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __Pyx_TraceLine(1541,0,__PYX_ERR(0, 1541, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_1, __pyx_v_nitems); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1541, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":1542
 *         if nitems <= 0:
 *             self.resize(self.len - nitems)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         atomsize = self.atomsize
 */
    __Pyx_TraceLine(1542,0,__PYX_ERR(0, 1542, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1540
 *             raise ValueError("`nitems` must be less than total length")
 *         # A negative number of items means that we want to grow the object
 *         if nitems <= 0:             # <<<<<<<<<<<<<<
 *             self.resize(self.len - nitems)
 *             return
 */
  }

  /* "bcolz/carray_ext.pyx":1544
 *             return
 * 
 *         atomsize = self.atomsize             # <<<<<<<<<<<<<<
 *         chunks = self.chunks
 *         leftover = self.leftover
 */
  __Pyx_TraceLine(1544,0,__PYX_ERR(0, 1544, __pyx_L1_error))
  __pyx_t_8 = __pyx_v_self->atomsize;
  __pyx_v_atomsize = __pyx_t_8;

  /* "bcolz/carray_ext.pyx":1545
 * 
 *         atomsize = self.atomsize
 *         chunks = self.chunks             # <<<<<<<<<<<<<<
 *         leftover = self.leftover
 *         bsize = nitems * atomsize
 */
  __Pyx_TraceLine(1545,0,__PYX_ERR(0, 1545, __pyx_L1_error))
  __pyx_t_2 = __pyx_v_self->chunks;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_chunks = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1546
 *         atomsize = self.atomsize
 *         chunks = self.chunks
 *         leftover = self.leftover             # <<<<<<<<<<<<<<
 *         bsize = nitems * atomsize
 *         cbytes = 0
 */
  __Pyx_TraceLine(1546,0,__PYX_ERR(0, 1546, __pyx_L1_error))
  __pyx_t_8 = __pyx_v_self->leftover;
  __pyx_v_leftover = __pyx_t_8;

  /* "bcolz/carray_ext.pyx":1547
 *         chunks = self.chunks
 *         leftover = self.leftover
 *         bsize = nitems * atomsize             # <<<<<<<<<<<<<<
 *         cbytes = 0
 * 
 */
  __Pyx_TraceLine(1547,0,__PYX_ERR(0, 1547, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_atomsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_nitems, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_bsize = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":1548
 *         leftover = self.leftover
 *         bsize = nitems * atomsize
 *         cbytes = 0             # <<<<<<<<<<<<<<
 * 
 *         # Check if items belong to the last chunk
 */
  __Pyx_TraceLine(1548,0,__PYX_ERR(0, 1548, __pyx_L1_error))
  __pyx_v_cbytes = 0;

  /* "bcolz/carray_ext.pyx":1551
 * 
 *         # Check if items belong to the last chunk
 *         if (leftover - bsize) > 0:             # <<<<<<<<<<<<<<
 *             # Just update leftover counter
 *             leftover -= bsize
 */
  __Pyx_TraceLine(1551,0,__PYX_ERR(0, 1551, __pyx_L1_error))
  __pyx_t_5 = (((__pyx_v_leftover - __pyx_v_bsize) > 0) != 0);
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1553
 *         if (leftover - bsize) > 0:
 *             # Just update leftover counter
 *             leftover -= bsize             # <<<<<<<<<<<<<<
 *         else:
 *             # nitems larger than last chunk
 */
    __Pyx_TraceLine(1553,0,__PYX_ERR(0, 1553, __pyx_L1_error))
    __pyx_v_leftover = (__pyx_v_leftover - __pyx_v_bsize);

    /* "bcolz/carray_ext.pyx":1551
 * 
 *         # Check if items belong to the last chunk
 *         if (leftover - bsize) > 0:             # <<<<<<<<<<<<<<
 *             # Just update leftover counter
 *             leftover -= bsize
 */
    goto __pyx_L6;
  }

  /* "bcolz/carray_ext.pyx":1556
 *         else:
 *             # nitems larger than last chunk
 *             nchunk = cython.cdiv((self.len - nitems), self._chunklen)             # <<<<<<<<<<<<<<
 *             leftover2 = cython.cmod((self.len - nitems), self._chunklen)
 *             leftover = leftover2 * atomsize
 */
  __Pyx_TraceLine(1556,0,__PYX_ERR(0, 1556, __pyx_L1_error))
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_v_nitems); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->_chunklen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_nchunk = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "bcolz/carray_ext.pyx":1557
 *             # nitems larger than last chunk
 *             nchunk = cython.cdiv((self.len - nitems), self._chunklen)
 *             leftover2 = cython.cmod((self.len - nitems), self._chunklen)             # <<<<<<<<<<<<<<
 *             leftover = leftover2 * atomsize
 * 
 */
    __Pyx_TraceLine(1557,0,__PYX_ERR(0, 1557, __pyx_L1_error))
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_7, __pyx_v_nitems); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->_chunklen); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyNumber_Remainder(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1557, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_leftover2 = __pyx_t_8;

    /* "bcolz/carray_ext.pyx":1558
 *             nchunk = cython.cdiv((self.len - nitems), self._chunklen)
 *             leftover2 = cython.cmod((self.len - nitems), self._chunklen)
 *             leftover = leftover2 * atomsize             # <<<<<<<<<<<<<<
 * 
 *             # Remove complete chunks
 */
    __Pyx_TraceLine(1558,0,__PYX_ERR(0, 1558, __pyx_L1_error))
    __pyx_v_leftover = (__pyx_v_leftover2 * __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":1561
 * 
 *             # Remove complete chunks
 *             nchunk2 = lnchunk = <npy_intp> cython.cdiv(             # <<<<<<<<<<<<<<
 *                 self._nbytes, self._chunksize)
 *             while nchunk2 > nchunk:
 */
    __Pyx_TraceLine(1561,0,__PYX_ERR(0, 1561, __pyx_L1_error))
    __pyx_t_9 = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));
    __pyx_v_nchunk2 = __pyx_t_9;
    __pyx_v_lnchunk = __pyx_t_9;

    /* "bcolz/carray_ext.pyx":1563
 *             nchunk2 = lnchunk = <npy_intp> cython.cdiv(
 *                 self._nbytes, self._chunksize)
 *             while nchunk2 > nchunk:             # <<<<<<<<<<<<<<
 *                 chunk_ = chunks.pop()
 *                 cbytes += chunk_.cbytes
 */
    __Pyx_TraceLine(1563,0,__PYX_ERR(0, 1563, __pyx_L1_error))
    while (1) {
      __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_nchunk2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1563, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_v_nchunk, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1563, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1563, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!__pyx_t_5) break;

      /* "bcolz/carray_ext.pyx":1564
 *                 self._nbytes, self._chunksize)
 *             while nchunk2 > nchunk:
 *                 chunk_ = chunks.pop()             # <<<<<<<<<<<<<<
 *                 cbytes += chunk_.cbytes
 *                 nchunk2 -= 1
 */
      __Pyx_TraceLine(1564,0,__PYX_ERR(0, 1564, __pyx_L1_error))
      __pyx_t_7 = __Pyx_PyObject_Pop(__pyx_v_chunks); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5bcolz_10carray_ext_chunk))))) __PYX_ERR(0, 1564, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_chunk_, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_7));
      __pyx_t_7 = 0;

      /* "bcolz/carray_ext.pyx":1565
 *             while nchunk2 > nchunk:
 *                 chunk_ = chunks.pop()
 *                 cbytes += chunk_.cbytes             # <<<<<<<<<<<<<<
 *                 nchunk2 -= 1
 * 
 */
      __Pyx_TraceLine(1565,0,__PYX_ERR(0, 1565, __pyx_L1_error))
      __pyx_v_cbytes = (__pyx_v_cbytes + __pyx_v_chunk_->cbytes);

      /* "bcolz/carray_ext.pyx":1566
 *                 chunk_ = chunks.pop()
 *                 cbytes += chunk_.cbytes
 *                 nchunk2 -= 1             # <<<<<<<<<<<<<<
 * 
 *             # Finally, deal with the leftover
 */
      __Pyx_TraceLine(1566,0,__PYX_ERR(0, 1566, __pyx_L1_error))
      __pyx_v_nchunk2 = (__pyx_v_nchunk2 - 1);
    }

    /* "bcolz/carray_ext.pyx":1569
 * 
 *             # Finally, deal with the leftover
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 self.lastchunkarr[:leftover2] = chunk_[:leftover2]
 *                 if self._rootdir:
 */
    __Pyx_TraceLine(1569,0,__PYX_ERR(0, 1569, __pyx_L1_error))
    __pyx_t_5 = (__pyx_v_leftover != 0);
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":1570
 *             # Finally, deal with the leftover
 *             if leftover:
 *                 self.lastchunkarr[:leftover2] = chunk_[:leftover2]             # <<<<<<<<<<<<<<
 *                 if self._rootdir:
 *                     # Last chunk is removed automatically by the chunks.pop(
 */
      __Pyx_TraceLine(1570,0,__PYX_ERR(0, 1570, __pyx_L1_error))
      if (unlikely(!__pyx_v_chunk_)) { __Pyx_RaiseUnboundLocalError("chunk_"); __PYX_ERR(0, 1570, __pyx_L1_error) }
      __pyx_t_7 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_chunk_), 0, __pyx_v_leftover2, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_PyObject_SetSlice(__pyx_v_self->lastchunkarr, __pyx_t_7, 0, __pyx_v_leftover2, NULL, NULL, NULL, 0, 1, 1) < 0) __PYX_ERR(0, 1570, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "bcolz/carray_ext.pyx":1571
 *             if leftover:
 *                 self.lastchunkarr[:leftover2] = chunk_[:leftover2]
 *                 if self._rootdir:             # <<<<<<<<<<<<<<
 *                     # Last chunk is removed automatically by the chunks.pop(
 *                     # ) call, and
 */
      __Pyx_TraceLine(1571,0,__PYX_ERR(0, 1571, __pyx_L1_error))
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_rootdir); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1571, __pyx_L1_error)
      if (__pyx_t_5) {

        /* "bcolz/carray_ext.pyx":1577
 *                     #  it is in
 *                     # this state on-disk)
 *                     cbytes += chunk_.nbytes             # <<<<<<<<<<<<<<
 * 
 *         # Update some counters
 */
        __Pyx_TraceLine(1577,0,__PYX_ERR(0, 1577, __pyx_L1_error))
        if (unlikely(!__pyx_v_chunk_)) { __Pyx_RaiseUnboundLocalError("chunk_"); __PYX_ERR(0, 1577, __pyx_L1_error) }
        __pyx_v_cbytes = (__pyx_v_cbytes + __pyx_v_chunk_->nbytes);

        /* "bcolz/carray_ext.pyx":1571
 *             if leftover:
 *                 self.lastchunkarr[:leftover2] = chunk_[:leftover2]
 *                 if self._rootdir:             # <<<<<<<<<<<<<<
 *                     # Last chunk is removed automatically by the chunks.pop(
 *                     # ) call, and
 */
      }

      /* "bcolz/carray_ext.pyx":1569
 * 
 *             # Finally, deal with the leftover
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 self.lastchunkarr[:leftover2] = chunk_[:leftover2]
 *                 if self._rootdir:
 */
    }
  }
  __pyx_L6:;

  /* "bcolz/carray_ext.pyx":1580
 * 
 *         # Update some counters
 *         self.leftover = leftover             # <<<<<<<<<<<<<<
 *         self._cbytes -= cbytes
 *         self._nbytes -= bsize
 */
  __Pyx_TraceLine(1580,0,__PYX_ERR(0, 1580, __pyx_L1_error))
  __pyx_v_self->leftover = __pyx_v_leftover;

  /* "bcolz/carray_ext.pyx":1581
 *         # Update some counters
 *         self.leftover = leftover
 *         self._cbytes -= cbytes             # <<<<<<<<<<<<<<
 *         self._nbytes -= bsize
 *         # Flush last chunk and update counters on-disk
 */
  __Pyx_TraceLine(1581,0,__PYX_ERR(0, 1581, __pyx_L1_error))
  __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes - __pyx_v_cbytes);

  /* "bcolz/carray_ext.pyx":1582
 *         self.leftover = leftover
 *         self._cbytes -= cbytes
 *         self._nbytes -= bsize             # <<<<<<<<<<<<<<
 *         # Flush last chunk and update counters on-disk
 *         self.flush()
 */
  __Pyx_TraceLine(1582,0,__PYX_ERR(0, 1582, __pyx_L1_error))
  __pyx_v_self->_nbytes = (__pyx_v_self->_nbytes - __pyx_v_bsize);

  /* "bcolz/carray_ext.pyx":1584
 *         self._nbytes -= bsize
 *         # Flush last chunk and update counters on-disk
 *         self.flush()             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, object nitems):
 */
  __Pyx_TraceLine(1584,0,__PYX_ERR(0, 1584, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1584, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "bcolz/carray_ext.pyx":1518
 *         return
 * 
 *     def trim(self, object nitems):             # <<<<<<<<<<<<<<
 *         """Remove the trailing `nitems` from this instance.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.trim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_XDECREF(__pyx_v_chunks);
  __Pyx_XDECREF(__pyx_v_nchunk);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1586
 *         self.flush()
 * 
 *     def resize(self, object nitems):             # <<<<<<<<<<<<<<
 *         """Resize the instance to have `nitems`.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_21resize(PyObject *__pyx_v_self, PyObject *__pyx_v_nitems); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_20resize[] = "carray.resize(self, nitems)\nResize the instance to have `nitems`.\n\n        Parameters\n        ----------\n        nitems : int\n            The final length of the object.  If `nitems` is larger than the\n            actual\n            length, new items will appended using `self.dflt` as filling\n            values.\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_21resize(PyObject *__pyx_v_self, PyObject *__pyx_v_nitems) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resize (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_20resize(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_nitems));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_20resize(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_nitems) {
  PyObject *__pyx_v_chunk = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("resize", 0);
  __Pyx_TraceCall("resize", __pyx_f[0], 1586, 0, __PYX_ERR(0, 1586, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1600
 *         cdef object chunk
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):             # <<<<<<<<<<<<<<
 *             raise TypeError("`nitems` must be an integer")
 * 
 */
  __Pyx_TraceLine(1600,0,__PYX_ERR(0, 1600, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyFloat_Type)));
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_nitems, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1600, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0);
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1601
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):
 *             raise TypeError("`nitems` must be an integer")             # <<<<<<<<<<<<<<
 * 
 *         if nitems == self.len:
 */
    __Pyx_TraceLine(1601,0,__PYX_ERR(0, 1601, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1601, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1600
 *         cdef object chunk
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):             # <<<<<<<<<<<<<<
 *             raise TypeError("`nitems` must be an integer")
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1603
 *             raise TypeError("`nitems` must be an integer")
 * 
 *         if nitems == self.len:             # <<<<<<<<<<<<<<
 *             return
 *         elif nitems < 0:
 */
  __Pyx_TraceLine(1603,0,__PYX_ERR(0, 1603, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_nitems, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1604
 * 
 *         if nitems == self.len:
 *             return             # <<<<<<<<<<<<<<
 *         elif nitems < 0:
 *             raise ValueError("`nitems` cannot be negative")
 */
    __Pyx_TraceLine(1604,0,__PYX_ERR(0, 1604, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1603
 *             raise TypeError("`nitems` must be an integer")
 * 
 *         if nitems == self.len:             # <<<<<<<<<<<<<<
 *             return
 *         elif nitems < 0:
 */
  }

  /* "bcolz/carray_ext.pyx":1605
 *         if nitems == self.len:
 *             return
 *         elif nitems < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("`nitems` cannot be negative")
 * 
 */
  __Pyx_TraceLine(1605,0,__PYX_ERR(0, 1605, __pyx_L1_error))
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_nitems, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1606
 *             return
 *         elif nitems < 0:
 *             raise ValueError("`nitems` cannot be negative")             # <<<<<<<<<<<<<<
 * 
 *         if nitems > self.len:
 */
    __Pyx_TraceLine(1606,0,__PYX_ERR(0, 1606, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1606, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1605
 *         if nitems == self.len:
 *             return
 *         elif nitems < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("`nitems` cannot be negative")
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1608
 *             raise ValueError("`nitems` cannot be negative")
 * 
 *         if nitems > self.len:             # <<<<<<<<<<<<<<
 *             chunk = np.empty(nitems - self.len, dtype=self._dtype)
 *             chunk[:] = self._dflt
 */
  __Pyx_TraceLine(1608,0,__PYX_ERR(0, 1608, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_nitems, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1609
 * 
 *         if nitems > self.len:
 *             chunk = np.empty(nitems - self.len, dtype=self._dtype)             # <<<<<<<<<<<<<<
 *             chunk[:] = self._dflt
 *             self.append(chunk)
 */
    __Pyx_TraceLine(1609,0,__PYX_ERR(0, 1609, __pyx_L1_error))
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_nitems, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) __PYX_ERR(0, 1609, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_chunk = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "bcolz/carray_ext.pyx":1610
 *         if nitems > self.len:
 *             chunk = np.empty(nitems - self.len, dtype=self._dtype)
 *             chunk[:] = self._dflt             # <<<<<<<<<<<<<<
 *             self.append(chunk)
 *             self.flush()
 */
    __Pyx_TraceLine(1610,0,__PYX_ERR(0, 1610, __pyx_L1_error))
    __pyx_t_6 = __pyx_v_self->_dflt;
    __Pyx_INCREF(__pyx_t_6);
    if (__Pyx_PyObject_SetSlice(__pyx_v_chunk, __pyx_t_6, 0, 0, NULL, NULL, &__pyx_slice__63, 0, 0, 1) < 0) __PYX_ERR(0, 1610, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "bcolz/carray_ext.pyx":1611
 *             chunk = np.empty(nitems - self.len, dtype=self._dtype)
 *             chunk[:] = self._dflt
 *             self.append(chunk)             # <<<<<<<<<<<<<<
 *             self.flush()
 *         else:
 */
    __Pyx_TraceLine(1611,0,__PYX_ERR(0, 1611, __pyx_L1_error))
    __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self), __pyx_v_chunk); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1611, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1612
 *             chunk[:] = self._dflt
 *             self.append(chunk)
 *             self.flush()             # <<<<<<<<<<<<<<
 *         else:
 *             # Just trim the excess of items
 */
    __Pyx_TraceLine(1612,0,__PYX_ERR(0, 1612, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flush); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1612, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1612, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "bcolz/carray_ext.pyx":1608
 *             raise ValueError("`nitems` cannot be negative")
 * 
 *         if nitems > self.len:             # <<<<<<<<<<<<<<
 *             chunk = np.empty(nitems - self.len, dtype=self._dtype)
 *             chunk[:] = self._dflt
 */
    goto __pyx_L5;
  }

  /* "bcolz/carray_ext.pyx":1615
 *         else:
 *             # Just trim the excess of items
 *             self.trim(self.len - nitems)             # <<<<<<<<<<<<<<
 * 
 *     def reshape(self, newshape):
 */
  __Pyx_TraceLine(1615,0,__PYX_ERR(0, 1615, __pyx_L1_error))
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_v_nitems); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1615, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1615, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1615, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L5:;

  /* "bcolz/carray_ext.pyx":1586
 *         self.flush()
 * 
 *     def resize(self, object nitems):             # <<<<<<<<<<<<<<
 *         """Resize the instance to have `nitems`.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chunk);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1617
 *             self.trim(self.len - nitems)
 * 
 *     def reshape(self, newshape):             # <<<<<<<<<<<<<<
 *         """Returns a new carray containing the same data with a new shape.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_23reshape(PyObject *__pyx_v_self, PyObject *__pyx_v_newshape); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_22reshape[] = "carray.reshape(self, newshape)\nReturns a new carray containing the same data with a new shape.\n\n        Parameters\n        ----------\n        newshape : int or tuple of ints\n            The new shape should be compatible with the original shape. If\n            an integer, then the result will be a 1-D array of that length.\n            One shape dimension can be -1. In this case, the value is inferred\n            from the length of the array and remaining dimensions.\n\n        Returns\n        -------\n        reshaped_array : carray\n            A copy of the original carray.\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_23reshape(PyObject *__pyx_v_self, PyObject *__pyx_v_newshape) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reshape (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_22reshape(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_newshape));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_22reshape(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_newshape) {
  npy_intp __pyx_v_newlen;
  npy_intp __pyx_v_ilen;
  npy_intp __pyx_v_isize;
  npy_intp __pyx_v_osize;
  npy_intp __pyx_v_newsize;
  npy_intp __pyx_v_rsize;
  npy_intp __pyx_v_i;
  PyObject *__pyx_v_ishape = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_v_newdtype = 0;
  PyObject *__pyx_v_out = 0;
  PyObject *__pyx_v_absdir = NULL;
  PyObject *__pyx_v_rootdir = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  npy_intp __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("reshape", 0);
  __Pyx_TraceCall("reshape", __pyx_f[0], 1617, 0, __PYX_ERR(0, 1617, __pyx_L1_error));
  __Pyx_INCREF(__pyx_v_newshape);

  /* "bcolz/carray_ext.pyx":1638
 * 
 *         # Enforce newshape as tuple
 *         if isinstance(newshape, _inttypes):             # <<<<<<<<<<<<<<
 *             newshape = (newshape,)
 *         newsize = np.prod(newshape)
 */
  __Pyx_TraceLine(1638,0,__PYX_ERR(0, 1638, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_newshape, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1639
 *         # Enforce newshape as tuple
 *         if isinstance(newshape, _inttypes):
 *             newshape = (newshape,)             # <<<<<<<<<<<<<<
 *         newsize = np.prod(newshape)
 * 
 */
    __Pyx_TraceLine(1639,0,__PYX_ERR(0, 1639, __pyx_L1_error))
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_newshape);
    __Pyx_GIVEREF(__pyx_v_newshape);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_newshape);
    __Pyx_DECREF_SET(__pyx_v_newshape, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1638
 * 
 *         # Enforce newshape as tuple
 *         if isinstance(newshape, _inttypes):             # <<<<<<<<<<<<<<
 *             newshape = (newshape,)
 *         newsize = np.prod(newshape)
 */
  }

  /* "bcolz/carray_ext.pyx":1640
 *         if isinstance(newshape, _inttypes):
 *             newshape = (newshape,)
 *         newsize = np.prod(newshape)             # <<<<<<<<<<<<<<
 * 
 *         ishape = self.shape
 */
  __Pyx_TraceLine(1640,0,__PYX_ERR(0, 1640, __pyx_L1_error))
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_prod); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_newshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_newshape);
    __Pyx_GIVEREF(__pyx_v_newshape);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_newshape);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_newsize = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1642
 *         newsize = np.prod(newshape)
 * 
 *         ishape = self.shape             # <<<<<<<<<<<<<<
 *         ilen = ishape[0]
 *         isize = np.prod(ishape)
 */
  __Pyx_TraceLine(1642,0,__PYX_ERR(0, 1642, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ishape = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1643
 * 
 *         ishape = self.shape
 *         ilen = ishape[0]             # <<<<<<<<<<<<<<
 *         isize = np.prod(ishape)
 * 
 */
  __Pyx_TraceLine(1643,0,__PYX_ERR(0, 1643, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ishape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ilen = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1644
 *         ishape = self.shape
 *         ilen = ishape[0]
 *         isize = np.prod(ishape)             # <<<<<<<<<<<<<<
 * 
 *         # Check for -1 in newshape
 */
  __Pyx_TraceLine(1644,0,__PYX_ERR(0, 1644, __pyx_L1_error))
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_prod); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_ishape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_ishape);
    __Pyx_GIVEREF(__pyx_v_ishape);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_ishape);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_isize = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1647
 * 
 *         # Check for -1 in newshape
 *         if -1 in newshape:             # <<<<<<<<<<<<<<
 *             if newshape.count(-1) > 1:
 *                 raise ValueError("only one shape dimension can be -1")
 */
  __Pyx_TraceLine(1647,0,__PYX_ERR(0, 1647, __pyx_L1_error))
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_int_neg_1, __pyx_v_newshape, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1647, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1648
 *         # Check for -1 in newshape
 *         if -1 in newshape:
 *             if newshape.count(-1) > 1:             # <<<<<<<<<<<<<<
 *                 raise ValueError("only one shape dimension can be -1")
 *             pos = newshape.index(-1)
 */
    __Pyx_TraceLine(1648,0,__PYX_ERR(0, 1648, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newshape, __pyx_n_s_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1649
 *         if -1 in newshape:
 *             if newshape.count(-1) > 1:
 *                 raise ValueError("only one shape dimension can be -1")             # <<<<<<<<<<<<<<
 *             pos = newshape.index(-1)
 *             osize = np.prod(newshape[:pos] + newshape[pos + 1:])
 */
      __Pyx_TraceLine(1649,0,__PYX_ERR(0, 1649, __pyx_L1_error))
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 1649, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1648
 *         # Check for -1 in newshape
 *         if -1 in newshape:
 *             if newshape.count(-1) > 1:             # <<<<<<<<<<<<<<
 *                 raise ValueError("only one shape dimension can be -1")
 *             pos = newshape.index(-1)
 */
    }

    /* "bcolz/carray_ext.pyx":1650
 *             if newshape.count(-1) > 1:
 *                 raise ValueError("only one shape dimension can be -1")
 *             pos = newshape.index(-1)             # <<<<<<<<<<<<<<
 *             osize = np.prod(newshape[:pos] + newshape[pos + 1:])
 *             if isize == 0:
 */
    __Pyx_TraceLine(1650,0,__PYX_ERR(0, 1650, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newshape, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_pos = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "bcolz/carray_ext.pyx":1651
 *                 raise ValueError("only one shape dimension can be -1")
 *             pos = newshape.index(-1)
 *             osize = np.prod(newshape[:pos] + newshape[pos + 1:])             # <<<<<<<<<<<<<<
 *             if isize == 0:
 *                 newshape = newshape[:pos] + (0,) + newshape[pos + 1:]
 */
    __Pyx_TraceLine(1651,0,__PYX_ERR(0, 1651, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_prod); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_newshape, 0, 0, NULL, &__pyx_v_pos, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_pos, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_newshape, 0, 0, &__pyx_t_5, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1651, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_osize = __pyx_t_7;

    /* "bcolz/carray_ext.pyx":1652
 *             pos = newshape.index(-1)
 *             osize = np.prod(newshape[:pos] + newshape[pos + 1:])
 *             if isize == 0:             # <<<<<<<<<<<<<<
 *                 newshape = newshape[:pos] + (0,) + newshape[pos + 1:]
 *             else:
 */
    __Pyx_TraceLine(1652,0,__PYX_ERR(0, 1652, __pyx_L1_error))
    __pyx_t_2 = ((__pyx_v_isize == 0) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1653
 *             osize = np.prod(newshape[:pos] + newshape[pos + 1:])
 *             if isize == 0:
 *                 newshape = newshape[:pos] + (0,) + newshape[pos + 1:]             # <<<<<<<<<<<<<<
 *             else:
 *                 newshape = newshape[:pos] + (isize / osize,) + newshape[
 */
      __Pyx_TraceLine(1653,0,__PYX_ERR(0, 1653, __pyx_L1_error))
      __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_newshape, 0, 0, NULL, &__pyx_v_pos, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_tuple__67); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_pos, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_newshape, 0, 0, &__pyx_t_6, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_newshape, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "bcolz/carray_ext.pyx":1652
 *             pos = newshape.index(-1)
 *             osize = np.prod(newshape[:pos] + newshape[pos + 1:])
 *             if isize == 0:             # <<<<<<<<<<<<<<
 *                 newshape = newshape[:pos] + (0,) + newshape[pos + 1:]
 *             else:
 */
      goto __pyx_L6;
    }

    /* "bcolz/carray_ext.pyx":1655
 *                 newshape = newshape[:pos] + (0,) + newshape[pos + 1:]
 *             else:
 *                 newshape = newshape[:pos] + (isize / osize,) + newshape[             # <<<<<<<<<<<<<<
 *                                                                pos + 1:]
 *             newsize = np.prod(newshape)
 */
    __Pyx_TraceLine(1655,0,__PYX_ERR(0, 1655, __pyx_L1_error))
    /*else*/ {
      __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_newshape, 0, 0, NULL, &__pyx_v_pos, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_osize == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(0, 1655, __pyx_L1_error)
      }
      else if (sizeof(npy_intp) == sizeof(long) && (!(((npy_intp)-1) > 0)) && unlikely(__pyx_v_osize == (npy_intp)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_isize))) {
        PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
        __PYX_ERR(0, 1655, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__Pyx_div_npy_intp(__pyx_v_isize, __pyx_v_osize)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "bcolz/carray_ext.pyx":1656
 *             else:
 *                 newshape = newshape[:pos] + (isize / osize,) + newshape[
 *                                                                pos + 1:]             # <<<<<<<<<<<<<<
 *             newsize = np.prod(newshape)
 * 
 */
      __Pyx_TraceLine(1656,0,__PYX_ERR(0, 1656, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pos, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1656, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "bcolz/carray_ext.pyx":1655
 *                 newshape = newshape[:pos] + (0,) + newshape[pos + 1:]
 *             else:
 *                 newshape = newshape[:pos] + (isize / osize,) + newshape[             # <<<<<<<<<<<<<<
 *                                                                pos + 1:]
 *             newsize = np.prod(newshape)
 */
      __Pyx_TraceLine(1655,0,__PYX_ERR(0, 1655, __pyx_L1_error))
      __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_newshape, 0, 0, &__pyx_t_4, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF_SET(__pyx_v_newshape, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L6:;

    /* "bcolz/carray_ext.pyx":1657
 *                 newshape = newshape[:pos] + (isize / osize,) + newshape[
 *                                                                pos + 1:]
 *             newsize = np.prod(newshape)             # <<<<<<<<<<<<<<
 * 
 *         # Check shape compatibility
 */
    __Pyx_TraceLine(1657,0,__PYX_ERR(0, 1657, __pyx_L1_error))
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_prod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_newshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_newshape);
      __Pyx_GIVEREF(__pyx_v_newshape);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_newshape);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1657, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_newsize = __pyx_t_7;

    /* "bcolz/carray_ext.pyx":1647
 * 
 *         # Check for -1 in newshape
 *         if -1 in newshape:             # <<<<<<<<<<<<<<
 *             if newshape.count(-1) > 1:
 *                 raise ValueError("only one shape dimension can be -1")
 */
  }

  /* "bcolz/carray_ext.pyx":1660
 * 
 *         # Check shape compatibility
 *         if isize != newsize:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "`newshape` is not compatible with the current one")
 */
  __Pyx_TraceLine(1660,0,__PYX_ERR(0, 1660, __pyx_L1_error))
  __pyx_t_2 = ((__pyx_v_isize != __pyx_v_newsize) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1661
 *         # Check shape compatibility
 *         if isize != newsize:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "`newshape` is not compatible with the current one")
 *         # Create the output container
 */
    __Pyx_TraceLine(1661,0,__PYX_ERR(0, 1661, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1661, __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_ERR(0, 1661, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1660
 * 
 *         # Check shape compatibility
 *         if isize != newsize:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "`newshape` is not compatible with the current one")
 */
  }

  /* "bcolz/carray_ext.pyx":1664
 *                 "`newshape` is not compatible with the current one")
 *         # Create the output container
 *         newdtype = np.dtype((self._dtype.base, newshape[1:]))             # <<<<<<<<<<<<<<
 *         newlen = newshape[0]
 * 
 */
  __Pyx_TraceLine(1664,0,__PYX_ERR(0, 1664, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_newshape, 1, 0, NULL, NULL, &__pyx_slice__69, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_newdtype = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":1665
 *         # Create the output container
 *         newdtype = np.dtype((self._dtype.base, newshape[1:]))
 *         newlen = newshape[0]             # <<<<<<<<<<<<<<
 * 
 *         # If shapes are both n-dimensional, convert first to 1-dim shape
 */
  __Pyx_TraceLine(1665,0,__PYX_ERR(0, 1665, __pyx_L1_error))
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_newshape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1665, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_newlen = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1669
 *         # If shapes are both n-dimensional, convert first to 1-dim shape
 *         # and then convert again to the final newshape.
 *         if len(ishape) > 1 and len(newshape) > 1:             # <<<<<<<<<<<<<<
 *             out = self.reshape(-1)
 *             return out.reshape(newshape)
 */
  __Pyx_TraceLine(1669,0,__PYX_ERR(0, 1669, __pyx_L1_error))
  __pyx_t_9 = PyObject_Length(__pyx_v_ishape); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1669, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_9 > 1) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_9 = PyObject_Length(__pyx_v_newshape); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1669, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_9 > 1) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1670
 *         # and then convert again to the final newshape.
 *         if len(ishape) > 1 and len(newshape) > 1:
 *             out = self.reshape(-1)             # <<<<<<<<<<<<<<
 *             return out.reshape(newshape)
 * 
 */
    __Pyx_TraceLine(1670,0,__PYX_ERR(0, 1670, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_out = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1671
 *         if len(ishape) > 1 and len(newshape) > 1:
 *             out = self.reshape(-1)
 *             return out.reshape(newshape)             # <<<<<<<<<<<<<<
 * 
 *         if self._rootdir:
 */
    __Pyx_TraceLine(1671,0,__PYX_ERR(0, 1671, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_newshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1671, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1671, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_newshape);
      __Pyx_GIVEREF(__pyx_v_newshape);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_newshape);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1671, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1669
 *         # If shapes are both n-dimensional, convert first to 1-dim shape
 *         # and then convert again to the final newshape.
 *         if len(ishape) > 1 and len(newshape) > 1:             # <<<<<<<<<<<<<<
 *             out = self.reshape(-1)
 *             return out.reshape(newshape)
 */
  }

  /* "bcolz/carray_ext.pyx":1673
 *             return out.reshape(newshape)
 * 
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             # If persistent, do the copy to a temporary dir
 *             absdir = os.path.dirname(self._rootdir)
 */
  __Pyx_TraceLine(1673,0,__PYX_ERR(0, 1673, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_rootdir); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1673, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1675
 *         if self._rootdir:
 *             # If persistent, do the copy to a temporary dir
 *             absdir = os.path.dirname(self._rootdir)             # <<<<<<<<<<<<<<
 *             rootdir = tempfile.mkdtemp(suffix='__temp__', dir=absdir)
 *         else:
 */
    __Pyx_TraceLine(1675,0,__PYX_ERR(0, 1675, __pyx_L1_error))
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_dirname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->_rootdir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1675, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1675, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_self->_rootdir);
      __Pyx_GIVEREF(__pyx_v_self->_rootdir);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->_rootdir);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1675, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_absdir = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1676
 *             # If persistent, do the copy to a temporary dir
 *             absdir = os.path.dirname(self._rootdir)
 *             rootdir = tempfile.mkdtemp(suffix='__temp__', dir=absdir)             # <<<<<<<<<<<<<<
 *         else:
 *             rootdir = None
 */
    __Pyx_TraceLine(1676,0,__PYX_ERR(0, 1676, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tempfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mkdtemp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_suffix, __pyx_n_s_temp) < 0) __PYX_ERR(0, 1676, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dir, __pyx_v_absdir) < 0) __PYX_ERR(0, 1676, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_rootdir = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":1673
 *             return out.reshape(newshape)
 * 
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             # If persistent, do the copy to a temporary dir
 *             absdir = os.path.dirname(self._rootdir)
 */
    goto __pyx_L11;
  }

  /* "bcolz/carray_ext.pyx":1678
 *             rootdir = tempfile.mkdtemp(suffix='__temp__', dir=absdir)
 *         else:
 *             rootdir = None             # <<<<<<<<<<<<<<
 * 
 *         # Create the final container and fill it
 */
  __Pyx_TraceLine(1678,0,__PYX_ERR(0, 1678, __pyx_L1_error))
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_rootdir = Py_None;
  }
  __pyx_L11:;

  /* "bcolz/carray_ext.pyx":1681
 * 
 *         # Create the final container and fill it
 *         out = carray([], dtype=newdtype, cparams=self.cparams,             # <<<<<<<<<<<<<<
 *                        expectedlen=newlen,
 *                        rootdir=rootdir, mode='w')
 */
  __Pyx_TraceLine(1681,0,__PYX_ERR(0, 1681, __pyx_L1_error))
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_v_newdtype) < 0) __PYX_ERR(0, 1681, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cparams, __pyx_t_5) < 0) __PYX_ERR(0, 1681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":1682
 *         # Create the final container and fill it
 *         out = carray([], dtype=newdtype, cparams=self.cparams,
 *                        expectedlen=newlen,             # <<<<<<<<<<<<<<
 *                        rootdir=rootdir, mode='w')
 *         if newlen < ilen:
 */
  __Pyx_TraceLine(1682,0,__PYX_ERR(0, 1682, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_newlen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_expectedlen, __pyx_t_5) < 0) __PYX_ERR(0, 1681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":1683
 *         out = carray([], dtype=newdtype, cparams=self.cparams,
 *                        expectedlen=newlen,
 *                        rootdir=rootdir, mode='w')             # <<<<<<<<<<<<<<
 *         if newlen < ilen:
 *             rsize = isize / newlen
 */
  __Pyx_TraceLine(1683,0,__PYX_ERR(0, 1683, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_rootdir, __pyx_v_rootdir) < 0) __PYX_ERR(0, 1681, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mode, __pyx_n_s_w) < 0) __PYX_ERR(0, 1681, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":1681
 * 
 *         # Create the final container and fill it
 *         out = carray([], dtype=newdtype, cparams=self.cparams,             # <<<<<<<<<<<<<<
 *                        expectedlen=newlen,
 *                        rootdir=rootdir, mode='w')
 */
  __Pyx_TraceLine(1681,0,__PYX_ERR(0, 1681, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_carray), __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_out = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":1684
 *                        expectedlen=newlen,
 *                        rootdir=rootdir, mode='w')
 *         if newlen < ilen:             # <<<<<<<<<<<<<<
 *             rsize = isize / newlen
 *             for i from 0 <= i < newlen:
 */
  __Pyx_TraceLine(1684,0,__PYX_ERR(0, 1684, __pyx_L1_error))
  __pyx_t_2 = ((__pyx_v_newlen < __pyx_v_ilen) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1685
 *                        rootdir=rootdir, mode='w')
 *         if newlen < ilen:
 *             rsize = isize / newlen             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < newlen:
 *                 out.append(
 */
    __Pyx_TraceLine(1685,0,__PYX_ERR(0, 1685, __pyx_L1_error))
    if (unlikely(__pyx_v_newlen == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 1685, __pyx_L1_error)
    }
    else if (sizeof(npy_intp) == sizeof(long) && (!(((npy_intp)-1) > 0)) && unlikely(__pyx_v_newlen == (npy_intp)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_isize))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(0, 1685, __pyx_L1_error)
    }
    __pyx_v_rsize = __Pyx_div_npy_intp(__pyx_v_isize, __pyx_v_newlen);

    /* "bcolz/carray_ext.pyx":1686
 *         if newlen < ilen:
 *             rsize = isize / newlen
 *             for i from 0 <= i < newlen:             # <<<<<<<<<<<<<<
 *                 out.append(
 *                     self[i * rsize:(i + 1) * rsize].reshape(newdtype.shape))
 */
    __Pyx_TraceLine(1686,0,__PYX_ERR(0, 1686, __pyx_L1_error))
    __pyx_t_7 = __pyx_v_newlen;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "bcolz/carray_ext.pyx":1688
 *             for i from 0 <= i < newlen:
 *                 out.append(
 *                     self[i * rsize:(i + 1) * rsize].reshape(newdtype.shape))             # <<<<<<<<<<<<<<
 *         else:
 *             for i from 0 <= i < ilen:
 */
      __Pyx_TraceLine(1688,0,__PYX_ERR(0, 1688, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), (__pyx_v_i * __pyx_v_rsize), ((__pyx_v_i + 1) * __pyx_v_rsize), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_newdtype, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1688, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1688, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1688, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":1687
 *             rsize = isize / newlen
 *             for i from 0 <= i < newlen:
 *                 out.append(             # <<<<<<<<<<<<<<
 *                     self[i * rsize:(i + 1) * rsize].reshape(newdtype.shape))
 *         else:
 */
      __Pyx_TraceLine(1687,0,__PYX_ERR(0, 1687, __pyx_L1_error))
      __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_out, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }

    /* "bcolz/carray_ext.pyx":1684
 *                        expectedlen=newlen,
 *                        rootdir=rootdir, mode='w')
 *         if newlen < ilen:             # <<<<<<<<<<<<<<
 *             rsize = isize / newlen
 *             for i from 0 <= i < newlen:
 */
    goto __pyx_L12;
  }

  /* "bcolz/carray_ext.pyx":1690
 *                     self[i * rsize:(i + 1) * rsize].reshape(newdtype.shape))
 *         else:
 *             for i from 0 <= i < ilen:             # <<<<<<<<<<<<<<
 *                 out.append(self[i].reshape(-1))
 *         out.flush()
 */
  __Pyx_TraceLine(1690,0,__PYX_ERR(0, 1690, __pyx_L1_error))
  /*else*/ {
    __pyx_t_7 = __pyx_v_ilen;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "bcolz/carray_ext.pyx":1691
 *         else:
 *             for i from 0 <= i < ilen:
 *                 out.append(self[i].reshape(-1))             # <<<<<<<<<<<<<<
 *         out.flush()
 * 
 */
      __Pyx_TraceLine(1691,0,__PYX_ERR(0, 1691, __pyx_L1_error))
      __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), __pyx_v_i, npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_out, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1691, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __pyx_L12:;

  /* "bcolz/carray_ext.pyx":1692
 *             for i from 0 <= i < ilen:
 *                 out.append(self[i].reshape(-1))
 *         out.flush()             # <<<<<<<<<<<<<<
 * 
 *         # Finally, rename the temporary data directory to self._rootdir
 */
  __Pyx_TraceLine(1692,0,__PYX_ERR(0, 1692, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_flush); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_8) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1692, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1692, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":1695
 * 
 *         # Finally, rename the temporary data directory to self._rootdir
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             shutil.rmtree(self._rootdir)
 *             os.rename(rootdir, self._rootdir)
 */
  __Pyx_TraceLine(1695,0,__PYX_ERR(0, 1695, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_rootdir); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1695, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1696
 *         # Finally, rename the temporary data directory to self._rootdir
 *         if self._rootdir:
 *             shutil.rmtree(self._rootdir)             # <<<<<<<<<<<<<<
 *             os.rename(rootdir, self._rootdir)
 *             # Restore the rootdir and mode
 */
    __Pyx_TraceLine(1696,0,__PYX_ERR(0, 1696, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_shutil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_rmtree); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_self->_rootdir); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1696, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1696, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_self->_rootdir);
      __Pyx_GIVEREF(__pyx_v_self->_rootdir);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->_rootdir);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1696, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1697
 *         if self._rootdir:
 *             shutil.rmtree(self._rootdir)
 *             os.rename(rootdir, self._rootdir)             # <<<<<<<<<<<<<<
 *             # Restore the rootdir and mode
 *             out.rootdir = self._rootdir
 */
    __Pyx_TraceLine(1697,0,__PYX_ERR(0, 1697, __pyx_L1_error))
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_rename); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_9 = 1;
      }
    }
    __pyx_t_1 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(__pyx_v_rootdir);
    __Pyx_GIVEREF(__pyx_v_rootdir);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_9, __pyx_v_rootdir);
    __Pyx_INCREF(__pyx_v_self->_rootdir);
    __Pyx_GIVEREF(__pyx_v_self->_rootdir);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_9, __pyx_v_self->_rootdir);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1699
 *             os.rename(rootdir, self._rootdir)
 *             # Restore the rootdir and mode
 *             out.rootdir = self._rootdir             # <<<<<<<<<<<<<<
 *             out.mode = self._mode
 * 
 */
    __Pyx_TraceLine(1699,0,__PYX_ERR(0, 1699, __pyx_L1_error))
    __pyx_t_5 = __pyx_v_self->_rootdir;
    __Pyx_INCREF(__pyx_t_5);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_out, __pyx_n_s_rootdir, __pyx_t_5) < 0) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1700
 *             # Restore the rootdir and mode
 *             out.rootdir = self._rootdir
 *             out.mode = self._mode             # <<<<<<<<<<<<<<
 * 
 *         return out
 */
    __Pyx_TraceLine(1700,0,__PYX_ERR(0, 1700, __pyx_L1_error))
    __pyx_t_5 = __pyx_v_self->_mode;
    __Pyx_INCREF(__pyx_t_5);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_out, __pyx_n_s_mode, __pyx_t_5) < 0) __PYX_ERR(0, 1700, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1695
 * 
 *         # Finally, rename the temporary data directory to self._rootdir
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             shutil.rmtree(self._rootdir)
 *             os.rename(rootdir, self._rootdir)
 */
  }

  /* "bcolz/carray_ext.pyx":1702
 *             out.mode = self._mode
 * 
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def copy(self, **kwargs):
 */
  __Pyx_TraceLine(1702,0,__PYX_ERR(0, 1702, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1617
 *             self.trim(self.len - nitems)
 * 
 *     def reshape(self, newshape):             # <<<<<<<<<<<<<<
 *         """Returns a new carray containing the same data with a new shape.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.reshape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ishape);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_newdtype);
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_absdir);
  __Pyx_XDECREF(__pyx_v_rootdir);
  __Pyx_XDECREF(__pyx_v_newshape);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1704
 *         return out
 * 
 *     def copy(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """Return a copy of this object.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_25copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_24copy[] = "carray.copy(self, **kwargs)\nReturn a copy of this object.\n\n        Parameters\n        ----------\n        kwargs : list of parameters or dictionary\n            Any parameter supported by the carray constructor.\n\n        Returns\n        -------\n        out : carray object\n            The copy of this object.\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_25copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 1))) return NULL;
  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_24copy(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_kwargs);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_24copy(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_chunklen = 0;
  PyObject *__pyx_v_expectedlen = NULL;
  struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_ccopy = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  long __pyx_t_7;
  long __pyx_t_8;
  long __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("copy", 0);
  __Pyx_TraceCall("copy", __pyx_f[0], 1704, 0, __PYX_ERR(0, 1704, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1721
 * 
 *         # Get defaults for some parameters
 *         expectedlen = kwargs.pop('expectedlen', self.len)             # <<<<<<<<<<<<<<
 * 
 *         # Create a new, empty carray
 */
  __Pyx_TraceLine(1721,0,__PYX_ERR(0, 1721, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_n_s_expectedlen);
  __Pyx_GIVEREF(__pyx_n_s_expectedlen);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_expectedlen);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_expectedlen = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1724
 * 
 *         # Create a new, empty carray
 *         ccopy = carray(np.empty(0, dtype=self._dtype),             # <<<<<<<<<<<<<<
 *                        expectedlen=expectedlen,
 *                        **kwargs)
 */
  __Pyx_TraceLine(1724,0,__PYX_ERR(0, 1724, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) __PYX_ERR(0, 1724, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__72, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1725
 *         # Create a new, empty carray
 *         ccopy = carray(np.empty(0, dtype=self._dtype),
 *                        expectedlen=expectedlen,             # <<<<<<<<<<<<<<
 *                        **kwargs)
 * 
 */
  __Pyx_TraceLine(1725,0,__PYX_ERR(0, 1725, __pyx_L1_error))
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_expectedlen, __pyx_v_expectedlen) < 0) __PYX_ERR(0, 1725, __pyx_L1_error)
  __pyx_t_6 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1726
 *         ccopy = carray(np.empty(0, dtype=self._dtype),
 *                        expectedlen=expectedlen,
 *                        **kwargs)             # <<<<<<<<<<<<<<
 * 
 *         # Now copy the carray chunk by chunk
 */
  __Pyx_TraceLine(1726,0,__PYX_ERR(0, 1726, __pyx_L1_error))
  if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwargs) < 0) __PYX_ERR(0, 1726, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":1724
 * 
 *         # Create a new, empty carray
 *         ccopy = carray(np.empty(0, dtype=self._dtype),             # <<<<<<<<<<<<<<
 *                        expectedlen=expectedlen,
 *                        **kwargs)
 */
  __Pyx_TraceLine(1724,0,__PYX_ERR(0, 1724, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_carray), __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_ccopy = ((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1729
 * 
 *         # Now copy the carray chunk by chunk
 *         chunklen = self._chunklen             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < self.len by chunklen:
 *             ccopy.append(self[i:i + chunklen])
 */
  __Pyx_TraceLine(1729,0,__PYX_ERR(0, 1729, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_chunklen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_chunklen = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1730
 *         # Now copy the carray chunk by chunk
 *         chunklen = self._chunklen
 *         for i from 0 <= i < self.len by chunklen:             # <<<<<<<<<<<<<<
 *             ccopy.append(self[i:i + chunklen])
 *         ccopy.flush()
 */
  __Pyx_TraceLine(1730,0,__PYX_ERR(0, 1730, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1730, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_long(__pyx_v_chunklen); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1730, __pyx_L1_error)
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_7; __pyx_t_9+=__pyx_t_8) {
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":1731
 *         chunklen = self._chunklen
 *         for i from 0 <= i < self.len by chunklen:
 *             ccopy.append(self[i:i + chunklen])             # <<<<<<<<<<<<<<
 *         ccopy.flush()
 * 
 */
    __Pyx_TraceLine(1731,0,__PYX_ERR(0, 1731, __pyx_L1_error))
    __pyx_t_2 = PyNumber_Add(__pyx_v_i, __pyx_v_chunklen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, 0, &__pyx_v_i, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ccopy), __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = __Pyx_PyInt_As_long(__pyx_v_i); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1730, __pyx_L1_error)
  }

  /* "bcolz/carray_ext.pyx":1730
 *         # Now copy the carray chunk by chunk
 *         chunklen = self._chunklen
 *         for i from 0 <= i < self.len by chunklen:             # <<<<<<<<<<<<<<
 *             ccopy.append(self[i:i + chunklen])
 *         ccopy.flush()
 */
  __Pyx_TraceLine(1730,0,__PYX_ERR(0, 1730, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1732
 *         for i from 0 <= i < self.len by chunklen:
 *             ccopy.append(self[i:i + chunklen])
 *         ccopy.flush()             # <<<<<<<<<<<<<<
 * 
 *         return ccopy
 */
  __Pyx_TraceLine(1732,0,__PYX_ERR(0, 1732, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ccopy), __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1732, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1732, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1734
 *         ccopy.flush()
 * 
 *         return ccopy             # <<<<<<<<<<<<<<
 * 
 *     def view(self):
 */
  __Pyx_TraceLine(1734,0,__PYX_ERR(0, 1734, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ccopy));
  __pyx_r = ((PyObject *)__pyx_v_ccopy);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1704
 *         return out
 * 
 *     def copy(self, **kwargs):             # <<<<<<<<<<<<<<
 *         """Return a copy of this object.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chunklen);
  __Pyx_XDECREF(__pyx_v_expectedlen);
  __Pyx_XDECREF((PyObject *)__pyx_v_ccopy);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1736
 *         return ccopy
 * 
 *     def view(self):             # <<<<<<<<<<<<<<
 *         """Create a light weight view of the data in the original carray.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_27view(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_26view[] = "carray.view(self)\nCreate a light weight view of the data in the original carray.\n\n        Returns\n        -------\n        out : carray object\n            The view of this object.\n\n        See Also\n        --------\n        copy\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_27view(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("view (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_26view(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_26view(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_cview = NULL;
  PyObject *__pyx_v_meta_info = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("view", 0);
  __Pyx_TraceCall("view", __pyx_f[0], 1736, 0, __PYX_ERR(0, 1736, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1750
 *         """
 *         # Create a light weight data container
 *         cview = carray(np.empty(0, dtype=self._dtype))             # <<<<<<<<<<<<<<
 *         # And populate it with metainfo (including chunks)
 *         meta_info = (self.shape, self.cparams, self.dtype, self.dflt,
 */
  __Pyx_TraceLine(1750,0,__PYX_ERR(0, 1750, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) __PYX_ERR(0, 1750, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__73, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_carray), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cview = ((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1752
 *         cview = carray(np.empty(0, dtype=self._dtype))
 *         # And populate it with metainfo (including chunks)
 *         meta_info = (self.shape, self.cparams, self.dtype, self.dflt,             # <<<<<<<<<<<<<<
 *                      self.expectedlen, self.cbytes, self.chunklen)
 *         cview._open_carray(*meta_info, xchunks=(self.chunks, self.lastchunkarr))
 */
  __Pyx_TraceLine(1752,0,__PYX_ERR(0, 1752, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dflt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "bcolz/carray_ext.pyx":1753
 *         # And populate it with metainfo (including chunks)
 *         meta_info = (self.shape, self.cparams, self.dtype, self.dflt,
 *                      self.expectedlen, self.cbytes, self.chunklen)             # <<<<<<<<<<<<<<
 *         cview._open_carray(*meta_info, xchunks=(self.chunks, self.lastchunkarr))
 *         return cview
 */
  __Pyx_TraceLine(1753,0,__PYX_ERR(0, 1753, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->expectedlen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cbytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunklen); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "bcolz/carray_ext.pyx":1752
 *         cview = carray(np.empty(0, dtype=self._dtype))
 *         # And populate it with metainfo (including chunks)
 *         meta_info = (self.shape, self.cparams, self.dtype, self.dflt,             # <<<<<<<<<<<<<<
 *                      self.expectedlen, self.cbytes, self.chunklen)
 *         cview._open_carray(*meta_info, xchunks=(self.chunks, self.lastchunkarr))
 */
  __Pyx_TraceLine(1752,0,__PYX_ERR(0, 1752, __pyx_L1_error))
  __pyx_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_7);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_v_meta_info = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "bcolz/carray_ext.pyx":1754
 *         meta_info = (self.shape, self.cparams, self.dtype, self.dflt,
 *                      self.expectedlen, self.cbytes, self.chunklen)
 *         cview._open_carray(*meta_info, xchunks=(self.chunks, self.lastchunkarr))             # <<<<<<<<<<<<<<
 *         return cview
 * 
 */
  __Pyx_TraceLine(1754,0,__PYX_ERR(0, 1754, __pyx_L1_error))
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cview), __pyx_n_s_open_carray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_self->chunks);
  __Pyx_GIVEREF(__pyx_v_self->chunks);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self->chunks);
  __Pyx_INCREF(__pyx_v_self->lastchunkarr);
  __Pyx_GIVEREF(__pyx_v_self->lastchunkarr);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_self->lastchunkarr);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_xchunks, __pyx_t_6) < 0) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_v_meta_info, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1755
 *                      self.expectedlen, self.cbytes, self.chunklen)
 *         cview._open_carray(*meta_info, xchunks=(self.chunks, self.lastchunkarr))
 *         return cview             # <<<<<<<<<<<<<<
 * 
 *     def sum(self, dtype=None):
 */
  __Pyx_TraceLine(1755,0,__PYX_ERR(0, 1755, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_cview));
  __pyx_r = ((PyObject *)__pyx_v_cview);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1736
 *         return ccopy
 * 
 *     def view(self):             # <<<<<<<<<<<<<<
 *         """Create a light weight view of the data in the original carray.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_cview);
  __Pyx_XDECREF(__pyx_v_meta_info);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1757
 *         return cview
 * 
 *     def sum(self, dtype=None):             # <<<<<<<<<<<<<<
 *         """Return the sum of the array elements.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_29sum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_28sum[] = "carray.sum(self, dtype=None)\nReturn the sum of the array elements.\n\n        Parameters\n        ----------\n        dtype : NumPy dtype\n            The desired type of the output.  If ``None``, the dtype of\n            `self` is\n            used.  An exception is when `self` has an integer type with less\n            precision than the default platform integer.  In that case, the\n            default platform integer is used instead (NumPy convention).\n\n\n        Returns\n        -------\n        out : NumPy scalar with `dtype`\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_29sum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dtype = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sum (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,0};
    PyObject* values[1] = {0};
    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_dtype);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sum") < 0)) __PYX_ERR(0, 1757, __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_dtype = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sum", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1757, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_28sum(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_dtype);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_28sum(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_dtype) {
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = 0;
  npy_intp __pyx_v_nchunks;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_leftover = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("sum", 0);
  __Pyx_TraceCall("sum", __pyx_f[0], 1757, 0, __PYX_ERR(0, 1757, __pyx_L1_error));
  __Pyx_INCREF(__pyx_v_dtype);

  /* "bcolz/carray_ext.pyx":1779
 *         cdef object result
 * 
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             dtype = self._dtype.base
 *             # Check if we have less precision than required for ints
 */
  __Pyx_TraceLine(1779,0,__PYX_ERR(0, 1779, __pyx_L1_error))
  __pyx_t_1 = (__pyx_v_dtype == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1780
 * 
 *         if dtype is None:
 *             dtype = self._dtype.base             # <<<<<<<<<<<<<<
 *             # Check if we have less precision than required for ints
 *             # (mimick NumPy logic)
 */
    __Pyx_TraceLine(1780,0,__PYX_ERR(0, 1780, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1783
 *             # Check if we have less precision than required for ints
 *             # (mimick NumPy logic)
 *             if dtype.kind in ('b', 'i') and dtype.itemsize < IntType.itemsize:             # <<<<<<<<<<<<<<
 *                 dtype = IntType
 *         else:
 */
    __Pyx_TraceLine(1783,0,__PYX_ERR(0, 1783, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_b, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1783, __pyx_L1_error)
    if (!__pyx_t_4) {
    } else {
      __pyx_t_1 = __pyx_t_4;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_i, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1783, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_4;
    __pyx_L7_bool_binop_done:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = (__pyx_t_1 != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_IntType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1783, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1783, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __pyx_t_4;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1784
 *             # (mimick NumPy logic)
 *             if dtype.kind in ('b', 'i') and dtype.itemsize < IntType.itemsize:
 *                 dtype = IntType             # <<<<<<<<<<<<<<
 *         else:
 *             dtype = np.dtype(dtype)
 */
      __Pyx_TraceLine(1784,0,__PYX_ERR(0, 1784, __pyx_L1_error))
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_IntType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1784, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":1783
 *             # Check if we have less precision than required for ints
 *             # (mimick NumPy logic)
 *             if dtype.kind in ('b', 'i') and dtype.itemsize < IntType.itemsize:             # <<<<<<<<<<<<<<
 *                 dtype = IntType
 *         else:
 */
    }

    /* "bcolz/carray_ext.pyx":1779
 *         cdef object result
 * 
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             dtype = self._dtype.base
 *             # Check if we have less precision than required for ints
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":1786
 *                 dtype = IntType
 *         else:
 *             dtype = np.dtype(dtype)             # <<<<<<<<<<<<<<
 *         if dtype.kind == 'S':
 *             raise TypeError("cannot perform reduce with flexible type")
 */
  __Pyx_TraceLine(1786,0,__PYX_ERR(0, 1786, __pyx_L1_error))
  /*else*/ {
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_dtype);
    __Pyx_GIVEREF(__pyx_v_dtype);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dtype);
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_6);
    __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":1787
 *         else:
 *             dtype = np.dtype(dtype)
 *         if dtype.kind == 'S':             # <<<<<<<<<<<<<<
 *             raise TypeError("cannot perform reduce with flexible type")
 * 
 */
  __Pyx_TraceLine(1787,0,__PYX_ERR(0, 1787, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1788
 *             dtype = np.dtype(dtype)
 *         if dtype.kind == 'S':
 *             raise TypeError("cannot perform reduce with flexible type")             # <<<<<<<<<<<<<<
 * 
 *         # Get a container for the result
 */
    __Pyx_TraceLine(1788,0,__PYX_ERR(0, 1788, __pyx_L1_error))
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 1788, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":1787
 *         else:
 *             dtype = np.dtype(dtype)
 *         if dtype.kind == 'S':             # <<<<<<<<<<<<<<
 *             raise TypeError("cannot perform reduce with flexible type")
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1791
 * 
 *         # Get a container for the result
 *         result = np.zeros(1, dtype=dtype)[0]             # <<<<<<<<<<<<<<
 * 
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */
  __Pyx_TraceLine(1791,0,__PYX_ERR(0, 1791, __pyx_L1_error))
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 1791, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__75, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1793
 *         result = np.zeros(1, dtype=dtype)[0]
 * 
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         for chunk_ in self.chunks:
 *             if chunk_.isconstant:
 */
  __Pyx_TraceLine(1793,0,__PYX_ERR(0, 1793, __pyx_L1_error))
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":1794
 * 
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         for chunk_ in self.chunks:             # <<<<<<<<<<<<<<
 *             if chunk_.isconstant:
 *                 result += chunk_.constant * self._chunklen
 */
  __Pyx_TraceLine(1794,0,__PYX_ERR(0, 1794, __pyx_L1_error))
  if (likely(PyList_CheckExact(__pyx_v_self->chunks)) || PyTuple_CheckExact(__pyx_v_self->chunks)) {
    __pyx_t_6 = __pyx_v_self->chunks; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_self->chunks); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1794, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1794, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1794, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_8(__pyx_t_6);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1794, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5bcolz_10carray_ext_chunk))))) __PYX_ERR(0, 1794, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_chunk_, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1795
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         for chunk_ in self.chunks:
 *             if chunk_.isconstant:             # <<<<<<<<<<<<<<
 *                 result += chunk_.constant * self._chunklen
 *             elif self._dtype.type == np.bool_:
 */
    __Pyx_TraceLine(1795,0,__PYX_ERR(0, 1795, __pyx_L1_error))
    __pyx_t_2 = (__pyx_v_chunk_->isconstant != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1796
 *         for chunk_ in self.chunks:
 *             if chunk_.isconstant:
 *                 result += chunk_.constant * self._chunklen             # <<<<<<<<<<<<<<
 *             elif self._dtype.type == np.bool_:
 *                 result += chunk_.true_count
 */
      __Pyx_TraceLine(1796,0,__PYX_ERR(0, 1796, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->_chunklen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyNumber_Multiply(__pyx_v_chunk_->constant, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":1795
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         for chunk_ in self.chunks:
 *             if chunk_.isconstant:             # <<<<<<<<<<<<<<
 *                 result += chunk_.constant * self._chunklen
 *             elif self._dtype.type == np.bool_:
 */
      goto __pyx_L12;
    }

    /* "bcolz/carray_ext.pyx":1797
 *             if chunk_.isconstant:
 *                 result += chunk_.constant * self._chunklen
 *             elif self._dtype.type == np.bool_:             # <<<<<<<<<<<<<<
 *                 result += chunk_.true_count
 *             else:
 */
    __Pyx_TraceLine(1797,0,__PYX_ERR(0, 1797, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_bool); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1797, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1798
 *                 result += chunk_.constant * self._chunklen
 *             elif self._dtype.type == np.bool_:
 *                 result += chunk_.true_count             # <<<<<<<<<<<<<<
 *             else:
 *                 result += chunk_[:].sum(dtype=dtype)
 */
      __Pyx_TraceLine(1798,0,__PYX_ERR(0, 1798, __pyx_L1_error))
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_chunk_->true_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1798, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1798, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "bcolz/carray_ext.pyx":1797
 *             if chunk_.isconstant:
 *                 result += chunk_.constant * self._chunklen
 *             elif self._dtype.type == np.bool_:             # <<<<<<<<<<<<<<
 *                 result += chunk_.true_count
 *             else:
 */
      goto __pyx_L12;
    }

    /* "bcolz/carray_ext.pyx":1800
 *                 result += chunk_.true_count
 *             else:
 *                 result += chunk_[:].sum(dtype=dtype)             # <<<<<<<<<<<<<<
 *         if self.leftover:
 *             leftover = self.len - nchunks * self._chunklen
 */
    __Pyx_TraceLine(1800,0,__PYX_ERR(0, 1800, __pyx_L1_error))
    /*else*/ {
      __pyx_t_9 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_chunk_), 0, 0, NULL, NULL, &__pyx_slice__76, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 1800, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_9);
      __pyx_t_9 = 0;
    }
    __pyx_L12:;

    /* "bcolz/carray_ext.pyx":1794
 * 
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         for chunk_ in self.chunks:             # <<<<<<<<<<<<<<
 *             if chunk_.isconstant:
 *                 result += chunk_.constant * self._chunklen
 */
    __Pyx_TraceLine(1794,0,__PYX_ERR(0, 1794, __pyx_L1_error))
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1801
 *             else:
 *                 result += chunk_[:].sum(dtype=dtype)
 *         if self.leftover:             # <<<<<<<<<<<<<<
 *             leftover = self.len - nchunks * self._chunklen
 *             result += self.lastchunkarr[:leftover].sum(dtype=dtype)
 */
  __Pyx_TraceLine(1801,0,__PYX_ERR(0, 1801, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_self->leftover != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1802
 *                 result += chunk_[:].sum(dtype=dtype)
 *         if self.leftover:
 *             leftover = self.len - nchunks * self._chunklen             # <<<<<<<<<<<<<<
 *             result += self.lastchunkarr[:leftover].sum(dtype=dtype)
 * 
 */
    __Pyx_TraceLine(1802,0,__PYX_ERR(0, 1802, __pyx_L1_error))
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_nchunks * __pyx_v_self->_chunklen)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_leftover = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1803
 *         if self.leftover:
 *             leftover = self.len - nchunks * self._chunklen
 *             result += self.lastchunkarr[:leftover].sum(dtype=dtype)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __Pyx_TraceLine(1803,0,__PYX_ERR(0, 1803, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_self->lastchunkarr, 0, 0, NULL, &__pyx_v_leftover, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 1803, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1801
 *             else:
 *                 result += chunk_[:].sum(dtype=dtype)
 *         if self.leftover:             # <<<<<<<<<<<<<<
 *             leftover = self.len - nchunks * self._chunklen
 *             result += self.lastchunkarr[:leftover].sum(dtype=dtype)
 */
  }

  /* "bcolz/carray_ext.pyx":1805
 *             result += self.lastchunkarr[:leftover].sum(dtype=dtype)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_TraceLine(1805,0,__PYX_ERR(0, 1805, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1757
 *         return cview
 * 
 *     def sum(self, dtype=None):             # <<<<<<<<<<<<<<
 *         """Return the sum of the array elements.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_leftover);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1807
 *         return result
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.len
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_5bcolz_10carray_ext_6carray_31__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_5bcolz_10carray_ext_6carray_31__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_30__len__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_5bcolz_10carray_ext_6carray_30__len__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __Pyx_RefNannySetupContext("__len__", 0);
  __Pyx_TraceCall("__len__", __pyx_f[0], 1807, 0, __PYX_ERR(0, 1807, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1808
 * 
 *     def __len__(self):
 *         return self.len             # <<<<<<<<<<<<<<
 * 
 *     def __sizeof__(self):
 */
  __Pyx_TraceLine(1808,0,__PYX_ERR(0, 1808, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1808, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1807
 *         return result
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.len
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1810
 *         return self.len
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         return self._cbytes
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_33__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_32__sizeof__[] = "carray.__sizeof__(self)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_33__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sizeof__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_32__sizeof__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_32__sizeof__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__sizeof__", 0);
  __Pyx_TraceCall("__sizeof__", __pyx_f[0], 1810, 0, __PYX_ERR(0, 1810, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1811
 * 
 *     def __sizeof__(self):
 *         return self._cbytes             # <<<<<<<<<<<<<<
 * 
 *     cdef int getitem_cache(self, npy_intp pos, char *dest):
 */
  __Pyx_TraceLine(1811,0,__PYX_ERR(0, 1811, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_cbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1810
 *         return self.len
 * 
 *     def __sizeof__(self):             # <<<<<<<<<<<<<<
 *         return self._cbytes
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__sizeof__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1813
 *         return self._cbytes
 * 
 *     cdef int getitem_cache(self, npy_intp pos, char *dest):             # <<<<<<<<<<<<<<
 *         """Get a single item and put it in `dest`.  It caches a complete block.
 * 
 */

static int __pyx_f_5bcolz_10carray_ext_6carray_getitem_cache(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, npy_intp __pyx_v_pos, char *__pyx_v_dest) {
  int __pyx_v_atomsize;
  int __pyx_v_blocksize;
  int __pyx_v_offset;
  int __pyx_v_extent;
  int __pyx_v_idxcache;
  int __pyx_v_posinbytes;
  int __pyx_v_blocklen;
  npy_intp __pyx_v_nchunk;
  npy_intp __pyx_v_nchunks;
  npy_intp __pyx_v_chunklen;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = 0;
  int __pyx_r;
  __Pyx_TraceDeclarations
  __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;
  PyObject *__pyx_t_7 = NULL;
  char *__pyx_t_8;
  __Pyx_RefNannySetupContext("getitem_cache", 0);
  __Pyx_TraceCall("getitem_cache", __pyx_f[0], 1813, 0, __PYX_ERR(0, 1813, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1833
 *         cdef chunk chunk_
 * 
 *         atomsize = self.atomsize             # <<<<<<<<<<<<<<
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         chunklen = self._chunklen
 */
  __Pyx_TraceLine(1833,0,__PYX_ERR(0, 1833, __pyx_L1_error))
  __pyx_t_1 = __pyx_v_self->atomsize;
  __pyx_v_atomsize = __pyx_t_1;

  /* "bcolz/carray_ext.pyx":1834
 * 
 *         atomsize = self.atomsize
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         chunklen = self._chunklen
 *         nchunk = <npy_intp> cython.cdiv(pos, chunklen)
 */
  __Pyx_TraceLine(1834,0,__PYX_ERR(0, 1834, __pyx_L1_error))
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":1835
 *         atomsize = self.atomsize
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         chunklen = self._chunklen             # <<<<<<<<<<<<<<
 *         nchunk = <npy_intp> cython.cdiv(pos, chunklen)
 *         pos -= nchunk * chunklen
 */
  __Pyx_TraceLine(1835,0,__PYX_ERR(0, 1835, __pyx_L1_error))
  __pyx_t_1 = __pyx_v_self->_chunklen;
  __pyx_v_chunklen = __pyx_t_1;

  /* "bcolz/carray_ext.pyx":1836
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         chunklen = self._chunklen
 *         nchunk = <npy_intp> cython.cdiv(pos, chunklen)             # <<<<<<<<<<<<<<
 *         pos -= nchunk * chunklen
 * 
 */
  __Pyx_TraceLine(1836,0,__PYX_ERR(0, 1836, __pyx_L1_error))
  __pyx_v_nchunk = ((npy_intp)(__pyx_v_pos / __pyx_v_chunklen));

  /* "bcolz/carray_ext.pyx":1837
 *         chunklen = self._chunklen
 *         nchunk = <npy_intp> cython.cdiv(pos, chunklen)
 *         pos -= nchunk * chunklen             # <<<<<<<<<<<<<<
 * 
 *         # Check whether pos is in the last chunk
 */
  __Pyx_TraceLine(1837,0,__PYX_ERR(0, 1837, __pyx_L1_error))
  __pyx_v_pos = (__pyx_v_pos - (__pyx_v_nchunk * __pyx_v_chunklen));

  /* "bcolz/carray_ext.pyx":1840
 * 
 *         # Check whether pos is in the last chunk
 *         if nchunk == nchunks and self.leftover:             # <<<<<<<<<<<<<<
 *             posinbytes = (pos % chunklen) * atomsize
 *             memcpy(dest, self.lastchunk + posinbytes, atomsize)
 */
  __Pyx_TraceLine(1840,0,__PYX_ERR(0, 1840, __pyx_L1_error))
  __pyx_t_3 = ((__pyx_v_nchunk == __pyx_v_nchunks) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_self->leftover != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1841
 *         # Check whether pos is in the last chunk
 *         if nchunk == nchunks and self.leftover:
 *             posinbytes = (pos % chunklen) * atomsize             # <<<<<<<<<<<<<<
 *             memcpy(dest, self.lastchunk + posinbytes, atomsize)
 *             return 1
 */
    __Pyx_TraceLine(1841,0,__PYX_ERR(0, 1841, __pyx_L1_error))
    if (unlikely(__pyx_v_chunklen == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 1841, __pyx_L1_error)
    }
    __pyx_v_posinbytes = (__Pyx_mod_npy_intp(__pyx_v_pos, __pyx_v_chunklen) * __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":1842
 *         if nchunk == nchunks and self.leftover:
 *             posinbytes = (pos % chunklen) * atomsize
 *             memcpy(dest, self.lastchunk + posinbytes, atomsize)             # <<<<<<<<<<<<<<
 *             return 1
 * 
 */
    __Pyx_TraceLine(1842,0,__PYX_ERR(0, 1842, __pyx_L1_error))
    memcpy(__pyx_v_dest, (__pyx_v_self->lastchunk + __pyx_v_posinbytes), __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":1843
 *             posinbytes = (pos % chunklen) * atomsize
 *             memcpy(dest, self.lastchunk + posinbytes, atomsize)
 *             return 1             # <<<<<<<<<<<<<<
 * 
 *         # Locate the *block* inside the chunk
 */
    __Pyx_TraceLine(1843,0,__PYX_ERR(0, 1843, __pyx_L1_error))
    __pyx_r = 1;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1840
 * 
 *         # Check whether pos is in the last chunk
 *         if nchunk == nchunks and self.leftover:             # <<<<<<<<<<<<<<
 *             posinbytes = (pos % chunklen) * atomsize
 *             memcpy(dest, self.lastchunk + posinbytes, atomsize)
 */
  }

  /* "bcolz/carray_ext.pyx":1846
 * 
 *         # Locate the *block* inside the chunk
 *         chunk_ = self.chunks[nchunk]             # <<<<<<<<<<<<<<
 *         blocksize = chunk_.blocksize
 *         blocklen = <npy_intp> cython.cdiv(blocksize, atomsize)
 */
  __Pyx_TraceLine(1846,0,__PYX_ERR(0, 1846, __pyx_L1_error))
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self->chunks, __pyx_v_nchunk, npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5bcolz_10carray_ext_chunk))))) __PYX_ERR(0, 1846, __pyx_L1_error)
  __pyx_v_chunk_ = ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "bcolz/carray_ext.pyx":1847
 *         # Locate the *block* inside the chunk
 *         chunk_ = self.chunks[nchunk]
 *         blocksize = chunk_.blocksize             # <<<<<<<<<<<<<<
 *         blocklen = <npy_intp> cython.cdiv(blocksize, atomsize)
 * 
 */
  __Pyx_TraceLine(1847,0,__PYX_ERR(0, 1847, __pyx_L1_error))
  __pyx_t_1 = __pyx_v_chunk_->blocksize;
  __pyx_v_blocksize = __pyx_t_1;

  /* "bcolz/carray_ext.pyx":1848
 *         chunk_ = self.chunks[nchunk]
 *         blocksize = chunk_.blocksize
 *         blocklen = <npy_intp> cython.cdiv(blocksize, atomsize)             # <<<<<<<<<<<<<<
 * 
 *         if (atomsize > blocksize):
 */
  __Pyx_TraceLine(1848,0,__PYX_ERR(0, 1848, __pyx_L1_error))
  __pyx_v_blocklen = ((npy_intp)(__pyx_v_blocksize / __pyx_v_atomsize));

  /* "bcolz/carray_ext.pyx":1850
 *         blocklen = <npy_intp> cython.cdiv(blocksize, atomsize)
 * 
 *         if (atomsize > blocksize):             # <<<<<<<<<<<<<<
 *             # This request cannot be resolved here
 *             return 0
 */
  __Pyx_TraceLine(1850,0,__PYX_ERR(0, 1850, __pyx_L1_error))
  __pyx_t_2 = ((__pyx_v_atomsize > __pyx_v_blocksize) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1852
 *         if (atomsize > blocksize):
 *             # This request cannot be resolved here
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *         # Check whether the cache block has to be initialized
 */
    __Pyx_TraceLine(1852,0,__PYX_ERR(0, 1852, __pyx_L1_error))
    __pyx_r = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1850
 *         blocklen = <npy_intp> cython.cdiv(blocksize, atomsize)
 * 
 *         if (atomsize > blocksize):             # <<<<<<<<<<<<<<
 *             # This request cannot be resolved here
 *             return 0
 */
  }

  /* "bcolz/carray_ext.pyx":1855
 * 
 *         # Check whether the cache block has to be initialized
 *         if self.idxcache < 0:             # <<<<<<<<<<<<<<
 *             self.blockcache = np.empty(shape=(blocklen,), dtype=self._dtype)
 *             self.datacache = self.blockcache.data
 */
  __Pyx_TraceLine(1855,0,__PYX_ERR(0, 1855, __pyx_L1_error))
  __pyx_t_2 = ((__pyx_v_self->idxcache < 0) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1856
 *         # Check whether the cache block has to be initialized
 *         if self.idxcache < 0:
 *             self.blockcache = np.empty(shape=(blocklen,), dtype=self._dtype)             # <<<<<<<<<<<<<<
 *             self.datacache = self.blockcache.data
 * 
 */
    __Pyx_TraceLine(1856,0,__PYX_ERR(0, 1856, __pyx_L1_error))
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_blocklen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_7) < 0) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) __PYX_ERR(0, 1856, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1856, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_v_self->blockcache);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->blockcache));
    __pyx_v_self->blockcache = ((PyArrayObject *)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "bcolz/carray_ext.pyx":1857
 *         if self.idxcache < 0:
 *             self.blockcache = np.empty(shape=(blocklen,), dtype=self._dtype)
 *             self.datacache = self.blockcache.data             # <<<<<<<<<<<<<<
 * 
 *         # Check if block is cached
 */
    __Pyx_TraceLine(1857,0,__PYX_ERR(0, 1857, __pyx_L1_error))
    __pyx_t_8 = __pyx_v_self->blockcache->data;
    __pyx_v_self->datacache = __pyx_t_8;

    /* "bcolz/carray_ext.pyx":1855
 * 
 *         # Check whether the cache block has to be initialized
 *         if self.idxcache < 0:             # <<<<<<<<<<<<<<
 *             self.blockcache = np.empty(shape=(blocklen,), dtype=self._dtype)
 *             self.datacache = self.blockcache.data
 */
  }

  /* "bcolz/carray_ext.pyx":1860
 * 
 *         # Check if block is cached
 *         offset = <npy_intp> cython.cdiv(pos, blocklen) * blocklen             # <<<<<<<<<<<<<<
 *         posinbytes = (pos % blocklen) * atomsize
 *         idxcache = nchunk * chunklen + offset
 */
  __Pyx_TraceLine(1860,0,__PYX_ERR(0, 1860, __pyx_L1_error))
  __pyx_v_offset = (((npy_intp)(__pyx_v_pos / __pyx_v_blocklen)) * __pyx_v_blocklen);

  /* "bcolz/carray_ext.pyx":1861
 *         # Check if block is cached
 *         offset = <npy_intp> cython.cdiv(pos, blocklen) * blocklen
 *         posinbytes = (pos % blocklen) * atomsize             # <<<<<<<<<<<<<<
 *         idxcache = nchunk * chunklen + offset
 *         if idxcache == self.idxcache:
 */
  __Pyx_TraceLine(1861,0,__PYX_ERR(0, 1861, __pyx_L1_error))
  if (unlikely(__pyx_v_blocklen == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(0, 1861, __pyx_L1_error)
  }
  __pyx_v_posinbytes = (__Pyx_mod_npy_intp(__pyx_v_pos, __pyx_v_blocklen) * __pyx_v_atomsize);

  /* "bcolz/carray_ext.pyx":1862
 *         offset = <npy_intp> cython.cdiv(pos, blocklen) * blocklen
 *         posinbytes = (pos % blocklen) * atomsize
 *         idxcache = nchunk * chunklen + offset             # <<<<<<<<<<<<<<
 *         if idxcache == self.idxcache:
 *             # Hit!
 */
  __Pyx_TraceLine(1862,0,__PYX_ERR(0, 1862, __pyx_L1_error))
  __pyx_v_idxcache = ((__pyx_v_nchunk * __pyx_v_chunklen) + __pyx_v_offset);

  /* "bcolz/carray_ext.pyx":1863
 *         posinbytes = (pos % blocklen) * atomsize
 *         idxcache = nchunk * chunklen + offset
 *         if idxcache == self.idxcache:             # <<<<<<<<<<<<<<
 *             # Hit!
 *             memcpy(dest, self.datacache + posinbytes, atomsize)
 */
  __Pyx_TraceLine(1863,0,__PYX_ERR(0, 1863, __pyx_L1_error))
  __pyx_t_2 = ((__pyx_v_idxcache == __pyx_v_self->idxcache) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1865
 *         if idxcache == self.idxcache:
 *             # Hit!
 *             memcpy(dest, self.datacache + posinbytes, atomsize)             # <<<<<<<<<<<<<<
 *             return 1
 * 
 */
    __Pyx_TraceLine(1865,0,__PYX_ERR(0, 1865, __pyx_L1_error))
    memcpy(__pyx_v_dest, (__pyx_v_self->datacache + __pyx_v_posinbytes), __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":1866
 *             # Hit!
 *             memcpy(dest, self.datacache + posinbytes, atomsize)
 *             return 1             # <<<<<<<<<<<<<<
 * 
 *         # No luck. Read a complete block.
 */
    __Pyx_TraceLine(1866,0,__PYX_ERR(0, 1866, __pyx_L1_error))
    __pyx_r = 1;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1863
 *         posinbytes = (pos % blocklen) * atomsize
 *         idxcache = nchunk * chunklen + offset
 *         if idxcache == self.idxcache:             # <<<<<<<<<<<<<<
 *             # Hit!
 *             memcpy(dest, self.datacache + posinbytes, atomsize)
 */
  }

  /* "bcolz/carray_ext.pyx":1869
 * 
 *         # No luck. Read a complete block.
 *         extent = blocklen             # <<<<<<<<<<<<<<
 *         if offset + blocklen > chunklen:
 *             extent = chunklen % blocklen
 */
  __Pyx_TraceLine(1869,0,__PYX_ERR(0, 1869, __pyx_L1_error))
  __pyx_v_extent = __pyx_v_blocklen;

  /* "bcolz/carray_ext.pyx":1870
 *         # No luck. Read a complete block.
 *         extent = blocklen
 *         if offset + blocklen > chunklen:             # <<<<<<<<<<<<<<
 *             extent = chunklen % blocklen
 *         chunk_._getitem(offset, offset + extent, self.datacache)
 */
  __Pyx_TraceLine(1870,0,__PYX_ERR(0, 1870, __pyx_L1_error))
  __pyx_t_2 = (((__pyx_v_offset + __pyx_v_blocklen) > __pyx_v_chunklen) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1871
 *         extent = blocklen
 *         if offset + blocklen > chunklen:
 *             extent = chunklen % blocklen             # <<<<<<<<<<<<<<
 *         chunk_._getitem(offset, offset + extent, self.datacache)
 *         # Copy the interesting bits to dest
 */
    __Pyx_TraceLine(1871,0,__PYX_ERR(0, 1871, __pyx_L1_error))
    if (unlikely(__pyx_v_blocklen == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 1871, __pyx_L1_error)
    }
    __pyx_v_extent = __Pyx_mod_npy_intp(__pyx_v_chunklen, __pyx_v_blocklen);

    /* "bcolz/carray_ext.pyx":1870
 *         # No luck. Read a complete block.
 *         extent = blocklen
 *         if offset + blocklen > chunklen:             # <<<<<<<<<<<<<<
 *             extent = chunklen % blocklen
 *         chunk_._getitem(offset, offset + extent, self.datacache)
 */
  }

  /* "bcolz/carray_ext.pyx":1872
 *         if offset + blocklen > chunklen:
 *             extent = chunklen % blocklen
 *         chunk_._getitem(offset, offset + extent, self.datacache)             # <<<<<<<<<<<<<<
 *         # Copy the interesting bits to dest
 *         memcpy(dest, self.datacache + posinbytes, atomsize)
 */
  __Pyx_TraceLine(1872,0,__PYX_ERR(0, 1872, __pyx_L1_error))
  ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk *)__pyx_v_chunk_->__pyx_vtab)->_getitem(__pyx_v_chunk_, __pyx_v_offset, (__pyx_v_offset + __pyx_v_extent), __pyx_v_self->datacache);

  /* "bcolz/carray_ext.pyx":1874
 *         chunk_._getitem(offset, offset + extent, self.datacache)
 *         # Copy the interesting bits to dest
 *         memcpy(dest, self.datacache + posinbytes, atomsize)             # <<<<<<<<<<<<<<
 *         # Update the cache index
 *         self.idxcache = idxcache
 */
  __Pyx_TraceLine(1874,0,__PYX_ERR(0, 1874, __pyx_L1_error))
  memcpy(__pyx_v_dest, (__pyx_v_self->datacache + __pyx_v_posinbytes), __pyx_v_atomsize);

  /* "bcolz/carray_ext.pyx":1876
 *         memcpy(dest, self.datacache + posinbytes, atomsize)
 *         # Update the cache index
 *         self.idxcache = idxcache             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */
  __Pyx_TraceLine(1876,0,__PYX_ERR(0, 1876, __pyx_L1_error))
  __pyx_v_self->idxcache = __pyx_v_idxcache;

  /* "bcolz/carray_ext.pyx":1877
 *         # Update the cache index
 *         self.idxcache = idxcache
 *         return 1             # <<<<<<<<<<<<<<
 * 
 *     def free_cachemem(self):
 */
  __Pyx_TraceLine(1877,0,__PYX_ERR(0, 1877, __pyx_L1_error))
  __pyx_r = 1;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1813
 *         return self._cbytes
 * 
 *     cdef int getitem_cache(self, npy_intp pos, char *dest):             # <<<<<<<<<<<<<<
 *         """Get a single item and put it in `dest`.  It caches a complete block.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("bcolz.carray_ext.carray.getitem_cache", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1879
 *         return 1
 * 
 *     def free_cachemem(self):             # <<<<<<<<<<<<<<
 *         """Release in-memory cached chunk"""
 *         if type(self.chunks) is not list:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_35free_cachemem(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_34free_cachemem[] = "carray.free_cachemem(self)\nRelease in-memory cached chunk";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_35free_cachemem(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_cachemem (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_34free_cachemem(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_34free_cachemem(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  __Pyx_RefNannySetupContext("free_cachemem", 0);
  __Pyx_TraceCall("free_cachemem", __pyx_f[0], 1879, 0, __PYX_ERR(0, 1879, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1881
 *     def free_cachemem(self):
 *         """Release in-memory cached chunk"""
 *         if type(self.chunks) is not list:             # <<<<<<<<<<<<<<
 *             self.chunks.free_cachemem()
 *         self.idxcache = -1
 */
  __Pyx_TraceLine(1881,0,__PYX_ERR(0, 1881, __pyx_L1_error))
  __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_self->chunks)) != ((PyObject *)(&PyList_Type)));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1882
 *         """Release in-memory cached chunk"""
 *         if type(self.chunks) is not list:
 *             self.chunks.free_cachemem()             # <<<<<<<<<<<<<<
 *         self.idxcache = -1
 *         self.blockcache = None
 */
    __Pyx_TraceLine(1882,0,__PYX_ERR(0, 1882, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->chunks, __pyx_n_s_free_cachemem); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1881
 *     def free_cachemem(self):
 *         """Release in-memory cached chunk"""
 *         if type(self.chunks) is not list:             # <<<<<<<<<<<<<<
 *             self.chunks.free_cachemem()
 *         self.idxcache = -1
 */
  }

  /* "bcolz/carray_ext.pyx":1883
 *         if type(self.chunks) is not list:
 *             self.chunks.free_cachemem()
 *         self.idxcache = -1             # <<<<<<<<<<<<<<
 *         self.blockcache = None
 * 
 */
  __Pyx_TraceLine(1883,0,__PYX_ERR(0, 1883, __pyx_L1_error))
  __pyx_v_self->idxcache = -1;

  /* "bcolz/carray_ext.pyx":1884
 *             self.chunks.free_cachemem()
 *         self.idxcache = -1
 *         self.blockcache = None             # <<<<<<<<<<<<<<
 * 
 *     def _getitem_object(self, start, stop=None, step=None):
 */
  __Pyx_TraceLine(1884,0,__PYX_ERR(0, 1884, __pyx_L1_error))
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->blockcache);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->blockcache));
  __pyx_v_self->blockcache = ((PyArrayObject *)Py_None);

  /* "bcolz/carray_ext.pyx":1879
 *         return 1
 * 
 *     def free_cachemem(self):             # <<<<<<<<<<<<<<
 *         """Release in-memory cached chunk"""
 *         if type(self.chunks) is not list:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.free_cachemem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1886
 *         self.blockcache = None
 * 
 *     def _getitem_object(self, start, stop=None, step=None):             # <<<<<<<<<<<<<<
 *         """Retrieve elements of type object."""
 *         import pickle
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_37_getitem_object(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_36_getitem_object[] = "carray._getitem_object(self, start, stop=None, step=None)\nRetrieve elements of type object.";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_37_getitem_object(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_getitem_object (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_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_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_getitem_object") < 0)) __PYX_ERR(0, 1886, __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_getitem_object", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1886, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray._getitem_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_36_getitem_object(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_36_getitem_object(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_v_pickle = NULL;
  PyObject *__pyx_v_cchunk = NULL;
  PyObject *__pyx_v_chunk = NULL;
  PyObject *__pyx_v_objs = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("_getitem_object", 0);
  __Pyx_TraceCall("_getitem_object", __pyx_f[0], 1886, 0, __PYX_ERR(0, 1886, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":1888
 *     def _getitem_object(self, start, stop=None, step=None):
 *         """Retrieve elements of type object."""
 *         import pickle             # <<<<<<<<<<<<<<
 * 
 *         if stop is None and step is None:
 */
  __Pyx_TraceLine(1888,0,__PYX_ERR(0, 1888, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pickle, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pickle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1890
 *         import pickle
 * 
 *         if stop is None and step is None:             # <<<<<<<<<<<<<<
 *             # Integer
 *             cchunk = self.chunks[start]
 */
  __Pyx_TraceLine(1890,0,__PYX_ERR(0, 1890, __pyx_L1_error))
  __pyx_t_3 = (__pyx_v_stop == Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = (__pyx_v_step == Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1892
 *         if stop is None and step is None:
 *             # Integer
 *             cchunk = self.chunks[start]             # <<<<<<<<<<<<<<
 *             chunk = cchunk.getudata()
 *             return pickle.loads(chunk)
 */
    __Pyx_TraceLine(1892,0,__PYX_ERR(0, 1892, __pyx_L1_error))
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->chunks, __pyx_v_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_cchunk = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1893
 *             # Integer
 *             cchunk = self.chunks[start]
 *             chunk = cchunk.getudata()             # <<<<<<<<<<<<<<
 *             return pickle.loads(chunk)
 * 
 */
    __Pyx_TraceLine(1893,0,__PYX_ERR(0, 1893, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cchunk, __pyx_n_s_getudata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_chunk = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1894
 *             cchunk = self.chunks[start]
 *             chunk = cchunk.getudata()
 *             return pickle.loads(chunk)             # <<<<<<<<<<<<<<
 * 
 *         # Range
 */
    __Pyx_TraceLine(1894,0,__PYX_ERR(0, 1894, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pickle, __pyx_n_s_loads); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_chunk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_chunk);
      __Pyx_GIVEREF(__pyx_v_chunk);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_chunk);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1890
 *         import pickle
 * 
 *         if stop is None and step is None:             # <<<<<<<<<<<<<<
 *             # Integer
 *             cchunk = self.chunks[start]
 */
  }

  /* "bcolz/carray_ext.pyx":1897
 * 
 *         # Range
 *         objs = [self._getitem_object(i) for i in xrange(start, stop, step)]             # <<<<<<<<<<<<<<
 *         return np.array(objs, dtype=self._dtype)
 * 
 */
  __Pyx_TraceLine(1897,0,__PYX_ERR(0, 1897, __pyx_L1_error))
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_start);
  __Pyx_GIVEREF(__pyx_v_start);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_start);
  __Pyx_INCREF(__pyx_v_stop);
  __Pyx_GIVEREF(__pyx_v_stop);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_stop);
  __Pyx_INCREF(__pyx_v_step);
  __Pyx_GIVEREF(__pyx_v_step);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_step);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1897, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1897, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1897, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1897, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1897, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_9(__pyx_t_5);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1897, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem_object); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_10) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1897, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1897, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
      __Pyx_INCREF(__pyx_v_i);
      __Pyx_GIVEREF(__pyx_v_i);
      PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_i);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1897, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1897, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_objs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1898
 *         # Range
 *         objs = [self._getitem_object(i) for i in xrange(start, stop, step)]
 *         return np.array(objs, dtype=self._dtype)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, object key):
 */
  __Pyx_TraceLine(1898,0,__PYX_ERR(0, 1898, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_objs);
  __Pyx_GIVEREF(__pyx_v_objs);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_objs);
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) __PYX_ERR(0, 1898, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1886
 *         self.blockcache = None
 * 
 *     def _getitem_object(self, start, stop=None, step=None):             # <<<<<<<<<<<<<<
 *         """Retrieve elements of type object."""
 *         import pickle
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._getitem_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pickle);
  __Pyx_XDECREF(__pyx_v_cchunk);
  __Pyx_XDECREF(__pyx_v_chunk);
  __Pyx_XDECREF(__pyx_v_objs);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1900
 *         return np.array(objs, dtype=self._dtype)
 * 
 *     def __getitem__(self, object key):             # <<<<<<<<<<<<<<
 *         """ x.__getitem__(key) <==> x[key]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_39__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_38__getitem__[] = " x.__getitem__(key) <==> x[key]\n\n        Returns values based on `key`.  All the functionality of\n        ``ndarray.__getitem__()`` is supported (including fancy indexing),\n        plus a\n        special support for expressions:\n\n        Parameters\n        ----------\n        key : string\n            It will be interpret as a boolean expression (computed via\n            `eval`) and\n            the elements where these values are true will be returned as a\n            NumPy\n            array.\n\n        See Also\n        --------\n        eval\n\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5bcolz_10carray_ext_6carray_38__getitem__;
#endif
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_39__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_38__getitem__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_38__getitem__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_key) {
  int __pyx_v_chunklen;
  npy_intp __pyx_v_startb;
  npy_intp __pyx_v_stopb;
  npy_intp __pyx_v_nchunk;
  npy_intp __pyx_v_nchunks;
  npy_intp __pyx_v_first_chunk;
  npy_intp __pyx_v_last_chunk;
  npy_intp __pyx_v_nwrow;
  npy_intp __pyx_v_blen;
  PyArrayObject *__pyx_v_arr1 = 0;
  PyArrayObject *__pyx_v_dest = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_v_arr = 0;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v__chunk = 0;
  PyObject *__pyx_v_count = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  npy_intp __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *(*__pyx_t_15)(PyObject *);
  npy_intp __pyx_t_16;
  npy_intp __pyx_t_17;
  npy_intp __pyx_t_18;
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_TraceCall("__getitem__", __pyx_f[0], 1900, 0, __PYX_ERR(0, 1900, __pyx_L1_error));
  __Pyx_INCREF(__pyx_v_key);

  /* "bcolz/carray_ext.pyx":1932
 *         cdef chunk _chunk
 * 
 *         chunklen = self._chunklen             # <<<<<<<<<<<<<<
 * 
 *         # Check for integer
 */
  __Pyx_TraceLine(1932,0,__PYX_ERR(0, 1932, __pyx_L1_error))
  __pyx_t_1 = __pyx_v_self->_chunklen;
  __pyx_v_chunklen = __pyx_t_1;

  /* "bcolz/carray_ext.pyx":1935
 * 
 *         # Check for integer
 *         if isinstance(key, _inttypes):             # <<<<<<<<<<<<<<
 *             if key < 0:
 *                 # To support negative values
 */
  __Pyx_TraceLine(1935,0,__PYX_ERR(0, 1935, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":1936
 *         # Check for integer
 *         if isinstance(key, _inttypes):
 *             if key < 0:             # <<<<<<<<<<<<<<
 *                 # To support negative values
 *                 key += self.len
 */
    __Pyx_TraceLine(1936,0,__PYX_ERR(0, 1936, __pyx_L1_error))
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1936, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1936, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1938
 *             if key < 0:
 *                 # To support negative values
 *                 key += self.len             # <<<<<<<<<<<<<<
 *             if key >= self.len:
 *                 raise IndexError("index out of range")
 */
      __Pyx_TraceLine(1938,0,__PYX_ERR(0, 1938, __pyx_L1_error))
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1938, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_key, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1938, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":1936
 *         # Check for integer
 *         if isinstance(key, _inttypes):
 *             if key < 0:             # <<<<<<<<<<<<<<
 *                 # To support negative values
 *                 key += self.len
 */
    }

    /* "bcolz/carray_ext.pyx":1939
 *                 # To support negative values
 *                 key += self.len
 *             if key >= self.len:             # <<<<<<<<<<<<<<
 *                 raise IndexError("index out of range")
 *             arr1 = self.arr1
 */
    __Pyx_TraceLine(1939,0,__PYX_ERR(0, 1939, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1939, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1940
 *                 key += self.len
 *             if key >= self.len:
 *                 raise IndexError("index out of range")             # <<<<<<<<<<<<<<
 *             arr1 = self.arr1
 *             if self.dtype.char == 'O':
 */
      __Pyx_TraceLine(1940,0,__PYX_ERR(0, 1940, __pyx_L1_error))
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1940, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 1940, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1939
 *                 # To support negative values
 *                 key += self.len
 *             if key >= self.len:             # <<<<<<<<<<<<<<
 *                 raise IndexError("index out of range")
 *             arr1 = self.arr1
 */
    }

    /* "bcolz/carray_ext.pyx":1941
 *             if key >= self.len:
 *                 raise IndexError("index out of range")
 *             arr1 = self.arr1             # <<<<<<<<<<<<<<
 *             if self.dtype.char == 'O':
 *                 return self._getitem_object(key)
 */
    __Pyx_TraceLine(1941,0,__PYX_ERR(0, 1941, __pyx_L1_error))
    if (!(likely(((__pyx_v_self->arr1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->arr1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1941, __pyx_L1_error)
    __pyx_t_2 = __pyx_v_self->arr1;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_arr1 = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":1942
 *                 raise IndexError("index out of range")
 *             arr1 = self.arr1
 *             if self.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *                 return self._getitem_object(key)
 *             if self.getitem_cache(key, arr1.data):
 */
    __Pyx_TraceLine(1942,0,__PYX_ERR(0, 1942, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1942, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1943
 *             arr1 = self.arr1
 *             if self.dtype.char == 'O':
 *                 return self._getitem_object(key)             # <<<<<<<<<<<<<<
 *             if self.getitem_cache(key, arr1.data):
 *                 if self.itemsize == self.atomsize:
 */
      __Pyx_TraceLine(1943,0,__PYX_ERR(0, 1943, __pyx_L1_error))
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1943, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1943, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1943, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_key);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1943, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":1942
 *                 raise IndexError("index out of range")
 *             arr1 = self.arr1
 *             if self.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *                 return self._getitem_object(key)
 *             if self.getitem_cache(key, arr1.data):
 */
    }

    /* "bcolz/carray_ext.pyx":1944
 *             if self.dtype.char == 'O':
 *                 return self._getitem_object(key)
 *             if self.getitem_cache(key, arr1.data):             # <<<<<<<<<<<<<<
 *                 if self.itemsize == self.atomsize:
 *                     return PyArray_GETITEM(arr1, arr1.data)
 */
    __Pyx_TraceLine(1944,0,__PYX_ERR(0, 1944, __pyx_L1_error))
    __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_key); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 1944, __pyx_L1_error)
    __pyx_t_4 = (((struct __pyx_vtabstruct_5bcolz_10carray_ext_carray *)__pyx_v_self->__pyx_vtab)->getitem_cache(__pyx_v_self, __pyx_t_8, __pyx_v_arr1->data) != 0);
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1945
 *                 return self._getitem_object(key)
 *             if self.getitem_cache(key, arr1.data):
 *                 if self.itemsize == self.atomsize:             # <<<<<<<<<<<<<<
 *                     return PyArray_GETITEM(arr1, arr1.data)
 *                 else:
 */
      __Pyx_TraceLine(1945,0,__PYX_ERR(0, 1945, __pyx_L1_error))
      __pyx_t_4 = ((__pyx_v_self->itemsize == __pyx_v_self->atomsize) != 0);
      if (__pyx_t_4) {

        /* "bcolz/carray_ext.pyx":1946
 *             if self.getitem_cache(key, arr1.data):
 *                 if self.itemsize == self.atomsize:
 *                     return PyArray_GETITEM(arr1, arr1.data)             # <<<<<<<<<<<<<<
 *                 else:
 *                     return arr1[0].copy()
 */
        __Pyx_TraceLine(1946,0,__PYX_ERR(0, 1946, __pyx_L1_error))
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = PyArray_GETITEM(__pyx_v_arr1, __pyx_v_arr1->data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1946, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;

        /* "bcolz/carray_ext.pyx":1945
 *                 return self._getitem_object(key)
 *             if self.getitem_cache(key, arr1.data):
 *                 if self.itemsize == self.atomsize:             # <<<<<<<<<<<<<<
 *                     return PyArray_GETITEM(arr1, arr1.data)
 *                 else:
 */
      }

      /* "bcolz/carray_ext.pyx":1948
 *                     return PyArray_GETITEM(arr1, arr1.data)
 *                 else:
 *                     return arr1[0].copy()             # <<<<<<<<<<<<<<
 *             # Fallback action: use the slice code
 *             return np.squeeze(self[slice(key, key + 1, 1)])
 */
      __Pyx_TraceLine(1948,0,__PYX_ERR(0, 1948, __pyx_L1_error))
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_arr1), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1948, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1948, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (__pyx_t_2) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1948, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else {
          __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1948, __pyx_L1_error)
        }
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;
      }

      /* "bcolz/carray_ext.pyx":1944
 *             if self.dtype.char == 'O':
 *                 return self._getitem_object(key)
 *             if self.getitem_cache(key, arr1.data):             # <<<<<<<<<<<<<<
 *                 if self.itemsize == self.atomsize:
 *                     return PyArray_GETITEM(arr1, arr1.data)
 */
    }

    /* "bcolz/carray_ext.pyx":1950
 *                     return arr1[0].copy()
 *             # Fallback action: use the slice code
 *             return np.squeeze(self[slice(key, key + 1, 1)])             # <<<<<<<<<<<<<<
 *         # Slices
 *         elif isinstance(key, slice):
 */
    __Pyx_TraceLine(1950,0,__PYX_ERR(0, 1950, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PySlice_New(__pyx_v_key, __pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1950, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1950, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1950, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1935
 * 
 *         # Check for integer
 *         if isinstance(key, _inttypes):             # <<<<<<<<<<<<<<
 *             if key < 0:
 *                 # To support negative values
 */
  }

  /* "bcolz/carray_ext.pyx":1952
 *             return np.squeeze(self[slice(key, key + 1, 1)])
 *         # Slices
 *         elif isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step and step <= 0:
 */
  __Pyx_TraceLine(1952,0,__PYX_ERR(0, 1952, __pyx_L1_error))
  __pyx_t_4 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1953
 *         # Slices
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step             # <<<<<<<<<<<<<<
 *             if step and step <= 0:
 *                 raise NotImplementedError("step in slice can only be positive")
 */
    __Pyx_TraceLine(1953,0,__PYX_ERR(0, 1953, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_v_start = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_stop = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_step = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "bcolz/carray_ext.pyx":1954
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step and step <= 0:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError("step in slice can only be positive")
 *         # Multidimensional keys
 */
    __Pyx_TraceLine(1954,0,__PYX_ERR(0, 1954, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_step); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1954, __pyx_L1_error)
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_9 = PyObject_RichCompare(__pyx_v_step, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1954, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1954, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_3 = __pyx_t_4;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":1955
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step and step <= 0:
 *                 raise NotImplementedError("step in slice can only be positive")             # <<<<<<<<<<<<<<
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):
 */
      __Pyx_TraceLine(1955,0,__PYX_ERR(0, 1955, __pyx_L1_error))
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1955, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(0, 1955, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1954
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step and step <= 0:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError("step in slice can only be positive")
 *         # Multidimensional keys
 */
    }

    /* "bcolz/carray_ext.pyx":1952
 *             return np.squeeze(self[slice(key, key + 1, 1)])
 *         # Slices
 *         elif isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step and step <= 0:
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":1957
 *                 raise NotImplementedError("step in slice can only be positive")
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):             # <<<<<<<<<<<<<<
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 */
  __Pyx_TraceLine(1957,0,__PYX_ERR(0, 1957, __pyx_L1_error))
  __pyx_t_3 = PyTuple_Check(__pyx_v_key); 
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":1958
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:
 */
    __Pyx_TraceLine(1958,0,__PYX_ERR(0, 1958, __pyx_L1_error))
    __pyx_t_10 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1958, __pyx_L1_error)
    __pyx_t_4 = ((__pyx_t_10 == 0) != 0);
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1959
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")             # <<<<<<<<<<<<<<
 *             elif len(key) == 1:
 *                 return self[key[0]]
 */
      __Pyx_TraceLine(1959,0,__PYX_ERR(0, 1959, __pyx_L1_error))
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(0, 1959, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1958
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:
 */
    }

    /* "bcolz/carray_ext.pyx":1960
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:             # <<<<<<<<<<<<<<
 *                 return self[key[0]]
 *             # An n-dimensional slice
 */
    __Pyx_TraceLine(1960,0,__PYX_ERR(0, 1960, __pyx_L1_error))
    __pyx_t_10 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1960, __pyx_L1_error)
    __pyx_t_4 = ((__pyx_t_10 == 1) != 0);
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1961
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:
 *                 return self[key[0]]             # <<<<<<<<<<<<<<
 *             # An n-dimensional slice
 *             # First, retrieve elements in the leading dimension
 */
      __Pyx_TraceLine(1961,0,__PYX_ERR(0, 1961, __pyx_L1_error))
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1961, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1961, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":1960
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:             # <<<<<<<<<<<<<<
 *                 return self[key[0]]
 *             # An n-dimensional slice
 */
    }

    /* "bcolz/carray_ext.pyx":1964
 *             # An n-dimensional slice
 *             # First, retrieve elements in the leading dimension
 *             arr = self[key[0]]             # <<<<<<<<<<<<<<
 *             # Then, keep only the required elements in other dimensions
 *             if type(key[0]) == slice:
 */
    __Pyx_TraceLine(1964,0,__PYX_ERR(0, 1964, __pyx_L1_error))
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_arr = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "bcolz/carray_ext.pyx":1966
 *             arr = self[key[0]]
 *             # Then, keep only the required elements in other dimensions
 *             if type(key[0]) == slice:             # <<<<<<<<<<<<<<
 *                 arr = arr[(slice(None),) + key[1:]]
 *             else:
 */
    __Pyx_TraceLine(1966,0,__PYX_ERR(0, 1966, __pyx_L1_error))
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_9)), ((PyObject *)(&PySlice_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1966, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1966, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1967
 *             # Then, keep only the required elements in other dimensions
 *             if type(key[0]) == slice:
 *                 arr = arr[(slice(None),) + key[1:]]             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr[key[1:]]
 */
      __Pyx_TraceLine(1967,0,__PYX_ERR(0, 1967, __pyx_L1_error))
      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__82, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyNumber_Add(__pyx_tuple__81, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1967, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetItem(__pyx_v_arr, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "bcolz/carray_ext.pyx":1966
 *             arr = self[key[0]]
 *             # Then, keep only the required elements in other dimensions
 *             if type(key[0]) == slice:             # <<<<<<<<<<<<<<
 *                 arr = arr[(slice(None),) + key[1:]]
 *             else:
 */
      goto __pyx_L13;
    }

    /* "bcolz/carray_ext.pyx":1969
 *                 arr = arr[(slice(None),) + key[1:]]
 *             else:
 *                 arr = arr[key[1:]]             # <<<<<<<<<<<<<<
 *             # Force a copy in case returned array is not contiguous
 *             if not arr.flags.contiguous:
 */
    __Pyx_TraceLine(1969,0,__PYX_ERR(0, 1969, __pyx_L1_error))
    /*else*/ {
      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__83, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1969, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyObject_GetItem(__pyx_v_arr, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1969, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_9);
      __pyx_t_9 = 0;
    }
    __pyx_L13:;

    /* "bcolz/carray_ext.pyx":1971
 *                 arr = arr[key[1:]]
 *             # Force a copy in case returned array is not contiguous
 *             if not arr.flags.contiguous:             # <<<<<<<<<<<<<<
 *                 arr = arr.copy()
 *             return arr
 */
    __Pyx_TraceLine(1971,0,__PYX_ERR(0, 1971, __pyx_L1_error))
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1971, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = ((!__pyx_t_4) != 0);
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":1972
 *             # Force a copy in case returned array is not contiguous
 *             if not arr.flags.contiguous:
 *                 arr = arr.copy()             # <<<<<<<<<<<<<<
 *             return arr
 *         # List of integers (case of fancy indexing)
 */
      __Pyx_TraceLine(1972,0,__PYX_ERR(0, 1972, __pyx_L1_error))
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1972, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1972, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1972, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "bcolz/carray_ext.pyx":1971
 *                 arr = arr[key[1:]]
 *             # Force a copy in case returned array is not contiguous
 *             if not arr.flags.contiguous:             # <<<<<<<<<<<<<<
 *                 arr = arr.copy()
 *             return arr
 */
    }

    /* "bcolz/carray_ext.pyx":1973
 *             if not arr.flags.contiguous:
 *                 arr = arr.copy()
 *             return arr             # <<<<<<<<<<<<<<
 *         # List of integers (case of fancy indexing)
 *         elif isinstance(key, list):
 */
    __Pyx_TraceLine(1973,0,__PYX_ERR(0, 1973, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1957
 *                 raise NotImplementedError("step in slice can only be positive")
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):             # <<<<<<<<<<<<<<
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 */
  }

  /* "bcolz/carray_ext.pyx":1975
 *             return arr
 *         # List of integers (case of fancy indexing)
 *         elif isinstance(key, list):             # <<<<<<<<<<<<<<
 *             # Try to convert to a integer array
 *             try:
 */
  __Pyx_TraceLine(1975,0,__PYX_ERR(0, 1975, __pyx_L1_error))
  __pyx_t_3 = PyList_Check(__pyx_v_key); 
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":1977
 *         elif isinstance(key, list):
 *             # Try to convert to a integer array
 *             try:             # <<<<<<<<<<<<<<
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 */
    __Pyx_TraceLine(1977,0,__PYX_ERR(0, 1977, __pyx_L15_error))
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      /*try:*/ {

        /* "bcolz/carray_ext.pyx":1978
 *             # Try to convert to a integer array
 *             try:
 *                 key = np.array(key, dtype=np.int_)             # <<<<<<<<<<<<<<
 *             except:
 *                 raise IndexError(
 */
        __Pyx_TraceLine(1978,0,__PYX_ERR(0, 1978, __pyx_L15_error))
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1978, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
        __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1978, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1978, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1978, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1978, __pyx_L15_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1978, __pyx_L15_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "bcolz/carray_ext.pyx":1977
 *         elif isinstance(key, list):
 *             # Try to convert to a integer array
 *             try:             # <<<<<<<<<<<<<<
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L22_try_end;
      __pyx_L15_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "bcolz/carray_ext.pyx":1979
 *             try:
 *                 key = np.array(key, dtype=np.int_)
 *             except:             # <<<<<<<<<<<<<<
 *                 raise IndexError(
 *                     "key cannot be converted to an array of indices")
 */
      __Pyx_TraceLine(1979,0,__PYX_ERR(0, 1979, __pyx_L17_except_error))
      /*except:*/ {
        __Pyx_AddTraceback("bcolz.carray_ext.carray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_2) < 0) __PYX_ERR(0, 1979, __pyx_L17_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_2);

        /* "bcolz/carray_ext.pyx":1980
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "key cannot be converted to an array of indices")
 *             return self[key]
 */
        __Pyx_TraceLine(1980,0,__PYX_ERR(0, 1980, __pyx_L17_except_error))
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1980, __pyx_L17_except_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_Raise(__pyx_t_9, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __PYX_ERR(0, 1980, __pyx_L17_except_error)
      }
      __pyx_L17_except_error:;

      /* "bcolz/carray_ext.pyx":1977
 *         elif isinstance(key, list):
 *             # Try to convert to a integer array
 *             try:             # <<<<<<<<<<<<<<
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      goto __pyx_L1_error;
      __pyx_L22_try_end:;
    }

    /* "bcolz/carray_ext.pyx":1982
 *                 raise IndexError(
 *                     "key cannot be converted to an array of indices")
 *             return self[key]             # <<<<<<<<<<<<<<
 *         # A boolean or integer array (case of fancy indexing)
 *         elif hasattr(key, "dtype"):
 */
    __Pyx_TraceLine(1982,0,__PYX_ERR(0, 1982, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1975
 *             return arr
 *         # List of integers (case of fancy indexing)
 *         elif isinstance(key, list):             # <<<<<<<<<<<<<<
 *             # Try to convert to a integer array
 *             try:
 */
  }

  /* "bcolz/carray_ext.pyx":1984
 *             return self[key]
 *         # A boolean or integer array (case of fancy indexing)
 *         elif hasattr(key, "dtype"):             # <<<<<<<<<<<<<<
 *             if key.dtype.type == np.bool_:
 *                 # A boolean array
 */
  __Pyx_TraceLine(1984,0,__PYX_ERR(0, 1984, __pyx_L1_error))
  __pyx_t_4 = PyObject_HasAttr(__pyx_v_key, __pyx_n_s_dtype); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1984, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1985
 *         # A boolean or integer array (case of fancy indexing)
 *         elif hasattr(key, "dtype"):
 *             if key.dtype.type == np.bool_:             # <<<<<<<<<<<<<<
 *                 # A boolean array
 *                 if len(key) != self.len:
 */
    __Pyx_TraceLine(1985,0,__PYX_ERR(0, 1985, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1985, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":1987
 *             if key.dtype.type == np.bool_:
 *                 # A boolean array
 *                 if len(key) != self.len:             # <<<<<<<<<<<<<<
 *                     raise IndexError(
 *                         "boolean array length must match len(self)")
 */
      __Pyx_TraceLine(1987,0,__PYX_ERR(0, 1987, __pyx_L1_error))
      __pyx_t_10 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1987, __pyx_L1_error)
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1987, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1987, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1987, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1987, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_3) {

        /* "bcolz/carray_ext.pyx":1988
 *                 # A boolean array
 *                 if len(key) != self.len:
 *                     raise IndexError(             # <<<<<<<<<<<<<<
 *                         "boolean array length must match len(self)")
 *                 if isinstance(key, carray):
 */
        __Pyx_TraceLine(1988,0,__PYX_ERR(0, 1988, __pyx_L1_error))
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1988, __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_ERR(0, 1988, __pyx_L1_error)

        /* "bcolz/carray_ext.pyx":1987
 *             if key.dtype.type == np.bool_:
 *                 # A boolean array
 *                 if len(key) != self.len:             # <<<<<<<<<<<<<<
 *                     raise IndexError(
 *                         "boolean array length must match len(self)")
 */
      }

      /* "bcolz/carray_ext.pyx":1990
 *                     raise IndexError(
 *                         "boolean array length must match len(self)")
 *                 if isinstance(key, carray):             # <<<<<<<<<<<<<<
 *                     count = key.sum()
 *                 else:
 */
      __Pyx_TraceLine(1990,0,__PYX_ERR(0, 1990, __pyx_L1_error))
      __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_key, __pyx_ptype_5bcolz_10carray_ext_carray); 
      __pyx_t_4 = (__pyx_t_3 != 0);
      if (__pyx_t_4) {

        /* "bcolz/carray_ext.pyx":1991
 *                         "boolean array length must match len(self)")
 *                 if isinstance(key, carray):
 *                     count = key.sum()             # <<<<<<<<<<<<<<
 *                 else:
 *                     count = -1
 */
        __Pyx_TraceLine(1991,0,__PYX_ERR(0, 1991, __pyx_L1_error))
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (__pyx_t_2) {
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1991, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else {
          __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1991, __pyx_L1_error)
        }
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_count = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "bcolz/carray_ext.pyx":1990
 *                     raise IndexError(
 *                         "boolean array length must match len(self)")
 *                 if isinstance(key, carray):             # <<<<<<<<<<<<<<
 *                     count = key.sum()
 *                 else:
 */
        goto __pyx_L27;
      }

      /* "bcolz/carray_ext.pyx":1993
 *                     count = key.sum()
 *                 else:
 *                     count = -1             # <<<<<<<<<<<<<<
 *                 return np.fromiter(self.where(key), dtype=self._dtype,
 *                                    count=count)
 */
      __Pyx_TraceLine(1993,0,__PYX_ERR(0, 1993, __pyx_L1_error))
      /*else*/ {
        __Pyx_INCREF(__pyx_int_neg_1);
        __pyx_v_count = __pyx_int_neg_1;
      }
      __pyx_L27:;

      /* "bcolz/carray_ext.pyx":1994
 *                 else:
 *                     count = -1
 *                 return np.fromiter(self.where(key), dtype=self._dtype,             # <<<<<<<<<<<<<<
 *                                    count=count)
 *             elif np.issubsctype(key, np.int_):
 */
      __Pyx_TraceLine(1994,0,__PYX_ERR(0, 1994, __pyx_L1_error))
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_fromiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_where); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1994, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1994, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_key);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1994, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) __PYX_ERR(0, 1994, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1995
 *                     count = -1
 *                 return np.fromiter(self.where(key), dtype=self._dtype,
 *                                    count=count)             # <<<<<<<<<<<<<<
 *             elif np.issubsctype(key, np.int_):
 *                 # An integer array
 */
      __Pyx_TraceLine(1995,0,__PYX_ERR(0, 1995, __pyx_L1_error))
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_count, __pyx_v_count) < 0) __PYX_ERR(0, 1994, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":1994
 *                 else:
 *                     count = -1
 *                 return np.fromiter(self.where(key), dtype=self._dtype,             # <<<<<<<<<<<<<<
 *                                    count=count)
 *             elif np.issubsctype(key, np.int_):
 */
      __Pyx_TraceLine(1994,0,__PYX_ERR(0, 1994, __pyx_L1_error))
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":1985
 *         # A boolean or integer array (case of fancy indexing)
 *         elif hasattr(key, "dtype"):
 *             if key.dtype.type == np.bool_:             # <<<<<<<<<<<<<<
 *                 # A boolean array
 *                 if len(key) != self.len:
 */
    }

    /* "bcolz/carray_ext.pyx":1996
 *                 return np.fromiter(self.where(key), dtype=self._dtype,
 *                                    count=count)
 *             elif np.issubsctype(key, np.int_):             # <<<<<<<<<<<<<<
 *                 # An integer array
 *                 return np.array([self[i] for i in key], dtype=self._dtype.base)
 */
    __Pyx_TraceLine(1996,0,__PYX_ERR(0, 1996, __pyx_L1_error))
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_issubsctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_10 = 1;
      }
    }
    __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1996, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1998
 *             elif np.issubsctype(key, np.int_):
 *                 # An integer array
 *                 return np.array([self[i] for i in key], dtype=self._dtype.base)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise IndexError(
 */
      __Pyx_TraceLine(1998,0,__PYX_ERR(0, 1998, __pyx_L1_error))
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1998, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1998, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1998, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (likely(PyList_CheckExact(__pyx_v_key)) || PyTuple_CheckExact(__pyx_v_key)) {
        __pyx_t_9 = __pyx_v_key; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_key); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1998, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1998, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_9))) {
            if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1998, __pyx_L1_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1998, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          } else {
            if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 1998, __pyx_L1_error)
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1998, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            #endif
          }
        } else {
          __pyx_t_6 = __pyx_t_14(__pyx_t_9);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1998, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1998, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1998, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1998, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1998, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1998, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 1998, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1998, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":1996
 *                 return np.fromiter(self.where(key), dtype=self._dtype,
 *                                    count=count)
 *             elif np.issubsctype(key, np.int_):             # <<<<<<<<<<<<<<
 *                 # An integer array
 *                 return np.array([self[i] for i in key], dtype=self._dtype.base)
 */
    }

    /* "bcolz/carray_ext.pyx":2000
 *                 return np.array([self[i] for i in key], dtype=self._dtype.base)
 *             else:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "arrays used as indices must be integer (or boolean)")
 *         # A boolean expression (case of fancy indexing)
 */
    __Pyx_TraceLine(2000,0,__PYX_ERR(0, 2000, __pyx_L1_error))
    /*else*/ {
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2000, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(0, 2000, __pyx_L1_error)
    }

    /* "bcolz/carray_ext.pyx":1984
 *             return self[key]
 *         # A boolean or integer array (case of fancy indexing)
 *         elif hasattr(key, "dtype"):             # <<<<<<<<<<<<<<
 *             if key.dtype.type == np.bool_:
 *                 # A boolean array
 */
  }

  /* "bcolz/carray_ext.pyx":2003
 *                     "arrays used as indices must be integer (or boolean)")
 *         # A boolean expression (case of fancy indexing)
 *         elif type(key) is str:             # <<<<<<<<<<<<<<
 *             # Evaluate
 *             result = bcolz.eval(key)
 */
  __Pyx_TraceLine(2003,0,__PYX_ERR(0, 2003, __pyx_L1_error))
  __pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_key)) == ((PyObject *)(&PyString_Type)));
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2005
 *         elif type(key) is str:
 *             # Evaluate
 *             result = bcolz.eval(key)             # <<<<<<<<<<<<<<
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")
 */
    __Pyx_TraceLine(2005,0,__PYX_ERR(0, 2005, __pyx_L1_error))
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_bcolz); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_eval); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2005, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2005, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_key);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2005, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_result = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "bcolz/carray_ext.pyx":2006
 *             # Evaluate
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:             # <<<<<<<<<<<<<<
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 */
    __Pyx_TraceLine(2006,0,__PYX_ERR(0, 2006, __pyx_L1_error))
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_9, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2006, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __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_ERR(0, 2006, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":2007
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")             # <<<<<<<<<<<<<<
 *             if len(result) != self.len:
 *                 raise IndexError(
 */
      __Pyx_TraceLine(2007,0,__PYX_ERR(0, 2007, __pyx_L1_error))
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2007, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(0, 2007, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":2006
 *             # Evaluate
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:             # <<<<<<<<<<<<<<
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 */
    }

    /* "bcolz/carray_ext.pyx":2008
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:             # <<<<<<<<<<<<<<
 *                 raise IndexError(
 *                     "boolean expression outcome must match len(self)")
 */
    __Pyx_TraceLine(2008,0,__PYX_ERR(0, 2008, __pyx_L1_error))
    __pyx_t_10 = PyObject_Length(__pyx_v_result); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2008, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2008, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2008, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":2009
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "boolean expression outcome must match len(self)")
 *             # Call __getitem__ again
 */
      __Pyx_TraceLine(2009,0,__PYX_ERR(0, 2009, __pyx_L1_error))
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(0, 2009, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":2008
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:             # <<<<<<<<<<<<<<
 *                 raise IndexError(
 *                     "boolean expression outcome must match len(self)")
 */
    }

    /* "bcolz/carray_ext.pyx":2012
 *                     "boolean expression outcome must match len(self)")
 *             # Call __getitem__ again
 *             return self[result]             # <<<<<<<<<<<<<<
 *         # All the rest not implemented
 *         else:
 */
    __Pyx_TraceLine(2012,0,__PYX_ERR(0, 2012, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_result); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2003
 *                     "arrays used as indices must be integer (or boolean)")
 *         # A boolean expression (case of fancy indexing)
 *         elif type(key) is str:             # <<<<<<<<<<<<<<
 *             # Evaluate
 *             result = bcolz.eval(key)
 */
  }

  /* "bcolz/carray_ext.pyx":2015
 *         # All the rest not implemented
 *         else:
 *             raise NotImplementedError("key not supported: %s" % repr(key))             # <<<<<<<<<<<<<<
 * 
 *         # From now on, will only deal with [start:stop:step] slices
 */
  __Pyx_TraceLine(2015,0,__PYX_ERR(0, 2015, __pyx_L1_error))
  /*else*/ {
    __pyx_t_9 = PyObject_Repr(__pyx_v_key); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_key_not_supported_s, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2015, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":2020
 * 
 *         # Get the corrected values for start, stop, step
 *         (start, stop, step) = slice(start, stop, step).indices(self.len)             # <<<<<<<<<<<<<<
 * 
 *         # Build a numpy container
 */
  __Pyx_TraceLine(2020,0,__PYX_ERR(0, 2020, __pyx_L1_error))
  __pyx_t_9 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2020, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_ERR(0, 2020, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_9);
    #else
    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    #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_ERR(0, 2020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_15 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_15(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L32_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_5 = __pyx_t_15(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L32_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 2; __pyx_t_9 = __pyx_t_15(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L32_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_9);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_7), 3) < 0) __PYX_ERR(0, 2020, __pyx_L1_error)
    __pyx_t_15 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L33_unpacking_done;
    __pyx_L32_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_15 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2020, __pyx_L1_error)
    __pyx_L33_unpacking_done:;
  }
  __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_stop, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_step, __pyx_t_9);
  __pyx_t_9 = 0;

  /* "bcolz/carray_ext.pyx":2023
 * 
 *         # Build a numpy container
 *         blen = get_len_of_range(start, stop, step)             # <<<<<<<<<<<<<<
 *         arr = np.empty(shape=(blen,), dtype=self._dtype)
 *         if blen == 0:
 */
  __Pyx_TraceLine(2023,0,__PYX_ERR(0, 2023, __pyx_L1_error))
  __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_start); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2023, __pyx_L1_error)
  __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_stop); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2023, __pyx_L1_error)
  __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_step); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2023, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_5bcolz_10carray_ext_get_len_of_range(__pyx_t_8, __pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_blen = __pyx_t_17;

  /* "bcolz/carray_ext.pyx":2024
 *         # Build a numpy container
 *         blen = get_len_of_range(start, stop, step)
 *         arr = np.empty(shape=(blen,), dtype=self._dtype)             # <<<<<<<<<<<<<<
 *         if blen == 0:
 *             # If empty, return immediately
 */
  __Pyx_TraceLine(2024,0,__PYX_ERR(0, 2024, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_blen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_t_6) < 0) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) __PYX_ERR(0, 2024, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_arr = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":2025
 *         blen = get_len_of_range(start, stop, step)
 *         arr = np.empty(shape=(blen,), dtype=self._dtype)
 *         if blen == 0:             # <<<<<<<<<<<<<<
 *             # If empty, return immediately
 *             return arr
 */
  __Pyx_TraceLine(2025,0,__PYX_ERR(0, 2025, __pyx_L1_error))
  __pyx_t_3 = ((__pyx_v_blen == 0) != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2027
 *         if blen == 0:
 *             # If empty, return immediately
 *             return arr             # <<<<<<<<<<<<<<
 * 
 *         if self.dtype.char == 'O':
 */
    __Pyx_TraceLine(2027,0,__PYX_ERR(0, 2027, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2025
 *         blen = get_len_of_range(start, stop, step)
 *         arr = np.empty(shape=(blen,), dtype=self._dtype)
 *         if blen == 0:             # <<<<<<<<<<<<<<
 *             # If empty, return immediately
 *             return arr
 */
  }

  /* "bcolz/carray_ext.pyx":2029
 *             return arr
 * 
 *         if self.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *             return self._getitem_object(start, stop, step)
 * 
 */
  __Pyx_TraceLine(2029,0,__PYX_ERR(0, 2029, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_char); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2030
 * 
 *         if self.dtype.char == 'O':
 *             return self._getitem_object(start, stop, step)             # <<<<<<<<<<<<<<
 * 
 *         # Fill it from data in chunks
 */
    __Pyx_TraceLine(2030,0,__PYX_ERR(0, 2030, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem_object); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_10 = 1;
      }
    }
    __pyx_t_5 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_INCREF(__pyx_v_start);
    __Pyx_GIVEREF(__pyx_v_start);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_10, __pyx_v_start);
    __Pyx_INCREF(__pyx_v_stop);
    __Pyx_GIVEREF(__pyx_v_stop);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_10, __pyx_v_stop);
    __Pyx_INCREF(__pyx_v_step);
    __Pyx_GIVEREF(__pyx_v_step);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_10, __pyx_v_step);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2029
 *             return arr
 * 
 *         if self.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *             return self._getitem_object(start, stop, step)
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":2033
 * 
 *         # Fill it from data in chunks
 *         nwrow = 0             # <<<<<<<<<<<<<<
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:
 */
  __Pyx_TraceLine(2033,0,__PYX_ERR(0, 2033, __pyx_L1_error))
  __pyx_v_nwrow = 0;

  /* "bcolz/carray_ext.pyx":2034
 *         # Fill it from data in chunks
 *         nwrow = 0
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         if self.leftover > 0:
 *             nchunks += 1
 */
  __Pyx_TraceLine(2034,0,__PYX_ERR(0, 2034, __pyx_L1_error))
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":2035
 *         nwrow = 0
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:             # <<<<<<<<<<<<<<
 *             nchunks += 1
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)
 */
  __Pyx_TraceLine(2035,0,__PYX_ERR(0, 2035, __pyx_L1_error))
  __pyx_t_3 = ((__pyx_v_self->leftover > 0) != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2036
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:
 *             nchunks += 1             # <<<<<<<<<<<<<<
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)
 *         last_chunk = <npy_intp> cython.cdiv(stop, self.chunklen) + 1
 */
    __Pyx_TraceLine(2036,0,__PYX_ERR(0, 2036, __pyx_L1_error))
    __pyx_v_nchunks = (__pyx_v_nchunks + 1);

    /* "bcolz/carray_ext.pyx":2035
 *         nwrow = 0
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:             # <<<<<<<<<<<<<<
 *             nchunks += 1
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)
 */
  }

  /* "bcolz/carray_ext.pyx":2037
 *         if self.leftover > 0:
 *             nchunks += 1
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)             # <<<<<<<<<<<<<<
 *         last_chunk = <npy_intp> cython.cdiv(stop, self.chunklen) + 1
 *         last_chunk = min(last_chunk, nchunks)
 */
  __Pyx_TraceLine(2037,0,__PYX_ERR(0, 2037, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunklen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_start, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_6); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2037, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_first_chunk = ((npy_intp)__pyx_t_17);

  /* "bcolz/carray_ext.pyx":2038
 *             nchunks += 1
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)
 *         last_chunk = <npy_intp> cython.cdiv(stop, self.chunklen) + 1             # <<<<<<<<<<<<<<
 *         last_chunk = min(last_chunk, nchunks)
 *         for nchunk from first_chunk <= nchunk < last_chunk:
 */
  __Pyx_TraceLine(2038,0,__PYX_ERR(0, 2038, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunklen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_stop, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2038, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_last_chunk = (((npy_intp)__pyx_t_17) + 1);

  /* "bcolz/carray_ext.pyx":2039
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)
 *         last_chunk = <npy_intp> cython.cdiv(stop, self.chunklen) + 1
 *         last_chunk = min(last_chunk, nchunks)             # <<<<<<<<<<<<<<
 *         for nchunk from first_chunk <= nchunk < last_chunk:
 *             # Compute start & stop for each block
 */
  __Pyx_TraceLine(2039,0,__PYX_ERR(0, 2039, __pyx_L1_error))
  __pyx_t_17 = __pyx_v_nchunks;
  __pyx_t_16 = __pyx_v_last_chunk;
  if (((__pyx_t_17 < __pyx_t_16) != 0)) {
    __pyx_t_8 = __pyx_t_17;
  } else {
    __pyx_t_8 = __pyx_t_16;
  }
  __pyx_v_last_chunk = __pyx_t_8;

  /* "bcolz/carray_ext.pyx":2040
 *         last_chunk = <npy_intp> cython.cdiv(stop, self.chunklen) + 1
 *         last_chunk = min(last_chunk, nchunks)
 *         for nchunk from first_chunk <= nchunk < last_chunk:             # <<<<<<<<<<<<<<
 *             # Compute start & stop for each block
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 */
  __Pyx_TraceLine(2040,0,__PYX_ERR(0, 2040, __pyx_L1_error))
  __pyx_t_8 = __pyx_v_last_chunk;
  for (__pyx_v_nchunk = __pyx_v_first_chunk; __pyx_v_nchunk < __pyx_t_8; __pyx_v_nchunk++) {

    /* "bcolz/carray_ext.pyx":2042
 *         for nchunk from first_chunk <= nchunk < last_chunk:
 *             # Compute start & stop for each block
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,             # <<<<<<<<<<<<<<
 *                                              step)
 *             if blen == 0:
 */
    __Pyx_TraceLine(2042,0,__PYX_ERR(0, 2042, __pyx_L1_error))
    __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_start); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2042, __pyx_L1_error)
    __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_stop); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2042, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2043
 *             # Compute start & stop for each block
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 *                                              step)             # <<<<<<<<<<<<<<
 *             if blen == 0:
 *                 continue
 */
    __Pyx_TraceLine(2043,0,__PYX_ERR(0, 2043, __pyx_L1_error))
    __pyx_t_18 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_step); if (unlikely((__pyx_t_18 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2043, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2042
 *         for nchunk from first_chunk <= nchunk < last_chunk:
 *             # Compute start & stop for each block
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,             # <<<<<<<<<<<<<<
 *                                              step)
 *             if blen == 0:
 */
    __Pyx_TraceLine(2042,0,__PYX_ERR(0, 2042, __pyx_L1_error))
    __pyx_t_2 = __pyx_f_5bcolz_10carray_ext_clip_chunk(__pyx_v_nchunk, __pyx_v_chunklen, __pyx_t_17, __pyx_t_16, __pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    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_ERR(0, 2042, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_9);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2042, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2042, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2042, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      #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_ERR(0, 2042, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_15 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_15(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L39_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_5 = __pyx_t_15(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L39_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 2; __pyx_t_9 = __pyx_t_15(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L39_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_7), 3) < 0) __PYX_ERR(0, 2042, __pyx_L1_error)
      __pyx_t_15 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L40_unpacking_done;
      __pyx_L39_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_15 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2042, __pyx_L1_error)
      __pyx_L40_unpacking_done:;
    }
    __pyx_t_18 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_6); if (unlikely((__pyx_t_18 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2042, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2042, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_9); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2042, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_startb = __pyx_t_18;
    __pyx_v_stopb = __pyx_t_16;
    __pyx_v_blen = __pyx_t_17;

    /* "bcolz/carray_ext.pyx":2044
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 *                                              step)
 *             if blen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Get the data chunk and assign it to result array
 */
    __Pyx_TraceLine(2044,0,__PYX_ERR(0, 2044, __pyx_L1_error))
    __pyx_t_3 = ((__pyx_v_blen == 0) != 0);
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":2045
 *                                              step)
 *             if blen == 0:
 *                 continue             # <<<<<<<<<<<<<<
 *             # Get the data chunk and assign it to result array
 *             if nchunk == nchunks - 1 and self.leftover:
 */
      __Pyx_TraceLine(2045,0,__PYX_ERR(0, 2045, __pyx_L1_error))
      goto __pyx_L37_continue;

      /* "bcolz/carray_ext.pyx":2044
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 *                                              step)
 *             if blen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Get the data chunk and assign it to result array
 */
    }

    /* "bcolz/carray_ext.pyx":2047
 *                 continue
 *             # Get the data chunk and assign it to result array
 *             if nchunk == nchunks - 1 and self.leftover:             # <<<<<<<<<<<<<<
 *                 arr[nwrow:nwrow + blen] = self.lastchunkarr[startb:stopb:step]
 *             else:
 */
    __Pyx_TraceLine(2047,0,__PYX_ERR(0, 2047, __pyx_L1_error))
    __pyx_t_4 = ((__pyx_v_nchunk == (__pyx_v_nchunks - 1)) != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L43_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->leftover != 0);
    __pyx_t_3 = __pyx_t_4;
    __pyx_L43_bool_binop_done:;
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":2048
 *             # Get the data chunk and assign it to result array
 *             if nchunk == nchunks - 1 and self.leftover:
 *                 arr[nwrow:nwrow + blen] = self.lastchunkarr[startb:stopb:step]             # <<<<<<<<<<<<<<
 *             else:
 *                 if step > 1:
 */
      __Pyx_TraceLine(2048,0,__PYX_ERR(0, 2048, __pyx_L1_error))
      __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2048, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_stopb); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2048, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = PySlice_New(__pyx_t_2, __pyx_t_9, __pyx_v_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2048, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_GetItem(__pyx_v_self->lastchunkarr, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2048, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__Pyx_PyObject_SetSlice(__pyx_v_arr, __pyx_t_9, __pyx_v_nwrow, (__pyx_v_nwrow + __pyx_v_blen), NULL, NULL, NULL, 1, 1, 1) < 0) __PYX_ERR(0, 2048, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "bcolz/carray_ext.pyx":2047
 *                 continue
 *             # Get the data chunk and assign it to result array
 *             if nchunk == nchunks - 1 and self.leftover:             # <<<<<<<<<<<<<<
 *                 arr[nwrow:nwrow + blen] = self.lastchunkarr[startb:stopb:step]
 *             else:
 */
      goto __pyx_L42;
    }

    /* "bcolz/carray_ext.pyx":2050
 *                 arr[nwrow:nwrow + blen] = self.lastchunkarr[startb:stopb:step]
 *             else:
 *                 if step > 1:             # <<<<<<<<<<<<<<
 *                     arr[nwrow:nwrow + blen] = self.chunks[nchunk][
 *                                               startb:stopb:step]
 */
    __Pyx_TraceLine(2050,0,__PYX_ERR(0, 2050, __pyx_L1_error))
    /*else*/ {
      __pyx_t_9 = PyObject_RichCompare(__pyx_v_step, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2050, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2050, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_3) {

        /* "bcolz/carray_ext.pyx":2051
 *             else:
 *                 if step > 1:
 *                     arr[nwrow:nwrow + blen] = self.chunks[nchunk][             # <<<<<<<<<<<<<<
 *                                               startb:stopb:step]
 *                 else:
 */
        __Pyx_TraceLine(2051,0,__PYX_ERR(0, 2051, __pyx_L1_error))
        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_self->chunks, __pyx_v_nchunk, npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2051, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);

        /* "bcolz/carray_ext.pyx":2052
 *                 if step > 1:
 *                     arr[nwrow:nwrow + blen] = self.chunks[nchunk][
 *                                               startb:stopb:step]             # <<<<<<<<<<<<<<
 *                 else:
 *                     # no step, can store directly
 */
        __Pyx_TraceLine(2052,0,__PYX_ERR(0, 2052, __pyx_L1_error))
        __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2052, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_stopb); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2052, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);

        /* "bcolz/carray_ext.pyx":2051
 *             else:
 *                 if step > 1:
 *                     arr[nwrow:nwrow + blen] = self.chunks[nchunk][             # <<<<<<<<<<<<<<
 *                                               startb:stopb:step]
 *                 else:
 */
        __Pyx_TraceLine(2051,0,__PYX_ERR(0, 2051, __pyx_L1_error))
        __pyx_t_6 = PySlice_New(__pyx_t_5, __pyx_t_2, __pyx_v_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2051, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_GetItem(__pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (__Pyx_PyObject_SetSlice(__pyx_v_arr, __pyx_t_2, __pyx_v_nwrow, (__pyx_v_nwrow + __pyx_v_blen), NULL, NULL, NULL, 1, 1, 1) < 0) __PYX_ERR(0, 2051, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "bcolz/carray_ext.pyx":2050
 *                 arr[nwrow:nwrow + blen] = self.lastchunkarr[startb:stopb:step]
 *             else:
 *                 if step > 1:             # <<<<<<<<<<<<<<
 *                     arr[nwrow:nwrow + blen] = self.chunks[nchunk][
 *                                               startb:stopb:step]
 */
        goto __pyx_L45;
      }

      /* "bcolz/carray_ext.pyx":2055
 *                 else:
 *                     # no step, can store directly
 *                     dest = arr[nwrow:nwrow + blen]             # <<<<<<<<<<<<<<
 *                     _chunk = self.chunks[nchunk]
 *                     _chunk._getitem(startb, stopb, dest.data)
 */
      __Pyx_TraceLine(2055,0,__PYX_ERR(0, 2055, __pyx_L1_error))
      /*else*/ {
        __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_arr, __pyx_v_nwrow, (__pyx_v_nwrow + __pyx_v_blen), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2055, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2055, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "bcolz/carray_ext.pyx":2056
 *                     # no step, can store directly
 *                     dest = arr[nwrow:nwrow + blen]
 *                     _chunk = self.chunks[nchunk]             # <<<<<<<<<<<<<<
 *                     _chunk._getitem(startb, stopb, dest.data)
 *             nwrow += blen
 */
        __Pyx_TraceLine(2056,0,__PYX_ERR(0, 2056, __pyx_L1_error))
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->chunks, __pyx_v_nchunk, npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2056, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5bcolz_10carray_ext_chunk))))) __PYX_ERR(0, 2056, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v__chunk, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "bcolz/carray_ext.pyx":2057
 *                     dest = arr[nwrow:nwrow + blen]
 *                     _chunk = self.chunks[nchunk]
 *                     _chunk._getitem(startb, stopb, dest.data)             # <<<<<<<<<<<<<<
 *             nwrow += blen
 * 
 */
        __Pyx_TraceLine(2057,0,__PYX_ERR(0, 2057, __pyx_L1_error))
        ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk *)__pyx_v__chunk->__pyx_vtab)->_getitem(__pyx_v__chunk, __pyx_v_startb, __pyx_v_stopb, __pyx_v_dest->data);
      }
      __pyx_L45:;
    }
    __pyx_L42:;

    /* "bcolz/carray_ext.pyx":2058
 *                     _chunk = self.chunks[nchunk]
 *                     _chunk._getitem(startb, stopb, dest.data)
 *             nwrow += blen             # <<<<<<<<<<<<<<
 * 
 *         return arr
 */
    __Pyx_TraceLine(2058,0,__PYX_ERR(0, 2058, __pyx_L1_error))
    __pyx_v_nwrow = (__pyx_v_nwrow + __pyx_v_blen);
    __pyx_L37_continue:;
  }

  /* "bcolz/carray_ext.pyx":2060
 *             nwrow += blen
 * 
 *         return arr             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, object key, object value):
 */
  __Pyx_TraceLine(2060,0,__PYX_ERR(0, 2060, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_arr);
  __pyx_r = __pyx_v_arr;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1900
 *         return np.array(objs, dtype=self._dtype)
 * 
 *     def __getitem__(self, object key):             # <<<<<<<<<<<<<<
 *         """ x.__getitem__(key) <==> x[key]
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr1);
  __Pyx_XDECREF((PyObject *)__pyx_v_dest);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_stop);
  __Pyx_XDECREF(__pyx_v_step);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XDECREF((PyObject *)__pyx_v__chunk);
  __Pyx_XDECREF(__pyx_v_count);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2062
 *         return arr
 * 
 *     def __setitem__(self, object key, object value):             # <<<<<<<<<<<<<<
 *         """ x.__setitem__(key, value) <==> x[key] = value
 * 
 */

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6carray_41__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_40__setitem__[] = " x.__setitem__(key, value) <==> x[key] = value\n\n        Sets values based on `key`.  All the functionality of\n        ``ndarray.__setitem__()`` is supported (including fancy indexing),\n        plus a\n        special support for expressions:\n\n        Parameters\n        ----------\n        key : string\n            It will be interpret as a boolean expression (computed via\n            `eval`) and\n            the elements where these values are true will be set to `value`.\n\n        See Also\n        --------\n        eval\n\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5bcolz_10carray_ext_6carray_40__setitem__;
#endif
static int __pyx_pw_5bcolz_10carray_ext_6carray_41__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_40__setitem__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_6carray_40__setitem__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  int __pyx_v_chunklen;
  npy_intp __pyx_v_startb;
  npy_intp __pyx_v_stopb;
  npy_intp __pyx_v_nchunk;
  npy_intp __pyx_v_nchunks;
  npy_intp __pyx_v_first_chunk;
  npy_intp __pyx_v_last_chunk;
  npy_intp __pyx_v_nwrow;
  npy_intp __pyx_v_blen;
  npy_intp __pyx_v_vlen;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = 0;
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_v_cdata = 0;
  PyObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_result = NULL;
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  npy_intp __pyx_t_15;
  npy_intp __pyx_t_16;
  npy_intp __pyx_t_17;
  int __pyx_t_18;
  npy_intp __pyx_t_19;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_TraceCall("__setitem__", __pyx_f[0], 2062, 0, __PYX_ERR(0, 2062, __pyx_L1_error));
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_INCREF(__pyx_v_value);

  /* "bcolz/carray_ext.pyx":2090
 *         cdef object cdata, arr
 * 
 *         if self.mode == "r":             # <<<<<<<<<<<<<<
 *             raise IOError(
 *                 "cannot modify data because mode is '%s'" % self.mode)
 */
  __Pyx_TraceLine(2090,0,__PYX_ERR(0, 2090, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2090, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2092
 *         if self.mode == "r":
 *             raise IOError(
 *                 "cannot modify data because mode is '%s'" % self.mode)             # <<<<<<<<<<<<<<
 * 
 *         # We are going to modify data.  Mark block cache as dirty.
 */
    __Pyx_TraceLine(2092,0,__PYX_ERR(0, 2092, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2092, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_cannot_modify_data_because_mode, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2092, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2091
 * 
 *         if self.mode == "r":
 *             raise IOError(             # <<<<<<<<<<<<<<
 *                 "cannot modify data because mode is '%s'" % self.mode)
 * 
 */
    __Pyx_TraceLine(2091,0,__PYX_ERR(0, 2091, __pyx_L1_error))
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2091, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2090
 *         cdef object cdata, arr
 * 
 *         if self.mode == "r":             # <<<<<<<<<<<<<<
 *             raise IOError(
 *                 "cannot modify data because mode is '%s'" % self.mode)
 */
  }

  /* "bcolz/carray_ext.pyx":2095
 * 
 *         # We are going to modify data.  Mark block cache as dirty.
 *         if self.idxcache >= 0:             # <<<<<<<<<<<<<<
 *             # -2 means that cbytes counter has not to be changed
 *             self.idxcache = -2
 */
  __Pyx_TraceLine(2095,0,__PYX_ERR(0, 2095, __pyx_L1_error))
  __pyx_t_2 = ((__pyx_v_self->idxcache >= 0) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2097
 *         if self.idxcache >= 0:
 *             # -2 means that cbytes counter has not to be changed
 *             self.idxcache = -2             # <<<<<<<<<<<<<<
 * 
 *         # Check for integer
 */
    __Pyx_TraceLine(2097,0,__PYX_ERR(0, 2097, __pyx_L1_error))
    __pyx_v_self->idxcache = -2;

    /* "bcolz/carray_ext.pyx":2095
 * 
 *         # We are going to modify data.  Mark block cache as dirty.
 *         if self.idxcache >= 0:             # <<<<<<<<<<<<<<
 *             # -2 means that cbytes counter has not to be changed
 *             self.idxcache = -2
 */
  }

  /* "bcolz/carray_ext.pyx":2100
 * 
 *         # Check for integer
 *         if isinstance(key, _inttypes):             # <<<<<<<<<<<<<<
 *             if key < 0:
 *                 # To support negative values
 */
  __Pyx_TraceLine(2100,0,__PYX_ERR(0, 2100, __pyx_L1_error))
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_key, __pyx_t_3); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2101
 *         # Check for integer
 *         if isinstance(key, _inttypes):
 *             if key < 0:             # <<<<<<<<<<<<<<
 *                 # To support negative values
 *                 key += self.len
 */
    __Pyx_TraceLine(2101,0,__PYX_ERR(0, 2101, __pyx_L1_error))
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_key, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2101, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2101, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2103
 *             if key < 0:
 *                 # To support negative values
 *                 key += self.len             # <<<<<<<<<<<<<<
 *             if key >= self.len:
 *                 raise IndexError("index out of range")
 */
      __Pyx_TraceLine(2103,0,__PYX_ERR(0, 2103, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_key, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2103, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2101
 *         # Check for integer
 *         if isinstance(key, _inttypes):
 *             if key < 0:             # <<<<<<<<<<<<<<
 *                 # To support negative values
 *                 key += self.len
 */
    }

    /* "bcolz/carray_ext.pyx":2104
 *                 # To support negative values
 *                 key += self.len
 *             if key >= self.len:             # <<<<<<<<<<<<<<
 *                 raise IndexError("index out of range")
 *             (start, stop, step) = key, key + 1, 1
 */
    __Pyx_TraceLine(2104,0,__PYX_ERR(0, 2104, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_key, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2104, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2104, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2105
 *                 key += self.len
 *             if key >= self.len:
 *                 raise IndexError("index out of range")             # <<<<<<<<<<<<<<
 *             (start, stop, step) = key, key + 1, 1
 *         # Slices
 */
      __Pyx_TraceLine(2105,0,__PYX_ERR(0, 2105, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 2105, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":2104
 *                 # To support negative values
 *                 key += self.len
 *             if key >= self.len:             # <<<<<<<<<<<<<<
 *                 raise IndexError("index out of range")
 *             (start, stop, step) = key, key + 1, 1
 */
    }

    /* "bcolz/carray_ext.pyx":2106
 *             if key >= self.len:
 *                 raise IndexError("index out of range")
 *             (start, stop, step) = key, key + 1, 1             # <<<<<<<<<<<<<<
 *         # Slices
 *         elif isinstance(key, slice):
 */
    __Pyx_TraceLine(2106,0,__PYX_ERR(0, 2106, __pyx_L1_error))
    __pyx_t_3 = __pyx_v_key;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __pyx_int_1;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_v_start = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_stop = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_step = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":2100
 * 
 *         # Check for integer
 *         if isinstance(key, _inttypes):             # <<<<<<<<<<<<<<
 *             if key < 0:
 *                 # To support negative values
 */
    goto __pyx_L5;
  }

  /* "bcolz/carray_ext.pyx":2108
 *             (start, stop, step) = key, key + 1, 1
 *         # Slices
 *         elif isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step:
 */
  __Pyx_TraceLine(2108,0,__PYX_ERR(0, 2108, __pyx_L1_error))
  __pyx_t_4 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_4 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2109
 *         # Slices
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step             # <<<<<<<<<<<<<<
 *             if step:
 *                 if step <= 0:
 */
    __Pyx_TraceLine(2109,0,__PYX_ERR(0, 2109, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_start = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_stop = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_step = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":2110
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step:             # <<<<<<<<<<<<<<
 *                 if step <= 0:
 *                     raise NotImplementedError(
 */
    __Pyx_TraceLine(2110,0,__PYX_ERR(0, 2110, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_step); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2110, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2111
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step:
 *                 if step <= 0:             # <<<<<<<<<<<<<<
 *                     raise NotImplementedError(
 *                         "step in slice can only be positive")
 */
      __Pyx_TraceLine(2111,0,__PYX_ERR(0, 2111, __pyx_L1_error))
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_step, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2111, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2111, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2112
 *             if step:
 *                 if step <= 0:
 *                     raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                         "step in slice can only be positive")
 *         # Multidimensional keys
 */
        __Pyx_TraceLine(2112,0,__PYX_ERR(0, 2112, __pyx_L1_error))
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2112, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(0, 2112, __pyx_L1_error)

        /* "bcolz/carray_ext.pyx":2111
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step:
 *                 if step <= 0:             # <<<<<<<<<<<<<<
 *                     raise NotImplementedError(
 *                         "step in slice can only be positive")
 */
      }

      /* "bcolz/carray_ext.pyx":2110
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step:             # <<<<<<<<<<<<<<
 *                 if step <= 0:
 *                     raise NotImplementedError(
 */
    }

    /* "bcolz/carray_ext.pyx":2108
 *             (start, stop, step) = key, key + 1, 1
 *         # Slices
 *         elif isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step:
 */
    goto __pyx_L5;
  }

  /* "bcolz/carray_ext.pyx":2115
 *                         "step in slice can only be positive")
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):             # <<<<<<<<<<<<<<
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 */
  __Pyx_TraceLine(2115,0,__PYX_ERR(0, 2115, __pyx_L1_error))
  __pyx_t_2 = PyTuple_Check(__pyx_v_key); 
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2116
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:
 */
    __Pyx_TraceLine(2116,0,__PYX_ERR(0, 2116, __pyx_L1_error))
    __pyx_t_6 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2116, __pyx_L1_error)
    __pyx_t_4 = ((__pyx_t_6 == 0) != 0);
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2117
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")             # <<<<<<<<<<<<<<
 *             elif len(key) == 1:
 *                 self[key[0]] = value
 */
      __Pyx_TraceLine(2117,0,__PYX_ERR(0, 2117, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 2117, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":2116
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:
 */
    }

    /* "bcolz/carray_ext.pyx":2118
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:             # <<<<<<<<<<<<<<
 *                 self[key[0]] = value
 *                 return
 */
    __Pyx_TraceLine(2118,0,__PYX_ERR(0, 2118, __pyx_L1_error))
    __pyx_t_6 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2118, __pyx_L1_error)
    __pyx_t_4 = ((__pyx_t_6 == 1) != 0);
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2119
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:
 *                 self[key[0]] = value             # <<<<<<<<<<<<<<
 *                 return
 *             # An n-dimensional slice
 */
      __Pyx_TraceLine(2119,0,__PYX_ERR(0, 2119, __pyx_L1_error))
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2119, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_v_value) < 0)) __PYX_ERR(0, 2119, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":2120
 *             elif len(key) == 1:
 *                 self[key[0]] = value
 *                 return             # <<<<<<<<<<<<<<
 *             # An n-dimensional slice
 *             # First, retrieve elements in the leading dimension
 */
      __Pyx_TraceLine(2120,0,__PYX_ERR(0, 2120, __pyx_L1_error))
      __pyx_r = 0;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":2118
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:             # <<<<<<<<<<<<<<
 *                 self[key[0]] = value
 *                 return
 */
    }

    /* "bcolz/carray_ext.pyx":2123
 *             # An n-dimensional slice
 *             # First, retrieve elements in the leading dimension
 *             arr = self[key[0]]             # <<<<<<<<<<<<<<
 *             # Then, assing only the requested elements in other dimensions
 *             if type(key[0]) == slice:
 */
    __Pyx_TraceLine(2123,0,__PYX_ERR(0, 2123, __pyx_L1_error))
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_arr = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2125
 *             arr = self[key[0]]
 *             # Then, assing only the requested elements in other dimensions
 *             if type(key[0]) == slice:             # <<<<<<<<<<<<<<
 *                 arr[(slice(None),) + key[1:]] = value
 *             else:
 */
    __Pyx_TraceLine(2125,0,__PYX_ERR(0, 2125, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_1)), ((PyObject *)(&PySlice_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2125, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2125, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2126
 *             # Then, assing only the requested elements in other dimensions
 *             if type(key[0]) == slice:
 *                 arr[(slice(None),) + key[1:]] = value             # <<<<<<<<<<<<<<
 *             else:
 *                 arr[key[1:]] = value
 */
      __Pyx_TraceLine(2126,0,__PYX_ERR(0, 2126, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__94, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyNumber_Add(__pyx_tuple__93, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_arr, __pyx_t_1, __pyx_v_value) < 0)) __PYX_ERR(0, 2126, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2125
 *             arr = self[key[0]]
 *             # Then, assing only the requested elements in other dimensions
 *             if type(key[0]) == slice:             # <<<<<<<<<<<<<<
 *                 arr[(slice(None),) + key[1:]] = value
 *             else:
 */
      goto __pyx_L11;
    }

    /* "bcolz/carray_ext.pyx":2128
 *                 arr[(slice(None),) + key[1:]] = value
 *             else:
 *                 arr[key[1:]] = value             # <<<<<<<<<<<<<<
 *             # Finally, update this superset of values in self
 *             self[key[0]] = arr
 */
    __Pyx_TraceLine(2128,0,__PYX_ERR(0, 2128, __pyx_L1_error))
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__95, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(PyObject_SetItem(__pyx_v_arr, __pyx_t_1, __pyx_v_value) < 0)) __PYX_ERR(0, 2128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L11:;

    /* "bcolz/carray_ext.pyx":2130
 *                 arr[key[1:]] = value
 *             # Finally, update this superset of values in self
 *             self[key[0]] = arr             # <<<<<<<<<<<<<<
 *             return
 *         # List of integers (case of fancy indexing)
 */
    __Pyx_TraceLine(2130,0,__PYX_ERR(0, 2130, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_t_1, __pyx_v_arr) < 0)) __PYX_ERR(0, 2130, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2131
 *             # Finally, update this superset of values in self
 *             self[key[0]] = arr
 *             return             # <<<<<<<<<<<<<<
 *         # List of integers (case of fancy indexing)
 *         elif isinstance(key, list):
 */
    __Pyx_TraceLine(2131,0,__PYX_ERR(0, 2131, __pyx_L1_error))
    __pyx_r = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2115
 *                         "step in slice can only be positive")
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):             # <<<<<<<<<<<<<<
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 */
  }

  /* "bcolz/carray_ext.pyx":2133
 *             return
 *         # List of integers (case of fancy indexing)
 *         elif isinstance(key, list):             # <<<<<<<<<<<<<<
 *             # Try to convert to a integer array
 *             try:
 */
  __Pyx_TraceLine(2133,0,__PYX_ERR(0, 2133, __pyx_L1_error))
  __pyx_t_4 = PyList_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_4 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2135
 *         elif isinstance(key, list):
 *             # Try to convert to a integer array
 *             try:             # <<<<<<<<<<<<<<
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 */
    __Pyx_TraceLine(2135,0,__PYX_ERR(0, 2135, __pyx_L12_error))
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      /*try:*/ {

        /* "bcolz/carray_ext.pyx":2136
 *             # Try to convert to a integer array
 *             try:
 *                 key = np.array(key, dtype=np.int_)             # <<<<<<<<<<<<<<
 *             except:
 *                 raise IndexError(
 */
        __Pyx_TraceLine(2136,0,__PYX_ERR(0, 2136, __pyx_L12_error))
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2136, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2136, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2136, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
        __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2136, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2136, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2136, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 2136, __pyx_L12_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2136, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "bcolz/carray_ext.pyx":2135
 *         elif isinstance(key, list):
 *             # Try to convert to a integer array
 *             try:             # <<<<<<<<<<<<<<
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L19_try_end;
      __pyx_L12_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "bcolz/carray_ext.pyx":2137
 *             try:
 *                 key = np.array(key, dtype=np.int_)
 *             except:             # <<<<<<<<<<<<<<
 *                 raise IndexError(
 *                     "key cannot be converted to an array of indices")
 */
      __Pyx_TraceLine(2137,0,__PYX_ERR(0, 2137, __pyx_L14_except_error))
      /*except:*/ {
        __Pyx_AddTraceback("bcolz.carray_ext.carray.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 2137, __pyx_L14_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_1);

        /* "bcolz/carray_ext.pyx":2138
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "key cannot be converted to an array of indices")
 *             self[key] = value
 */
        __Pyx_TraceLine(2138,0,__PYX_ERR(0, 2138, __pyx_L14_except_error))
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2138, __pyx_L14_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(0, 2138, __pyx_L14_except_error)
      }
      __pyx_L14_except_error:;

      /* "bcolz/carray_ext.pyx":2135
 *         elif isinstance(key, list):
 *             # Try to convert to a integer array
 *             try:             # <<<<<<<<<<<<<<
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      goto __pyx_L1_error;
      __pyx_L19_try_end:;
    }

    /* "bcolz/carray_ext.pyx":2140
 *                 raise IndexError(
 *                     "key cannot be converted to an array of indices")
 *             self[key] = value             # <<<<<<<<<<<<<<
 *             return
 *         # A boolean or integer array (case of fancy indexing)
 */
    __Pyx_TraceLine(2140,0,__PYX_ERR(0, 2140, __pyx_L1_error))
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_key, __pyx_v_value) < 0)) __PYX_ERR(0, 2140, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2141
 *                     "key cannot be converted to an array of indices")
 *             self[key] = value
 *             return             # <<<<<<<<<<<<<<
 *         # A boolean or integer array (case of fancy indexing)
 *         elif hasattr(key, "dtype"):
 */
    __Pyx_TraceLine(2141,0,__PYX_ERR(0, 2141, __pyx_L1_error))
    __pyx_r = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2133
 *             return
 *         # List of integers (case of fancy indexing)
 *         elif isinstance(key, list):             # <<<<<<<<<<<<<<
 *             # Try to convert to a integer array
 *             try:
 */
  }

  /* "bcolz/carray_ext.pyx":2143
 *             return
 *         # A boolean or integer array (case of fancy indexing)
 *         elif hasattr(key, "dtype"):             # <<<<<<<<<<<<<<
 *             if key.dtype.type == np.bool_:
 *                 # A boolean array
 */
  __Pyx_TraceLine(2143,0,__PYX_ERR(0, 2143, __pyx_L1_error))
  __pyx_t_2 = PyObject_HasAttr(__pyx_v_key, __pyx_n_s_dtype); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2143, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2144
 *         # A boolean or integer array (case of fancy indexing)
 *         elif hasattr(key, "dtype"):
 *             if key.dtype.type == np.bool_:             # <<<<<<<<<<<<<<
 *                 # A boolean array
 *                 if len(key) != self.len:
 */
    __Pyx_TraceLine(2144,0,__PYX_ERR(0, 2144, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bool); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2144, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2144, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2144, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2146
 *             if key.dtype.type == np.bool_:
 *                 # A boolean array
 *                 if len(key) != self.len:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         "boolean array length must match len(self)")
 */
      __Pyx_TraceLine(2146,0,__PYX_ERR(0, 2146, __pyx_L1_error))
      __pyx_t_6 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2146, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_4) {

        /* "bcolz/carray_ext.pyx":2147
 *                 # A boolean array
 *                 if len(key) != self.len:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         "boolean array length must match len(self)")
 *                 self.bool_update(key, value)
 */
        __Pyx_TraceLine(2147,0,__PYX_ERR(0, 2147, __pyx_L1_error))
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2147, __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_ERR(0, 2147, __pyx_L1_error)

        /* "bcolz/carray_ext.pyx":2146
 *             if key.dtype.type == np.bool_:
 *                 # A boolean array
 *                 if len(key) != self.len:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         "boolean array length must match len(self)")
 */
      }

      /* "bcolz/carray_ext.pyx":2149
 *                     raise ValueError(
 *                         "boolean array length must match len(self)")
 *                 self.bool_update(key, value)             # <<<<<<<<<<<<<<
 *                 return
 *             elif np.issubsctype(key, np.int_):
 */
      __Pyx_TraceLine(2149,0,__PYX_ERR(0, 2149, __pyx_L1_error))
      ((struct __pyx_vtabstruct_5bcolz_10carray_ext_carray *)__pyx_v_self->__pyx_vtab)->bool_update(__pyx_v_self, __pyx_v_key, __pyx_v_value);

      /* "bcolz/carray_ext.pyx":2150
 *                         "boolean array length must match len(self)")
 *                 self.bool_update(key, value)
 *                 return             # <<<<<<<<<<<<<<
 *             elif np.issubsctype(key, np.int_):
 *                 # An integer array
 */
      __Pyx_TraceLine(2150,0,__PYX_ERR(0, 2150, __pyx_L1_error))
      __pyx_r = 0;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":2144
 *         # A boolean or integer array (case of fancy indexing)
 *         elif hasattr(key, "dtype"):
 *             if key.dtype.type == np.bool_:             # <<<<<<<<<<<<<<
 *                 # A boolean array
 *                 if len(key) != self.len:
 */
    }

    /* "bcolz/carray_ext.pyx":2151
 *                 self.bool_update(key, value)
 *                 return
 *             elif np.issubsctype(key, np.int_):             # <<<<<<<<<<<<<<
 *                 # An integer array
 *                 value = utils.to_ndarray(value, self._dtype, arrlen=len(key),
 */
    __Pyx_TraceLine(2151,0,__PYX_ERR(0, 2151, __pyx_L1_error))
    __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_issubsctype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_11) {
      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
    }
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2151, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2153
 *             elif np.issubsctype(key, np.int_):
 *                 # An integer array
 *                 value = utils.to_ndarray(value, self._dtype, arrlen=len(key),             # <<<<<<<<<<<<<<
 *                         safe=self._safe)
 *                 # XXX This could be optimised, but it works like this
 */
      __Pyx_TraceLine(2153,0,__PYX_ERR(0, 2153, __pyx_L1_error))
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_to_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_value);
      __Pyx_INCREF(__pyx_v_self->_dtype);
      __Pyx_GIVEREF(__pyx_v_self->_dtype);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->_dtype);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2153, __pyx_L1_error)
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_arrlen, __pyx_t_3) < 0) __PYX_ERR(0, 2153, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":2154
 *                 # An integer array
 *                 value = utils.to_ndarray(value, self._dtype, arrlen=len(key),
 *                         safe=self._safe)             # <<<<<<<<<<<<<<
 *                 # XXX This could be optimised, but it works like this
 *                 for i, item in enumerate(key):
 */
      __Pyx_TraceLine(2154,0,__PYX_ERR(0, 2154, __pyx_L1_error))
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_safe, __pyx_v_self->_safe) < 0) __PYX_ERR(0, 2153, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":2153
 *             elif np.issubsctype(key, np.int_):
 *                 # An integer array
 *                 value = utils.to_ndarray(value, self._dtype, arrlen=len(key),             # <<<<<<<<<<<<<<
 *                         safe=self._safe)
 *                 # XXX This could be optimised, but it works like this
 */
      __Pyx_TraceLine(2153,0,__PYX_ERR(0, 2153, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":2156
 *                         safe=self._safe)
 *                 # XXX This could be optimised, but it works like this
 *                 for i, item in enumerate(key):             # <<<<<<<<<<<<<<
 *                     self[item] = value[i]
 *                 return
 */
      __Pyx_TraceLine(2156,0,__PYX_ERR(0, 2156, __pyx_L1_error))
      __Pyx_INCREF(__pyx_int_0);
      __pyx_t_3 = __pyx_int_0;
      if (likely(PyList_CheckExact(__pyx_v_key)) || PyTuple_CheckExact(__pyx_v_key)) {
        __pyx_t_10 = __pyx_v_key; __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_6 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_key); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2156, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_12 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2156, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_12)) {
          if (likely(PyList_CheckExact(__pyx_t_10))) {
            if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2156, __pyx_L1_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2156, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2156, __pyx_L1_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2156, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_12(__pyx_t_10);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 2156, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
        __pyx_t_5 = 0;
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
        __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2156, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3);
        __pyx_t_3 = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "bcolz/carray_ext.pyx":2157
 *                 # XXX This could be optimised, but it works like this
 *                 for i, item in enumerate(key):
 *                     self[item] = value[i]             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
        __Pyx_TraceLine(2157,0,__PYX_ERR(0, 2157, __pyx_L1_error))
        __pyx_t_5 = PyObject_GetItem(__pyx_v_value, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2157, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_item, __pyx_t_5) < 0)) __PYX_ERR(0, 2157, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "bcolz/carray_ext.pyx":2156
 *                         safe=self._safe)
 *                 # XXX This could be optimised, but it works like this
 *                 for i, item in enumerate(key):             # <<<<<<<<<<<<<<
 *                     self[item] = value[i]
 *                 return
 */
        __Pyx_TraceLine(2156,0,__PYX_ERR(0, 2156, __pyx_L1_error))
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":2158
 *                 for i, item in enumerate(key):
 *                     self[item] = value[i]
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 raise IndexError(
 */
      __Pyx_TraceLine(2158,0,__PYX_ERR(0, 2158, __pyx_L1_error))
      __pyx_r = 0;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":2151
 *                 self.bool_update(key, value)
 *                 return
 *             elif np.issubsctype(key, np.int_):             # <<<<<<<<<<<<<<
 *                 # An integer array
 *                 value = utils.to_ndarray(value, self._dtype, arrlen=len(key),
 */
    }

    /* "bcolz/carray_ext.pyx":2160
 *                 return
 *             else:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "arrays used as indices must be of integer (or boolean) "
 *                     "type")
 */
    __Pyx_TraceLine(2160,0,__PYX_ERR(0, 2160, __pyx_L1_error))
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 2160, __pyx_L1_error)
    }

    /* "bcolz/carray_ext.pyx":2143
 *             return
 *         # A boolean or integer array (case of fancy indexing)
 *         elif hasattr(key, "dtype"):             # <<<<<<<<<<<<<<
 *             if key.dtype.type == np.bool_:
 *                 # A boolean array
 */
  }

  /* "bcolz/carray_ext.pyx":2164
 *                     "type")
 *         # An boolean expression (case of fancy indexing)
 *         elif type(key) is str:             # <<<<<<<<<<<<<<
 *             # Evaluate
 *             result = bcolz.eval(key)
 */
  __Pyx_TraceLine(2164,0,__PYX_ERR(0, 2164, __pyx_L1_error))
  __pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_key)) == ((PyObject *)(&PyString_Type)));
  __pyx_t_2 = (__pyx_t_4 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2166
 *         elif type(key) is str:
 *             # Evaluate
 *             result = bcolz.eval(key)             # <<<<<<<<<<<<<<
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")
 */
    __Pyx_TraceLine(2166,0,__PYX_ERR(0, 2166, __pyx_L1_error))
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_bcolz); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_eval); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_10) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = NULL;
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_key);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_result = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":2167
 *             # Evaluate
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:             # <<<<<<<<<<<<<<
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 */
    __Pyx_TraceLine(2167,0,__PYX_ERR(0, 2167, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_bool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2167, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2167, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2168
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")             # <<<<<<<<<<<<<<
 *             if len(result) != self.len:
 *                 raise IndexError(
 */
      __Pyx_TraceLine(2168,0,__PYX_ERR(0, 2168, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 2168, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":2167
 *             # Evaluate
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:             # <<<<<<<<<<<<<<
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 */
    }

    /* "bcolz/carray_ext.pyx":2169
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:             # <<<<<<<<<<<<<<
 *                 raise IndexError(
 *                     "boolean expression outcome must match len(self)")
 */
    __Pyx_TraceLine(2169,0,__PYX_ERR(0, 2169, __pyx_L1_error))
    __pyx_t_6 = PyObject_Length(__pyx_v_result); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2169, __pyx_L1_error)
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2169, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2169, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2170
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "boolean expression outcome must match len(self)")
 *             # Call __setitem__ again
 */
      __Pyx_TraceLine(2170,0,__PYX_ERR(0, 2170, __pyx_L1_error))
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2170, __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_ERR(0, 2170, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":2169
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:             # <<<<<<<<<<<<<<
 *                 raise IndexError(
 *                     "boolean expression outcome must match len(self)")
 */
    }

    /* "bcolz/carray_ext.pyx":2173
 *                     "boolean expression outcome must match len(self)")
 *             # Call __setitem__ again
 *             self[result] = value             # <<<<<<<<<<<<<<
 *             return
 *         # All the rest not implemented
 */
    __Pyx_TraceLine(2173,0,__PYX_ERR(0, 2173, __pyx_L1_error))
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_result, __pyx_v_value) < 0)) __PYX_ERR(0, 2173, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2174
 *             # Call __setitem__ again
 *             self[result] = value
 *             return             # <<<<<<<<<<<<<<
 *         # All the rest not implemented
 *         else:
 */
    __Pyx_TraceLine(2174,0,__PYX_ERR(0, 2174, __pyx_L1_error))
    __pyx_r = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2164
 *                     "type")
 *         # An boolean expression (case of fancy indexing)
 *         elif type(key) is str:             # <<<<<<<<<<<<<<
 *             # Evaluate
 *             result = bcolz.eval(key)
 */
  }

  /* "bcolz/carray_ext.pyx":2177
 *         # All the rest not implemented
 *         else:
 *             raise NotImplementedError("key not supported: %s" % repr(key))             # <<<<<<<<<<<<<<
 * 
 *         # Get the corrected values for start, stop, step
 */
  __Pyx_TraceLine(2177,0,__PYX_ERR(0, 2177, __pyx_L1_error))
  /*else*/ {
    __pyx_t_5 = PyObject_Repr(__pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_key_not_supported_s, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2177, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "bcolz/carray_ext.pyx":2180
 * 
 *         # Get the corrected values for start, stop, step
 *         (start, stop, step) = slice(start, stop, step).indices(self.len)             # <<<<<<<<<<<<<<
 * 
 *         # Special case for a complete replacement with a compatible dtype in
 */
  __Pyx_TraceLine(2180,0,__PYX_ERR(0, 2180, __pyx_L1_error))
  __pyx_t_5 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_10) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2180, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #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_ERR(0, 2180, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L28_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_11)) goto __pyx_L28_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_11);
    index = 2; __pyx_t_5 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L28_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_10), 3) < 0) __PYX_ERR(0, 2180, __pyx_L1_error)
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L29_unpacking_done;
    __pyx_L28_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2180, __pyx_L1_error)
    __pyx_L29_unpacking_done:;
  }
  __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_stop, __pyx_t_11);
  __pyx_t_11 = 0;
  __Pyx_DECREF_SET(__pyx_v_step, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":2184
 *         # Special case for a complete replacement with a compatible dtype in
 *         # value
 *         if (hasattr(value, "dtype") and self._dtype == value.dtype and             # <<<<<<<<<<<<<<
 *             start == 0 and stop == len(self) == len(value) and step == 1):
 *             self._set_entire_carray(value)
 */
  __Pyx_TraceLine(2184,0,__PYX_ERR(0, 2184, __pyx_L1_error))
  __pyx_t_4 = PyObject_HasAttr(__pyx_v_value, __pyx_n_s_dtype); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2184, __pyx_L1_error)
  __pyx_t_14 = (__pyx_t_4 != 0);
  if (__pyx_t_14) {
  } else {
    __pyx_t_2 = __pyx_t_14;
    goto __pyx_L31_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_self->_dtype, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 2184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_14) {
  } else {
    __pyx_t_2 = __pyx_t_14;
    goto __pyx_L31_bool_binop_done;
  }

  /* "bcolz/carray_ext.pyx":2185
 *         # value
 *         if (hasattr(value, "dtype") and self._dtype == value.dtype and
 *             start == 0 and stop == len(self) == len(value) and step == 1):             # <<<<<<<<<<<<<<
 *             self._set_entire_carray(value)
 *             return
 */
  __Pyx_TraceLine(2185,0,__PYX_ERR(0, 2185, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_v_start, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 2185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_14) {
  } else {
    __pyx_t_2 = __pyx_t_14;
    goto __pyx_L31_bool_binop_done;
  }
  __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2185, __pyx_L1_error)
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_stop, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_6 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2185, __pyx_L1_error)
    __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 2185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_14) {
  } else {
    __pyx_t_2 = __pyx_t_14;
    goto __pyx_L31_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_step, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 2185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_14;
  __pyx_L31_bool_binop_done:;

  /* "bcolz/carray_ext.pyx":2184
 *         # Special case for a complete replacement with a compatible dtype in
 *         # value
 *         if (hasattr(value, "dtype") and self._dtype == value.dtype and             # <<<<<<<<<<<<<<
 *             start == 0 and stop == len(self) == len(value) and step == 1):
 *             self._set_entire_carray(value)
 */
  __Pyx_TraceLine(2184,0,__PYX_ERR(0, 2184, __pyx_L1_error))
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2186
 *         if (hasattr(value, "dtype") and self._dtype == value.dtype and
 *             start == 0 and stop == len(self) == len(value) and step == 1):
 *             self._set_entire_carray(value)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __Pyx_TraceLine(2186,0,__PYX_ERR(0, 2186, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_entire_carray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_11) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11); __pyx_t_11 = NULL;
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_value);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2186, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2187
 *             start == 0 and stop == len(self) == len(value) and step == 1):
 *             self._set_entire_carray(value)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         # Build a numpy object out of value
 */
    __Pyx_TraceLine(2187,0,__PYX_ERR(0, 2187, __pyx_L1_error))
    __pyx_r = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2184
 *         # Special case for a complete replacement with a compatible dtype in
 *         # value
 *         if (hasattr(value, "dtype") and self._dtype == value.dtype and             # <<<<<<<<<<<<<<
 *             start == 0 and stop == len(self) == len(value) and step == 1):
 *             self._set_entire_carray(value)
 */
  }

  /* "bcolz/carray_ext.pyx":2190
 * 
 *         # Build a numpy object out of value
 *         vlen = get_len_of_range(start, stop, step)             # <<<<<<<<<<<<<<
 *         if vlen == 0:
 *             # If range is empty, return immediately
 */
  __Pyx_TraceLine(2190,0,__PYX_ERR(0, 2190, __pyx_L1_error))
  __pyx_t_15 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_start); if (unlikely((__pyx_t_15 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2190, __pyx_L1_error)
  __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_stop); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2190, __pyx_L1_error)
  __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_step); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2190, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_5bcolz_10carray_ext_get_len_of_range(__pyx_t_15, __pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_vlen = __pyx_t_17;

  /* "bcolz/carray_ext.pyx":2191
 *         # Build a numpy object out of value
 *         vlen = get_len_of_range(start, stop, step)
 *         if vlen == 0:             # <<<<<<<<<<<<<<
 *             # If range is empty, return immediately
 *             return
 */
  __Pyx_TraceLine(2191,0,__PYX_ERR(0, 2191, __pyx_L1_error))
  __pyx_t_2 = ((__pyx_v_vlen == 0) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2193
 *         if vlen == 0:
 *             # If range is empty, return immediately
 *             return             # <<<<<<<<<<<<<<
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,
 *                                  safe=self._safe)
 */
    __Pyx_TraceLine(2193,0,__PYX_ERR(0, 2193, __pyx_L1_error))
    __pyx_r = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2191
 *         # Build a numpy object out of value
 *         vlen = get_len_of_range(start, stop, step)
 *         if vlen == 0:             # <<<<<<<<<<<<<<
 *             # If range is empty, return immediately
 *             return
 */
  }

  /* "bcolz/carray_ext.pyx":2194
 *             # If range is empty, return immediately
 *             return
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,             # <<<<<<<<<<<<<<
 *                                  safe=self._safe)
 * 
 */
  __Pyx_TraceLine(2194,0,__PYX_ERR(0, 2194, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ndarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
  __Pyx_INCREF(__pyx_v_self->_dtype);
  __Pyx_GIVEREF(__pyx_v_self->_dtype);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_dtype);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_vlen); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arrlen, __pyx_t_11) < 0) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "bcolz/carray_ext.pyx":2195
 *             return
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,
 *                                  safe=self._safe)             # <<<<<<<<<<<<<<
 * 
 *         # Fill it from data in chunks
 */
  __Pyx_TraceLine(2195,0,__PYX_ERR(0, 2195, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_safe, __pyx_v_self->_safe) < 0) __PYX_ERR(0, 2194, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":2194
 *             # If range is empty, return immediately
 *             return
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,             # <<<<<<<<<<<<<<
 *                                  safe=self._safe)
 * 
 */
  __Pyx_TraceLine(2194,0,__PYX_ERR(0, 2194, __pyx_L1_error))
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_11);
  __pyx_t_11 = 0;

  /* "bcolz/carray_ext.pyx":2198
 * 
 *         # Fill it from data in chunks
 *         nwrow = 0             # <<<<<<<<<<<<<<
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */
  __Pyx_TraceLine(2198,0,__PYX_ERR(0, 2198, __pyx_L1_error))
  __pyx_v_nwrow = 0;

  /* "bcolz/carray_ext.pyx":2199
 *         # Fill it from data in chunks
 *         nwrow = 0
 *         chunklen = self._chunklen             # <<<<<<<<<<<<<<
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:
 */
  __Pyx_TraceLine(2199,0,__PYX_ERR(0, 2199, __pyx_L1_error))
  __pyx_t_18 = __pyx_v_self->_chunklen;
  __pyx_v_chunklen = __pyx_t_18;

  /* "bcolz/carray_ext.pyx":2200
 *         nwrow = 0
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         if self.leftover > 0:
 *             nchunks += 1
 */
  __Pyx_TraceLine(2200,0,__PYX_ERR(0, 2200, __pyx_L1_error))
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":2201
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:             # <<<<<<<<<<<<<<
 *             nchunks += 1
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)
 */
  __Pyx_TraceLine(2201,0,__PYX_ERR(0, 2201, __pyx_L1_error))
  __pyx_t_2 = ((__pyx_v_self->leftover > 0) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2202
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:
 *             nchunks += 1             # <<<<<<<<<<<<<<
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)
 *         last_chunk = <npy_intp> cython.cdiv(stop, self.chunklen) + 1
 */
    __Pyx_TraceLine(2202,0,__PYX_ERR(0, 2202, __pyx_L1_error))
    __pyx_v_nchunks = (__pyx_v_nchunks + 1);

    /* "bcolz/carray_ext.pyx":2201
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:             # <<<<<<<<<<<<<<
 *             nchunks += 1
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)
 */
  }

  /* "bcolz/carray_ext.pyx":2203
 *         if self.leftover > 0:
 *             nchunks += 1
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)             # <<<<<<<<<<<<<<
 *         last_chunk = <npy_intp> cython.cdiv(stop, self.chunklen) + 1
 *         last_chunk = min(last_chunk, nchunks)
 */
  __Pyx_TraceLine(2203,0,__PYX_ERR(0, 2203, __pyx_L1_error))
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunklen); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_start, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_3); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_first_chunk = ((npy_intp)__pyx_t_17);

  /* "bcolz/carray_ext.pyx":2204
 *             nchunks += 1
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)
 *         last_chunk = <npy_intp> cython.cdiv(stop, self.chunklen) + 1             # <<<<<<<<<<<<<<
 *         last_chunk = min(last_chunk, nchunks)
 *         for nchunk from first_chunk <= nchunk < last_chunk:
 */
  __Pyx_TraceLine(2204,0,__PYX_ERR(0, 2204, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunklen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_v_stop, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_11); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_v_last_chunk = (((npy_intp)__pyx_t_17) + 1);

  /* "bcolz/carray_ext.pyx":2205
 *         first_chunk = <npy_intp> cython.cdiv(start, self.chunklen)
 *         last_chunk = <npy_intp> cython.cdiv(stop, self.chunklen) + 1
 *         last_chunk = min(last_chunk, nchunks)             # <<<<<<<<<<<<<<
 *         for nchunk from first_chunk <= nchunk < last_chunk:
 *             # Compute start & stop for each block
 */
  __Pyx_TraceLine(2205,0,__PYX_ERR(0, 2205, __pyx_L1_error))
  __pyx_t_17 = __pyx_v_nchunks;
  __pyx_t_16 = __pyx_v_last_chunk;
  if (((__pyx_t_17 < __pyx_t_16) != 0)) {
    __pyx_t_15 = __pyx_t_17;
  } else {
    __pyx_t_15 = __pyx_t_16;
  }
  __pyx_v_last_chunk = __pyx_t_15;

  /* "bcolz/carray_ext.pyx":2206
 *         last_chunk = <npy_intp> cython.cdiv(stop, self.chunklen) + 1
 *         last_chunk = min(last_chunk, nchunks)
 *         for nchunk from first_chunk <= nchunk < last_chunk:             # <<<<<<<<<<<<<<
 *             # Compute start & stop for each block
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 */
  __Pyx_TraceLine(2206,0,__PYX_ERR(0, 2206, __pyx_L1_error))
  __pyx_t_15 = __pyx_v_last_chunk;
  for (__pyx_v_nchunk = __pyx_v_first_chunk; __pyx_v_nchunk < __pyx_t_15; __pyx_v_nchunk++) {

    /* "bcolz/carray_ext.pyx":2208
 *         for nchunk from first_chunk <= nchunk < last_chunk:
 *             # Compute start & stop for each block
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,             # <<<<<<<<<<<<<<
 *                                              step)
 *             if blen == 0:
 */
    __Pyx_TraceLine(2208,0,__PYX_ERR(0, 2208, __pyx_L1_error))
    __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_start); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L1_error)
    __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_stop); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2209
 *             # Compute start & stop for each block
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 *                                              step)             # <<<<<<<<<<<<<<
 *             if blen == 0:
 *                 continue
 */
    __Pyx_TraceLine(2209,0,__PYX_ERR(0, 2209, __pyx_L1_error))
    __pyx_t_19 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_step); if (unlikely((__pyx_t_19 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2209, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2208
 *         for nchunk from first_chunk <= nchunk < last_chunk:
 *             # Compute start & stop for each block
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,             # <<<<<<<<<<<<<<
 *                                              step)
 *             if blen == 0:
 */
    __Pyx_TraceLine(2208,0,__PYX_ERR(0, 2208, __pyx_L1_error))
    __pyx_t_11 = __pyx_f_5bcolz_10carray_ext_clip_chunk(__pyx_v_nchunk, __pyx_v_chunklen, __pyx_t_17, __pyx_t_16, __pyx_t_19); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) {
      PyObject* sequence = __pyx_t_11;
      #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_ERR(0, 2208, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L40_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_1 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L40_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 2; __pyx_t_5 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L40_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_10), 3) < 0) __PYX_ERR(0, 2208, __pyx_L1_error)
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L41_unpacking_done;
      __pyx_L40_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2208, __pyx_L1_error)
      __pyx_L41_unpacking_done:;
    }
    __pyx_t_19 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_3); if (unlikely((__pyx_t_19 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_startb = __pyx_t_19;
    __pyx_v_stopb = __pyx_t_16;
    __pyx_v_blen = __pyx_t_17;

    /* "bcolz/carray_ext.pyx":2210
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 *                                              step)
 *             if blen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Modify the data in chunk
 */
    __Pyx_TraceLine(2210,0,__PYX_ERR(0, 2210, __pyx_L1_error))
    __pyx_t_2 = ((__pyx_v_blen == 0) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2211
 *                                              step)
 *             if blen == 0:
 *                 continue             # <<<<<<<<<<<<<<
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:
 */
      __Pyx_TraceLine(2211,0,__PYX_ERR(0, 2211, __pyx_L1_error))
      goto __pyx_L38_continue;

      /* "bcolz/carray_ext.pyx":2210
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 *                                              step)
 *             if blen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Modify the data in chunk
 */
    }

    /* "bcolz/carray_ext.pyx":2213
 *                 continue
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:             # <<<<<<<<<<<<<<
 *                 self.lastchunkarr[startb:stopb:step] = value[
 *                                                        nwrow:nwrow + blen]
 */
    __Pyx_TraceLine(2213,0,__PYX_ERR(0, 2213, __pyx_L1_error))
    __pyx_t_14 = ((__pyx_v_nchunk == (__pyx_v_nchunks - 1)) != 0);
    if (__pyx_t_14) {
    } else {
      __pyx_t_2 = __pyx_t_14;
      goto __pyx_L44_bool_binop_done;
    }
    __pyx_t_14 = (__pyx_v_self->leftover != 0);
    __pyx_t_2 = __pyx_t_14;
    __pyx_L44_bool_binop_done:;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2214
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:
 *                 self.lastchunkarr[startb:stopb:step] = value[             # <<<<<<<<<<<<<<
 *                                                        nwrow:nwrow + blen]
 *             else:
 */
      __Pyx_TraceLine(2214,0,__PYX_ERR(0, 2214, __pyx_L1_error))
      __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_value, __pyx_v_nwrow, (__pyx_v_nwrow + __pyx_v_blen), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_stopb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PySlice_New(__pyx_t_5, __pyx_t_1, __pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(PyObject_SetItem(__pyx_v_self->lastchunkarr, __pyx_t_3, __pyx_t_11) < 0)) __PYX_ERR(0, 2214, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "bcolz/carray_ext.pyx":2213
 *                 continue
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:             # <<<<<<<<<<<<<<
 *                 self.lastchunkarr[startb:stopb:step] = value[
 *                                                        nwrow:nwrow + blen]
 */
      goto __pyx_L43;
    }

    /* "bcolz/carray_ext.pyx":2218
 *             else:
 *                 # Get the data chunk
 *                 chunk_ = self.chunks[nchunk]             # <<<<<<<<<<<<<<
 *                 self._cbytes -= chunk_.cbytes
 *                 if stopb - startb < chunklen or step > 1:
 */
    __Pyx_TraceLine(2218,0,__PYX_ERR(0, 2218, __pyx_L1_error))
    /*else*/ {
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_self->chunks, __pyx_v_nchunk, npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5bcolz_10carray_ext_chunk))))) __PYX_ERR(0, 2218, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_chunk_, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_11));
      __pyx_t_11 = 0;

      /* "bcolz/carray_ext.pyx":2219
 *                 # Get the data chunk
 *                 chunk_ = self.chunks[nchunk]
 *                 self._cbytes -= chunk_.cbytes             # <<<<<<<<<<<<<<
 *                 if stopb - startb < chunklen or step > 1:
 *                     # Get all the values in chunk
 */
      __Pyx_TraceLine(2219,0,__PYX_ERR(0, 2219, __pyx_L1_error))
      __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes - __pyx_v_chunk_->cbytes);

      /* "bcolz/carray_ext.pyx":2220
 *                 chunk_ = self.chunks[nchunk]
 *                 self._cbytes -= chunk_.cbytes
 *                 if stopb - startb < chunklen or step > 1:             # <<<<<<<<<<<<<<
 *                     # Get all the values in chunk
 *                     cdata = chunk_[:]
 */
      __Pyx_TraceLine(2220,0,__PYX_ERR(0, 2220, __pyx_L1_error))
      __pyx_t_14 = (((__pyx_v_stopb - __pyx_v_startb) < __pyx_v_chunklen) != 0);
      if (!__pyx_t_14) {
      } else {
        __pyx_t_2 = __pyx_t_14;
        goto __pyx_L47_bool_binop_done;
      }
      __pyx_t_11 = PyObject_RichCompare(__pyx_v_step, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2220, __pyx_L1_error)
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 2220, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_2 = __pyx_t_14;
      __pyx_L47_bool_binop_done:;
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2222
 *                 if stopb - startb < chunklen or step > 1:
 *                     # Get all the values in chunk
 *                     cdata = chunk_[:]             # <<<<<<<<<<<<<<
 *                     # Overwrite it with data from value
 *                     cdata[startb:stopb:step] = value[nwrow:nwrow + blen]
 */
        __Pyx_TraceLine(2222,0,__PYX_ERR(0, 2222, __pyx_L1_error))
        __pyx_t_11 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_chunk_), 0, 0, NULL, NULL, &__pyx_slice__101, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2222, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF_SET(__pyx_v_cdata, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "bcolz/carray_ext.pyx":2224
 *                     cdata = chunk_[:]
 *                     # Overwrite it with data from value
 *                     cdata[startb:stopb:step] = value[nwrow:nwrow + blen]             # <<<<<<<<<<<<<<
 *                 else:
 *                     # Replacing a complete chunk, no need to access existing
 */
        __Pyx_TraceLine(2224,0,__PYX_ERR(0, 2224, __pyx_L1_error))
        __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_value, __pyx_v_nwrow, (__pyx_v_nwrow + __pyx_v_blen), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_stopb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PySlice_New(__pyx_t_3, __pyx_t_1, __pyx_v_step); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(PyObject_SetItem(__pyx_v_cdata, __pyx_t_5, __pyx_t_11) < 0)) __PYX_ERR(0, 2224, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "bcolz/carray_ext.pyx":2220
 *                 chunk_ = self.chunks[nchunk]
 *                 self._cbytes -= chunk_.cbytes
 *                 if stopb - startb < chunklen or step > 1:             # <<<<<<<<<<<<<<
 *                     # Get all the values in chunk
 *                     cdata = chunk_[:]
 */
        goto __pyx_L46;
      }

      /* "bcolz/carray_ext.pyx":2228
 *                     # Replacing a complete chunk, no need to access existing
 *                     # data
 *                     cdata = value[nwrow:nwrow + blen]             # <<<<<<<<<<<<<<
 *                 # Replace the chunk
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,
 */
      __Pyx_TraceLine(2228,0,__PYX_ERR(0, 2228, __pyx_L1_error))
      /*else*/ {
        __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_value, __pyx_v_nwrow, (__pyx_v_nwrow + __pyx_v_blen), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2228, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF_SET(__pyx_v_cdata, __pyx_t_11);
        __pyx_t_11 = 0;
      }
      __pyx_L46:;

      /* "bcolz/carray_ext.pyx":2230
 *                     cdata = value[nwrow:nwrow + blen]
 *                 # Replace the chunk
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,             # <<<<<<<<<<<<<<
 *                                _memory=self._rootdir is None)
 *                 self.chunks[nchunk] = chunk_
 */
      __Pyx_TraceLine(2230,0,__PYX_ERR(0, 2230, __pyx_L1_error))
      __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_v_cdata);
      __Pyx_GIVEREF(__pyx_v_cdata);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_cdata);
      __Pyx_INCREF(__pyx_v_self->_dtype);
      __Pyx_GIVEREF(__pyx_v_self->_dtype);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_self->_dtype);
      __Pyx_INCREF(__pyx_v_self->_cparams);
      __Pyx_GIVEREF(__pyx_v_self->_cparams);
      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_self->_cparams);

      /* "bcolz/carray_ext.pyx":2231
 *                 # Replace the chunk
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,
 *                                _memory=self._rootdir is None)             # <<<<<<<<<<<<<<
 *                 self.chunks[nchunk] = chunk_
 *                 # Update cbytes counter
 */
      __Pyx_TraceLine(2231,0,__PYX_ERR(0, 2231, __pyx_L1_error))
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = (__pyx_v_self->_rootdir == Py_None);
      __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory, __pyx_t_1) < 0) __PYX_ERR(0, 2231, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2230
 *                     cdata = value[nwrow:nwrow + blen]
 *                 # Replace the chunk
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,             # <<<<<<<<<<<<<<
 *                                _memory=self._rootdir is None)
 *                 self.chunks[nchunk] = chunk_
 */
      __Pyx_TraceLine(2230,0,__PYX_ERR(0, 2230, __pyx_L1_error))
      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_chunk_, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2232
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,
 *                                _memory=self._rootdir is None)
 *                 self.chunks[nchunk] = chunk_             # <<<<<<<<<<<<<<
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes
 */
      __Pyx_TraceLine(2232,0,__PYX_ERR(0, 2232, __pyx_L1_error))
      if (unlikely(__Pyx_SetItemInt(__pyx_v_self->chunks, __pyx_v_nchunk, ((PyObject *)__pyx_v_chunk_), npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 1, 1) < 0)) __PYX_ERR(0, 2232, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":2234
 *                 self.chunks[nchunk] = chunk_
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes             # <<<<<<<<<<<<<<
 *             nwrow += blen
 * 
 */
      __Pyx_TraceLine(2234,0,__PYX_ERR(0, 2234, __pyx_L1_error))
      __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes + __pyx_v_chunk_->cbytes);
    }
    __pyx_L43:;

    /* "bcolz/carray_ext.pyx":2235
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes
 *             nwrow += blen             # <<<<<<<<<<<<<<
 * 
 *         # Safety check
 */
    __Pyx_TraceLine(2235,0,__PYX_ERR(0, 2235, __pyx_L1_error))
    __pyx_v_nwrow = (__pyx_v_nwrow + __pyx_v_blen);
    __pyx_L38_continue:;
  }

  /* "bcolz/carray_ext.pyx":2238
 * 
 *         # Safety check
 *         assert (nwrow == vlen)             # <<<<<<<<<<<<<<
 * 
 *     def _set_entire_carray(self, value):
 */
  __Pyx_TraceLine(2238,0,__PYX_ERR(0, 2238, __pyx_L1_error))
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_nwrow == __pyx_v_vlen) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 2238, __pyx_L1_error)
    }
  }
  #endif

  /* "bcolz/carray_ext.pyx":2062
 *         return arr
 * 
 *     def __setitem__(self, object key, object value):             # <<<<<<<<<<<<<<
 *         """ x.__setitem__(key, value) <==> x[key] = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_stop);
  __Pyx_XDECREF(__pyx_v_step);
  __Pyx_XDECREF(__pyx_v_cdata);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2240
 *         assert (nwrow == vlen)
 * 
 *     def _set_entire_carray(self, value):             # <<<<<<<<<<<<<<
 *         """Copy the value in self chunk by chunk"""
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_43_set_entire_carray(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_42_set_entire_carray[] = "carray._set_entire_carray(self, value)\nCopy the value in self chunk by chunk";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_43_set_entire_carray(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_entire_carray (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_42_set_entire_carray(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_42_set_entire_carray(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_nbytes = NULL;
  PyObject *__pyx_v_chunklen = NULL;
  PyObject *__pyx_v_nchunks = NULL;
  PyObject *__pyx_v_nchunk = NULL;
  PyObject *__pyx_v_cdata = NULL;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("_set_entire_carray", 0);
  __Pyx_TraceCall("_set_entire_carray", __pyx_f[0], 2240, 0, __PYX_ERR(0, 2240, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2244
 * 
 *         # The number of bytes in incoming value
 *         nbytes = self.itemsize * value.size             # <<<<<<<<<<<<<<
 *         self._nbytes = nbytes
 * 
 */
  __Pyx_TraceLine(2244,0,__PYX_ERR(0, 2244, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_nbytes = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":2245
 *         # The number of bytes in incoming value
 *         nbytes = self.itemsize * value.size
 *         self._nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         chunklen = self._chunklen
 */
  __Pyx_TraceLine(2245,0,__PYX_ERR(0, 2245, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_nbytes); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2245, __pyx_L1_error)
  __pyx_v_self->_nbytes = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":2247
 *         self._nbytes = nbytes
 * 
 *         chunklen = self._chunklen             # <<<<<<<<<<<<<<
 *         nchunks = self.nchunks
 *         self._cbytes = self._chunksize  # count the last chunk
 */
  __Pyx_TraceLine(2247,0,__PYX_ERR(0, 2247, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->_chunklen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_chunklen = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":2248
 * 
 *         chunklen = self._chunklen
 *         nchunks = self.nchunks             # <<<<<<<<<<<<<<
 *         self._cbytes = self._chunksize  # count the last chunk
 *         for nchunk in range(nchunks):
 */
  __Pyx_TraceLine(2248,0,__PYX_ERR(0, 2248, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nchunks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_nchunks = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":2249
 *         chunklen = self._chunklen
 *         nchunks = self.nchunks
 *         self._cbytes = self._chunksize  # count the last chunk             # <<<<<<<<<<<<<<
 *         for nchunk in range(nchunks):
 *             cdata = value[nchunk * chunklen:(nchunk + 1) * chunklen]
 */
  __Pyx_TraceLine(2249,0,__PYX_ERR(0, 2249, __pyx_L1_error))
  __pyx_t_5 = __pyx_v_self->_chunksize;
  __pyx_v_self->_cbytes = __pyx_t_5;

  /* "bcolz/carray_ext.pyx":2250
 *         nchunks = self.nchunks
 *         self._cbytes = self._chunksize  # count the last chunk
 *         for nchunk in range(nchunks):             # <<<<<<<<<<<<<<
 *             cdata = value[nchunk * chunklen:(nchunk + 1) * chunklen]
 *             # Build and replace the chunk
 */
  __Pyx_TraceLine(2250,0,__PYX_ERR(0, 2250, __pyx_L1_error))
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_nchunks);
  __Pyx_GIVEREF(__pyx_v_nchunks);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_nchunks);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2250, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2250, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2250, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2250, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2250, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2250, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_nchunk, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":2251
 *         self._cbytes = self._chunksize  # count the last chunk
 *         for nchunk in range(nchunks):
 *             cdata = value[nchunk * chunklen:(nchunk + 1) * chunklen]             # <<<<<<<<<<<<<<
 *             # Build and replace the chunk
 *             chunk_ = chunk(cdata, self._dtype, self._cparams,
 */
    __Pyx_TraceLine(2251,0,__PYX_ERR(0, 2251, __pyx_L1_error))
    __pyx_t_2 = PyNumber_Multiply(__pyx_v_nchunk, __pyx_v_chunklen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_nchunk, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_chunklen); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_value, 0, 0, &__pyx_t_2, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cdata, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2253
 *             cdata = value[nchunk * chunklen:(nchunk + 1) * chunklen]
 *             # Build and replace the chunk
 *             chunk_ = chunk(cdata, self._dtype, self._cparams,             # <<<<<<<<<<<<<<
 *                            _memory=self._rootdir is None)
 *             self.chunks[nchunk] = chunk_
 */
    __Pyx_TraceLine(2253,0,__PYX_ERR(0, 2253, __pyx_L1_error))
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_cdata);
    __Pyx_GIVEREF(__pyx_v_cdata);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cdata);
    __Pyx_INCREF(__pyx_v_self->_dtype);
    __Pyx_GIVEREF(__pyx_v_self->_dtype);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_dtype);
    __Pyx_INCREF(__pyx_v_self->_cparams);
    __Pyx_GIVEREF(__pyx_v_self->_cparams);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->_cparams);

    /* "bcolz/carray_ext.pyx":2254
 *             # Build and replace the chunk
 *             chunk_ = chunk(cdata, self._dtype, self._cparams,
 *                            _memory=self._rootdir is None)             # <<<<<<<<<<<<<<
 *             self.chunks[nchunk] = chunk_
 *             # Update cbytes counter
 */
    __Pyx_TraceLine(2254,0,__PYX_ERR(0, 2254, __pyx_L1_error))
    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (__pyx_v_self->_rootdir == Py_None);
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_memory, __pyx_t_2) < 0) __PYX_ERR(0, 2254, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":2253
 *             cdata = value[nchunk * chunklen:(nchunk + 1) * chunklen]
 *             # Build and replace the chunk
 *             chunk_ = chunk(cdata, self._dtype, self._cparams,             # <<<<<<<<<<<<<<
 *                            _memory=self._rootdir is None)
 *             self.chunks[nchunk] = chunk_
 */
    __Pyx_TraceLine(2253,0,__PYX_ERR(0, 2253, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_chunk_, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":2255
 *             chunk_ = chunk(cdata, self._dtype, self._cparams,
 *                            _memory=self._rootdir is None)
 *             self.chunks[nchunk] = chunk_             # <<<<<<<<<<<<<<
 *             # Update cbytes counter
 *             self._cbytes += chunk_.cbytes
 */
    __Pyx_TraceLine(2255,0,__PYX_ERR(0, 2255, __pyx_L1_error))
    if (unlikely(PyObject_SetItem(__pyx_v_self->chunks, __pyx_v_nchunk, ((PyObject *)__pyx_v_chunk_)) < 0)) __PYX_ERR(0, 2255, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2257
 *             self.chunks[nchunk] = chunk_
 *             # Update cbytes counter
 *             self._cbytes += chunk_.cbytes             # <<<<<<<<<<<<<<
 *         if self.leftover:
 *             self.lastchunkarr[:len(self) - nchunks * chunklen] = value[
 */
    __Pyx_TraceLine(2257,0,__PYX_ERR(0, 2257, __pyx_L1_error))
    __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes + __pyx_v_chunk_->cbytes);

    /* "bcolz/carray_ext.pyx":2250
 *         nchunks = self.nchunks
 *         self._cbytes = self._chunksize  # count the last chunk
 *         for nchunk in range(nchunks):             # <<<<<<<<<<<<<<
 *             cdata = value[nchunk * chunklen:(nchunk + 1) * chunklen]
 *             # Build and replace the chunk
 */
    __Pyx_TraceLine(2250,0,__PYX_ERR(0, 2250, __pyx_L1_error))
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":2258
 *             # Update cbytes counter
 *             self._cbytes += chunk_.cbytes
 *         if self.leftover:             # <<<<<<<<<<<<<<
 *             self.lastchunkarr[:len(self) - nchunks * chunklen] = value[
 *                 nchunks * chunklen:]
 */
  __Pyx_TraceLine(2258,0,__PYX_ERR(0, 2258, __pyx_L1_error))
  __pyx_t_9 = (__pyx_v_self->leftover != 0);
  if (__pyx_t_9) {

    /* "bcolz/carray_ext.pyx":2260
 *         if self.leftover:
 *             self.lastchunkarr[:len(self) - nchunks * chunklen] = value[
 *                 nchunks * chunklen:]             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __Pyx_TraceLine(2260,0,__PYX_ERR(0, 2260, __pyx_L1_error))
    __pyx_t_3 = PyNumber_Multiply(__pyx_v_nchunks, __pyx_v_chunklen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "bcolz/carray_ext.pyx":2259
 *             self._cbytes += chunk_.cbytes
 *         if self.leftover:
 *             self.lastchunkarr[:len(self) - nchunks * chunklen] = value[             # <<<<<<<<<<<<<<
 *                 nchunks * chunklen:]
 *         return
 */
    __Pyx_TraceLine(2259,0,__PYX_ERR(0, 2259, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_value, 0, 0, &__pyx_t_3, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2259, __pyx_L1_error)
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyNumber_Multiply(__pyx_v_nchunks, __pyx_v_chunklen); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__Pyx_PyObject_SetSlice(__pyx_v_self->lastchunkarr, __pyx_t_2, 0, 0, NULL, &__pyx_t_1, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 2259, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":2258
 *             # Update cbytes counter
 *             self._cbytes += chunk_.cbytes
 *         if self.leftover:             # <<<<<<<<<<<<<<
 *             self.lastchunkarr[:len(self) - nchunks * chunklen] = value[
 *                 nchunks * chunklen:]
 */
  }

  /* "bcolz/carray_ext.pyx":2261
 *             self.lastchunkarr[:len(self) - nchunks * chunklen] = value[
 *                 nchunks * chunklen:]
 *         return             # <<<<<<<<<<<<<<
 * 
 *     # This is a private function that is specific for `eval`
 */
  __Pyx_TraceLine(2261,0,__PYX_ERR(0, 2261, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2240
 *         assert (nwrow == vlen)
 * 
 *     def _set_entire_carray(self, value):             # <<<<<<<<<<<<<<
 *         """Copy the value in self chunk by chunk"""
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._set_entire_carray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nbytes);
  __Pyx_XDECREF(__pyx_v_chunklen);
  __Pyx_XDECREF(__pyx_v_nchunks);
  __Pyx_XDECREF(__pyx_v_nchunk);
  __Pyx_XDECREF(__pyx_v_cdata);
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2264
 * 
 *     # This is a private function that is specific for `eval`
 *     def _getrange(self, npy_intp start, npy_intp blen, ndarray out):             # <<<<<<<<<<<<<<
 *         cdef int chunklen
 *         cdef npy_intp startb, stopb
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_45_getrange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_44_getrange[] = "carray._getrange(self, npy_intp start, npy_intp blen, ndarray out)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_45_getrange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  npy_intp __pyx_v_start;
  npy_intp __pyx_v_blen;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_getrange (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_blen,&__pyx_n_s_out,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blen)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_getrange", 1, 3, 3, 1); __PYX_ERR(0, 2264, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_getrange", 1, 3, 3, 2); __PYX_ERR(0, 2264, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_getrange") < 0)) __PYX_ERR(0, 2264, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_start = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_start == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2264, __pyx_L3_error)
    __pyx_v_blen = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_blen == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2264, __pyx_L3_error)
    __pyx_v_out = ((PyArrayObject *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_getrange", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2264, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray._getrange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) __PYX_ERR(0, 2264, __pyx_L1_error)
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_44_getrange(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_start, __pyx_v_blen, __pyx_v_out);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_44_getrange(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, npy_intp __pyx_v_start, npy_intp __pyx_v_blen, PyArrayObject *__pyx_v_out) {
  int __pyx_v_chunklen;
  npy_intp __pyx_v_startb;
  npy_intp __pyx_v_stopb;
  npy_intp __pyx_v_nwrow;
  npy_intp __pyx_v_stop;
  npy_intp __pyx_v_cblen;
  npy_intp __pyx_v_schunk;
  npy_intp __pyx_v_echunk;
  npy_intp __pyx_v_nchunk;
  npy_intp __pyx_v_nchunks;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = 0;
  PyObject *__pyx_v_nrows = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  npy_intp __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("_getrange", 0);
  __Pyx_TraceCall("_getrange", __pyx_f[0], 2264, 0, __PYX_ERR(0, 2264, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2272
 * 
 *         # Check that we are inside limits
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)             # <<<<<<<<<<<<<<
 *         if (start + blen) > nrows:
 *             blen = nrows - start
 */
  __Pyx_TraceLine(2272,0,__PYX_ERR(0, 2272, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->atomsize))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nrows = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2273
 *         # Check that we are inside limits
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         if (start + blen) > nrows:             # <<<<<<<<<<<<<<
 *             blen = nrows - start
 * 
 */
  __Pyx_TraceLine(2273,0,__PYX_ERR(0, 2273, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_start + __pyx_v_blen)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_nrows, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2273, __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_ERR(0, 2273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2274
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         if (start + blen) > nrows:
 *             blen = nrows - start             # <<<<<<<<<<<<<<
 * 
 *         # Fill `out` from data in chunks
 */
    __Pyx_TraceLine(2274,0,__PYX_ERR(0, 2274, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_nrows, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2274, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_blen = __pyx_t_4;

    /* "bcolz/carray_ext.pyx":2273
 *         # Check that we are inside limits
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         if (start + blen) > nrows:             # <<<<<<<<<<<<<<
 *             blen = nrows - start
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":2277
 * 
 *         # Fill `out` from data in chunks
 *         nwrow = 0             # <<<<<<<<<<<<<<
 *         stop = start + blen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */
  __Pyx_TraceLine(2277,0,__PYX_ERR(0, 2277, __pyx_L1_error))
  __pyx_v_nwrow = 0;

  /* "bcolz/carray_ext.pyx":2278
 *         # Fill `out` from data in chunks
 *         nwrow = 0
 *         stop = start + blen             # <<<<<<<<<<<<<<
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         chunklen = cython.cdiv(self._chunksize, self.atomsize)
 */
  __Pyx_TraceLine(2278,0,__PYX_ERR(0, 2278, __pyx_L1_error))
  __pyx_v_stop = (__pyx_v_start + __pyx_v_blen);

  /* "bcolz/carray_ext.pyx":2279
 *         nwrow = 0
 *         stop = start + blen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         chunklen = cython.cdiv(self._chunksize, self.atomsize)
 *         schunk = <npy_intp> cython.cdiv(start, chunklen)
 */
  __Pyx_TraceLine(2279,0,__PYX_ERR(0, 2279, __pyx_L1_error))
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":2280
 *         stop = start + blen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         chunklen = cython.cdiv(self._chunksize, self.atomsize)             # <<<<<<<<<<<<<<
 *         schunk = <npy_intp> cython.cdiv(start, chunklen)
 *         echunk = <npy_intp> cython.cdiv((start + blen), chunklen)
 */
  __Pyx_TraceLine(2280,0,__PYX_ERR(0, 2280, __pyx_L1_error))
  __pyx_v_chunklen = (__pyx_v_self->_chunksize / __pyx_v_self->atomsize);

  /* "bcolz/carray_ext.pyx":2281
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         chunklen = cython.cdiv(self._chunksize, self.atomsize)
 *         schunk = <npy_intp> cython.cdiv(start, chunklen)             # <<<<<<<<<<<<<<
 *         echunk = <npy_intp> cython.cdiv((start + blen), chunklen)
 *         for nchunk from schunk <= nchunk <= echunk:
 */
  __Pyx_TraceLine(2281,0,__PYX_ERR(0, 2281, __pyx_L1_error))
  __pyx_v_schunk = ((npy_intp)(__pyx_v_start / __pyx_v_chunklen));

  /* "bcolz/carray_ext.pyx":2282
 *         chunklen = cython.cdiv(self._chunksize, self.atomsize)
 *         schunk = <npy_intp> cython.cdiv(start, chunklen)
 *         echunk = <npy_intp> cython.cdiv((start + blen), chunklen)             # <<<<<<<<<<<<<<
 *         for nchunk from schunk <= nchunk <= echunk:
 *             # Compute start & stop for each block
 */
  __Pyx_TraceLine(2282,0,__PYX_ERR(0, 2282, __pyx_L1_error))
  __pyx_v_echunk = ((npy_intp)((__pyx_v_start + __pyx_v_blen) / __pyx_v_chunklen));

  /* "bcolz/carray_ext.pyx":2283
 *         schunk = <npy_intp> cython.cdiv(start, chunklen)
 *         echunk = <npy_intp> cython.cdiv((start + blen), chunklen)
 *         for nchunk from schunk <= nchunk <= echunk:             # <<<<<<<<<<<<<<
 *             # Compute start & stop for each block
 *             startb = start % chunklen
 */
  __Pyx_TraceLine(2283,0,__PYX_ERR(0, 2283, __pyx_L1_error))
  __pyx_t_4 = __pyx_v_echunk;
  for (__pyx_v_nchunk = __pyx_v_schunk; __pyx_v_nchunk <= __pyx_t_4; __pyx_v_nchunk++) {

    /* "bcolz/carray_ext.pyx":2285
 *         for nchunk from schunk <= nchunk <= echunk:
 *             # Compute start & stop for each block
 *             startb = start % chunklen             # <<<<<<<<<<<<<<
 *             stopb = chunklen
 *             if (start + startb) + chunklen > stop:
 */
    __Pyx_TraceLine(2285,0,__PYX_ERR(0, 2285, __pyx_L1_error))
    if (unlikely(__pyx_v_chunklen == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(0, 2285, __pyx_L1_error)
    }
    __pyx_v_startb = __Pyx_mod_npy_intp(__pyx_v_start, __pyx_v_chunklen);

    /* "bcolz/carray_ext.pyx":2286
 *             # Compute start & stop for each block
 *             startb = start % chunklen
 *             stopb = chunklen             # <<<<<<<<<<<<<<
 *             if (start + startb) + chunklen > stop:
 *                 # XXX I still have to explain why this expression works
 */
    __Pyx_TraceLine(2286,0,__PYX_ERR(0, 2286, __pyx_L1_error))
    __pyx_v_stopb = __pyx_v_chunklen;

    /* "bcolz/carray_ext.pyx":2287
 *             startb = start % chunklen
 *             stopb = chunklen
 *             if (start + startb) + chunklen > stop:             # <<<<<<<<<<<<<<
 *                 # XXX I still have to explain why this expression works
 *                 # for chunklen > (start + blen)
 */
    __Pyx_TraceLine(2287,0,__PYX_ERR(0, 2287, __pyx_L1_error))
    __pyx_t_3 = ((((__pyx_v_start + __pyx_v_startb) + __pyx_v_chunklen) > __pyx_v_stop) != 0);
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":2290
 *                 # XXX I still have to explain why this expression works
 *                 # for chunklen > (start + blen)
 *                 stopb = (stop - start) + startb             # <<<<<<<<<<<<<<
 *                 # stopb can never be larger than chunklen
 *                 if stopb > chunklen:
 */
      __Pyx_TraceLine(2290,0,__PYX_ERR(0, 2290, __pyx_L1_error))
      __pyx_v_stopb = ((__pyx_v_stop - __pyx_v_start) + __pyx_v_startb);

      /* "bcolz/carray_ext.pyx":2292
 *                 stopb = (stop - start) + startb
 *                 # stopb can never be larger than chunklen
 *                 if stopb > chunklen:             # <<<<<<<<<<<<<<
 *                     stopb = chunklen
 *             cblen = stopb - startb
 */
      __Pyx_TraceLine(2292,0,__PYX_ERR(0, 2292, __pyx_L1_error))
      __pyx_t_3 = ((__pyx_v_stopb > __pyx_v_chunklen) != 0);
      if (__pyx_t_3) {

        /* "bcolz/carray_ext.pyx":2293
 *                 # stopb can never be larger than chunklen
 *                 if stopb > chunklen:
 *                     stopb = chunklen             # <<<<<<<<<<<<<<
 *             cblen = stopb - startb
 *             if cblen == 0:
 */
        __Pyx_TraceLine(2293,0,__PYX_ERR(0, 2293, __pyx_L1_error))
        __pyx_v_stopb = __pyx_v_chunklen;

        /* "bcolz/carray_ext.pyx":2292
 *                 stopb = (stop - start) + startb
 *                 # stopb can never be larger than chunklen
 *                 if stopb > chunklen:             # <<<<<<<<<<<<<<
 *                     stopb = chunklen
 *             cblen = stopb - startb
 */
      }

      /* "bcolz/carray_ext.pyx":2287
 *             startb = start % chunklen
 *             stopb = chunklen
 *             if (start + startb) + chunklen > stop:             # <<<<<<<<<<<<<<
 *                 # XXX I still have to explain why this expression works
 *                 # for chunklen > (start + blen)
 */
    }

    /* "bcolz/carray_ext.pyx":2294
 *                 if stopb > chunklen:
 *                     stopb = chunklen
 *             cblen = stopb - startb             # <<<<<<<<<<<<<<
 *             if cblen == 0:
 *                 continue
 */
    __Pyx_TraceLine(2294,0,__PYX_ERR(0, 2294, __pyx_L1_error))
    __pyx_v_cblen = (__pyx_v_stopb - __pyx_v_startb);

    /* "bcolz/carray_ext.pyx":2295
 *                     stopb = chunklen
 *             cblen = stopb - startb
 *             if cblen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Get the data chunk and assign it to result array
 */
    __Pyx_TraceLine(2295,0,__PYX_ERR(0, 2295, __pyx_L1_error))
    __pyx_t_3 = ((__pyx_v_cblen == 0) != 0);
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":2296
 *             cblen = stopb - startb
 *             if cblen == 0:
 *                 continue             # <<<<<<<<<<<<<<
 *             # Get the data chunk and assign it to result array
 *             if nchunk == nchunks and self.leftover:
 */
      __Pyx_TraceLine(2296,0,__PYX_ERR(0, 2296, __pyx_L1_error))
      goto __pyx_L4_continue;

      /* "bcolz/carray_ext.pyx":2295
 *                     stopb = chunklen
 *             cblen = stopb - startb
 *             if cblen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Get the data chunk and assign it to result array
 */
    }

    /* "bcolz/carray_ext.pyx":2298
 *                 continue
 *             # Get the data chunk and assign it to result array
 *             if nchunk == nchunks and self.leftover:             # <<<<<<<<<<<<<<
 *                 out[nwrow:nwrow + cblen] = self.lastchunkarr[startb:stopb]
 *             else:
 */
    __Pyx_TraceLine(2298,0,__PYX_ERR(0, 2298, __pyx_L1_error))
    __pyx_t_5 = ((__pyx_v_nchunk == __pyx_v_nchunks) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_3 = __pyx_t_5;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_5 = (__pyx_v_self->leftover != 0);
    __pyx_t_3 = __pyx_t_5;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":2299
 *             # Get the data chunk and assign it to result array
 *             if nchunk == nchunks and self.leftover:
 *                 out[nwrow:nwrow + cblen] = self.lastchunkarr[startb:stopb]             # <<<<<<<<<<<<<<
 *             else:
 *                 chunk_ = self.chunks[nchunk]
 */
      __Pyx_TraceLine(2299,0,__PYX_ERR(0, 2299, __pyx_L1_error))
      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_self->lastchunkarr, __pyx_v_startb, __pyx_v_stopb, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2299, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_out), __pyx_t_1, __pyx_v_nwrow, (__pyx_v_nwrow + __pyx_v_cblen), NULL, NULL, NULL, 1, 1, 1) < 0) __PYX_ERR(0, 2299, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2298
 *                 continue
 *             # Get the data chunk and assign it to result array
 *             if nchunk == nchunks and self.leftover:             # <<<<<<<<<<<<<<
 *                 out[nwrow:nwrow + cblen] = self.lastchunkarr[startb:stopb]
 *             else:
 */
      goto __pyx_L9;
    }

    /* "bcolz/carray_ext.pyx":2301
 *                 out[nwrow:nwrow + cblen] = self.lastchunkarr[startb:stopb]
 *             else:
 *                 chunk_ = self.chunks[nchunk]             # <<<<<<<<<<<<<<
 *                 chunk_._getitem(startb, stopb,
 *                                 out.data + nwrow * self.atomsize)
 */
    __Pyx_TraceLine(2301,0,__PYX_ERR(0, 2301, __pyx_L1_error))
    /*else*/ {
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->chunks, __pyx_v_nchunk, npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2301, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5bcolz_10carray_ext_chunk))))) __PYX_ERR(0, 2301, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_chunk_, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2302
 *             else:
 *                 chunk_ = self.chunks[nchunk]
 *                 chunk_._getitem(startb, stopb,             # <<<<<<<<<<<<<<
 *                                 out.data + nwrow * self.atomsize)
 *             nwrow += cblen
 */
      __Pyx_TraceLine(2302,0,__PYX_ERR(0, 2302, __pyx_L1_error))
      ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk *)__pyx_v_chunk_->__pyx_vtab)->_getitem(__pyx_v_chunk_, __pyx_v_startb, __pyx_v_stopb, (__pyx_v_out->data + (__pyx_v_nwrow * __pyx_v_self->atomsize)));
    }
    __pyx_L9:;

    /* "bcolz/carray_ext.pyx":2304
 *                 chunk_._getitem(startb, stopb,
 *                                 out.data + nwrow * self.atomsize)
 *             nwrow += cblen             # <<<<<<<<<<<<<<
 *             start += cblen
 * 
 */
    __Pyx_TraceLine(2304,0,__PYX_ERR(0, 2304, __pyx_L1_error))
    __pyx_v_nwrow = (__pyx_v_nwrow + __pyx_v_cblen);

    /* "bcolz/carray_ext.pyx":2305
 *                                 out.data + nwrow * self.atomsize)
 *             nwrow += cblen
 *             start += cblen             # <<<<<<<<<<<<<<
 * 
 *     cdef void bool_update(self, boolarr, value):
 */
    __Pyx_TraceLine(2305,0,__PYX_ERR(0, 2305, __pyx_L1_error))
    __pyx_v_start = (__pyx_v_start + __pyx_v_cblen);
    __pyx_L4_continue:;
  }

  /* "bcolz/carray_ext.pyx":2264
 * 
 *     # This is a private function that is specific for `eval`
 *     def _getrange(self, npy_intp start, npy_intp blen, ndarray out):             # <<<<<<<<<<<<<<
 *         cdef int chunklen
 *         cdef npy_intp startb, stopb
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._getrange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_XDECREF(__pyx_v_nrows);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2307
 *             start += cblen
 * 
 *     cdef void bool_update(self, boolarr, value):             # <<<<<<<<<<<<<<
 *         """Update self in positions where `boolarr` is true with `value`
 *         array."""
 */

static void __pyx_f_5bcolz_10carray_ext_6carray_bool_update(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_boolarr, PyObject *__pyx_v_value) {
  int __pyx_v_chunklen;
  npy_intp __pyx_v_startb;
  npy_intp __pyx_v_stopb;
  npy_intp __pyx_v_nchunk;
  npy_intp __pyx_v_nchunks;
  npy_intp __pyx_v_nrows;
  npy_intp __pyx_v_nwrow;
  npy_intp __pyx_v_blen;
  npy_intp __pyx_v_vlen;
  npy_intp __pyx_v_n;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = 0;
  PyObject *__pyx_v_cdata = 0;
  PyObject *__pyx_v_boolb = 0;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_lastchunkarr = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  npy_intp __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  npy_intp __pyx_t_10;
  npy_intp __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __Pyx_RefNannySetupContext("bool_update", 0);
  __Pyx_TraceCall("bool_update", __pyx_f[0], 2307, 0, __PYX_ERR(0, 2307, __pyx_L1_error));
  __Pyx_INCREF(__pyx_v_value);

  /* "bcolz/carray_ext.pyx":2317
 *         cdef object cdata, boolb
 * 
 *         vlen = boolarr.sum()  # number of true values in bool array             # <<<<<<<<<<<<<<
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,
 *                 safe=self._safe)
 */
  __Pyx_TraceLine(2317,0,__PYX_ERR(0, 2317, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_boolarr, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2317, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2317, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_vlen = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":2318
 * 
 *         vlen = boolarr.sum()  # number of true values in bool array
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,             # <<<<<<<<<<<<<<
 *                 safe=self._safe)
 * 
 */
  __Pyx_TraceLine(2318,0,__PYX_ERR(0, 2318, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2318, __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_ERR(0, 2318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
  __Pyx_INCREF(__pyx_v_self->_dtype);
  __Pyx_GIVEREF(__pyx_v_self->_dtype);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_dtype);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_vlen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arrlen, __pyx_t_5) < 0) __PYX_ERR(0, 2318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":2319
 *         vlen = boolarr.sum()  # number of true values in bool array
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,
 *                 safe=self._safe)             # <<<<<<<<<<<<<<
 * 
 *         # Fill it from data in chunks
 */
  __Pyx_TraceLine(2319,0,__PYX_ERR(0, 2319, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_safe, __pyx_v_self->_safe) < 0) __PYX_ERR(0, 2318, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":2318
 * 
 *         vlen = boolarr.sum()  # number of true values in bool array
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,             # <<<<<<<<<<<<<<
 *                 safe=self._safe)
 * 
 */
  __Pyx_TraceLine(2318,0,__PYX_ERR(0, 2318, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":2322
 * 
 *         # Fill it from data in chunks
 *         nwrow = 0             # <<<<<<<<<<<<<<
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */
  __Pyx_TraceLine(2322,0,__PYX_ERR(0, 2322, __pyx_L1_error))
  __pyx_v_nwrow = 0;

  /* "bcolz/carray_ext.pyx":2323
 *         # Fill it from data in chunks
 *         nwrow = 0
 *         chunklen = self._chunklen             # <<<<<<<<<<<<<<
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:
 */
  __Pyx_TraceLine(2323,0,__PYX_ERR(0, 2323, __pyx_L1_error))
  __pyx_t_6 = __pyx_v_self->_chunklen;
  __pyx_v_chunklen = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":2324
 *         nwrow = 0
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         if self.leftover > 0:
 *             nchunks += 1
 */
  __Pyx_TraceLine(2324,0,__PYX_ERR(0, 2324, __pyx_L1_error))
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":2325
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:             # <<<<<<<<<<<<<<
 *             nchunks += 1
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 */
  __Pyx_TraceLine(2325,0,__PYX_ERR(0, 2325, __pyx_L1_error))
  __pyx_t_7 = ((__pyx_v_self->leftover > 0) != 0);
  if (__pyx_t_7) {

    /* "bcolz/carray_ext.pyx":2326
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:
 *             nchunks += 1             # <<<<<<<<<<<<<<
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         for nchunk from 0 <= nchunk < nchunks:
 */
    __Pyx_TraceLine(2326,0,__PYX_ERR(0, 2326, __pyx_L1_error))
    __pyx_v_nchunks = (__pyx_v_nchunks + 1);

    /* "bcolz/carray_ext.pyx":2325
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:             # <<<<<<<<<<<<<<
 *             nchunks += 1
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 */
  }

  /* "bcolz/carray_ext.pyx":2327
 *         if self.leftover > 0:
 *             nchunks += 1
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)             # <<<<<<<<<<<<<<
 *         for nchunk from 0 <= nchunk < nchunks:
 *             # Compute start & stop for each block
 */
  __Pyx_TraceLine(2327,0,__PYX_ERR(0, 2327, __pyx_L1_error))
  __pyx_v_nrows = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->atomsize));

  /* "bcolz/carray_ext.pyx":2328
 *             nchunks += 1
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         for nchunk from 0 <= nchunk < nchunks:             # <<<<<<<<<<<<<<
 *             # Compute start & stop for each block
 *             startb, stopb, _ = clip_chunk(nchunk, chunklen, 0, nrows, 1)
 */
  __Pyx_TraceLine(2328,0,__PYX_ERR(0, 2328, __pyx_L1_error))
  __pyx_t_4 = __pyx_v_nchunks;
  for (__pyx_v_nchunk = 0; __pyx_v_nchunk < __pyx_t_4; __pyx_v_nchunk++) {

    /* "bcolz/carray_ext.pyx":2330
 *         for nchunk from 0 <= nchunk < nchunks:
 *             # Compute start & stop for each block
 *             startb, stopb, _ = clip_chunk(nchunk, chunklen, 0, nrows, 1)             # <<<<<<<<<<<<<<
 *             # Get boolean values for this chunk
 *             n = nchunk * chunklen
 */
    __Pyx_TraceLine(2330,0,__PYX_ERR(0, 2330, __pyx_L1_error))
    __pyx_t_5 = __pyx_f_5bcolz_10carray_ext_clip_chunk(__pyx_v_nchunk, __pyx_v_chunklen, 0, __pyx_v_nrows, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #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_ERR(0, 2330, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 2330, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2330, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_t_10 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_3); if (unlikely((__pyx_t_10 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2330, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_11 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2330, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_startb = __pyx_t_10;
    __pyx_v_stopb = __pyx_t_11;
    __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":2332
 *             startb, stopb, _ = clip_chunk(nchunk, chunklen, 0, nrows, 1)
 *             # Get boolean values for this chunk
 *             n = nchunk * chunklen             # <<<<<<<<<<<<<<
 *             boolb = boolarr[n + startb:n + stopb]
 *             blen = boolb.sum()
 */
    __Pyx_TraceLine(2332,0,__PYX_ERR(0, 2332, __pyx_L1_error))
    __pyx_v_n = (__pyx_v_nchunk * __pyx_v_chunklen);

    /* "bcolz/carray_ext.pyx":2333
 *             # Get boolean values for this chunk
 *             n = nchunk * chunklen
 *             boolb = boolarr[n + startb:n + stopb]             # <<<<<<<<<<<<<<
 *             blen = boolb.sum()
 *             if blen == 0:
 */
    __Pyx_TraceLine(2333,0,__PYX_ERR(0, 2333, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_boolarr, (__pyx_v_n + __pyx_v_startb), (__pyx_v_n + __pyx_v_stopb), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_boolb, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":2334
 *             n = nchunk * chunklen
 *             boolb = boolarr[n + startb:n + stopb]
 *             blen = boolb.sum()             # <<<<<<<<<<<<<<
 *             if blen == 0:
 *                 continue
 */
    __Pyx_TraceLine(2334,0,__PYX_ERR(0, 2334, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_boolb, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2334, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2334, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2334, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_blen = __pyx_t_11;

    /* "bcolz/carray_ext.pyx":2335
 *             boolb = boolarr[n + startb:n + stopb]
 *             blen = boolb.sum()
 *             if blen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Modify the data in chunk
 */
    __Pyx_TraceLine(2335,0,__PYX_ERR(0, 2335, __pyx_L1_error))
    __pyx_t_7 = ((__pyx_v_blen == 0) != 0);
    if (__pyx_t_7) {

      /* "bcolz/carray_ext.pyx":2336
 *             blen = boolb.sum()
 *             if blen == 0:
 *                 continue             # <<<<<<<<<<<<<<
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:
 */
      __Pyx_TraceLine(2336,0,__PYX_ERR(0, 2336, __pyx_L1_error))
      goto __pyx_L4_continue;

      /* "bcolz/carray_ext.pyx":2335
 *             boolb = boolarr[n + startb:n + stopb]
 *             blen = boolb.sum()
 *             if blen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Modify the data in chunk
 */
    }

    /* "bcolz/carray_ext.pyx":2338
 *                 continue
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:             # <<<<<<<<<<<<<<
 *                 # Update the valid part of the lastchunkarr
 *                 lastchunkarr = self.lastchunkarr[:len(boolb)]
 */
    __Pyx_TraceLine(2338,0,__PYX_ERR(0, 2338, __pyx_L1_error))
    __pyx_t_12 = ((__pyx_v_nchunk == (__pyx_v_nchunks - 1)) != 0);
    if (__pyx_t_12) {
    } else {
      __pyx_t_7 = __pyx_t_12;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->leftover != 0);
    __pyx_t_7 = __pyx_t_12;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_7) {

      /* "bcolz/carray_ext.pyx":2340
 *             if nchunk == nchunks - 1 and self.leftover:
 *                 # Update the valid part of the lastchunkarr
 *                 lastchunkarr = self.lastchunkarr[:len(boolb)]             # <<<<<<<<<<<<<<
 *                 lastchunkarr[boolb] = value[nwrow:nwrow + blen]
 *             else:
 */
      __Pyx_TraceLine(2340,0,__PYX_ERR(0, 2340, __pyx_L1_error))
      __pyx_t_13 = PyObject_Length(__pyx_v_boolb); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 2340, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_self->lastchunkarr, 0, __pyx_t_13, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_lastchunkarr, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":2341
 *                 # Update the valid part of the lastchunkarr
 *                 lastchunkarr = self.lastchunkarr[:len(boolb)]
 *                 lastchunkarr[boolb] = value[nwrow:nwrow + blen]             # <<<<<<<<<<<<<<
 *             else:
 *                 # Get the data chunk
 */
      __Pyx_TraceLine(2341,0,__PYX_ERR(0, 2341, __pyx_L1_error))
      __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_value, __pyx_v_nwrow, (__pyx_v_nwrow + __pyx_v_blen), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyObject_SetItem(__pyx_v_lastchunkarr, __pyx_v_boolb, __pyx_t_5) < 0)) __PYX_ERR(0, 2341, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":2338
 *                 continue
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:             # <<<<<<<<<<<<<<
 *                 # Update the valid part of the lastchunkarr
 *                 lastchunkarr = self.lastchunkarr[:len(boolb)]
 */
      goto __pyx_L9;
    }

    /* "bcolz/carray_ext.pyx":2344
 *             else:
 *                 # Get the data chunk
 *                 chunk_ = self.chunks[nchunk]             # <<<<<<<<<<<<<<
 *                 self._cbytes -= chunk_.cbytes
 *                 # Get all the values there
 */
    __Pyx_TraceLine(2344,0,__PYX_ERR(0, 2344, __pyx_L1_error))
    /*else*/ {
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->chunks, __pyx_v_nchunk, npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5bcolz_10carray_ext_chunk))))) __PYX_ERR(0, 2344, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_chunk_, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":2345
 *                 # Get the data chunk
 *                 chunk_ = self.chunks[nchunk]
 *                 self._cbytes -= chunk_.cbytes             # <<<<<<<<<<<<<<
 *                 # Get all the values there
 *                 cdata = chunk_[:]
 */
      __Pyx_TraceLine(2345,0,__PYX_ERR(0, 2345, __pyx_L1_error))
      __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes - __pyx_v_chunk_->cbytes);

      /* "bcolz/carray_ext.pyx":2347
 *                 self._cbytes -= chunk_.cbytes
 *                 # Get all the values there
 *                 cdata = chunk_[:]             # <<<<<<<<<<<<<<
 *                 # Overwrite it with data from value
 *                 cdata[boolb] = value[nwrow:nwrow + blen]
 */
      __Pyx_TraceLine(2347,0,__PYX_ERR(0, 2347, __pyx_L1_error))
      __pyx_t_5 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_chunk_), 0, 0, NULL, NULL, &__pyx_slice__102, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_cdata, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":2349
 *                 cdata = chunk_[:]
 *                 # Overwrite it with data from value
 *                 cdata[boolb] = value[nwrow:nwrow + blen]             # <<<<<<<<<<<<<<
 *                 # Replace the chunk
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,
 */
      __Pyx_TraceLine(2349,0,__PYX_ERR(0, 2349, __pyx_L1_error))
      __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_value, __pyx_v_nwrow, (__pyx_v_nwrow + __pyx_v_blen), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyObject_SetItem(__pyx_v_cdata, __pyx_v_boolb, __pyx_t_5) < 0)) __PYX_ERR(0, 2349, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":2351
 *                 cdata[boolb] = value[nwrow:nwrow + blen]
 *                 # Replace the chunk
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,             # <<<<<<<<<<<<<<
 *                                _memory=self._rootdir is None)
 *                 self.chunks[nchunk] = chunk_
 */
      __Pyx_TraceLine(2351,0,__PYX_ERR(0, 2351, __pyx_L1_error))
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2351, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_cdata);
      __Pyx_GIVEREF(__pyx_v_cdata);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_cdata);
      __Pyx_INCREF(__pyx_v_self->_dtype);
      __Pyx_GIVEREF(__pyx_v_self->_dtype);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->_dtype);
      __Pyx_INCREF(__pyx_v_self->_cparams);
      __Pyx_GIVEREF(__pyx_v_self->_cparams);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_cparams);

      /* "bcolz/carray_ext.pyx":2352
 *                 # Replace the chunk
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,
 *                                _memory=self._rootdir is None)             # <<<<<<<<<<<<<<
 *                 self.chunks[nchunk] = chunk_
 *                 # Update cbytes counter
 */
      __Pyx_TraceLine(2352,0,__PYX_ERR(0, 2352, __pyx_L1_error))
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = (__pyx_v_self->_rootdir == Py_None);
      __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_memory, __pyx_t_1) < 0) __PYX_ERR(0, 2352, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2351
 *                 cdata[boolb] = value[nwrow:nwrow + blen]
 *                 # Replace the chunk
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,             # <<<<<<<<<<<<<<
 *                                _memory=self._rootdir is None)
 *                 self.chunks[nchunk] = chunk_
 */
      __Pyx_TraceLine(2351,0,__PYX_ERR(0, 2351, __pyx_L1_error))
      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2351, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_chunk_, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2353
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,
 *                                _memory=self._rootdir is None)
 *                 self.chunks[nchunk] = chunk_             # <<<<<<<<<<<<<<
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes
 */
      __Pyx_TraceLine(2353,0,__PYX_ERR(0, 2353, __pyx_L1_error))
      if (unlikely(__Pyx_SetItemInt(__pyx_v_self->chunks, __pyx_v_nchunk, ((PyObject *)__pyx_v_chunk_), npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 1, 1) < 0)) __PYX_ERR(0, 2353, __pyx_L1_error)

      /* "bcolz/carray_ext.pyx":2355
 *                 self.chunks[nchunk] = chunk_
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes             # <<<<<<<<<<<<<<
 *             nwrow += blen
 * 
 */
      __Pyx_TraceLine(2355,0,__PYX_ERR(0, 2355, __pyx_L1_error))
      __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes + __pyx_v_chunk_->cbytes);
    }
    __pyx_L9:;

    /* "bcolz/carray_ext.pyx":2356
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes
 *             nwrow += blen             # <<<<<<<<<<<<<<
 * 
 *         # Safety check
 */
    __Pyx_TraceLine(2356,0,__PYX_ERR(0, 2356, __pyx_L1_error))
    __pyx_v_nwrow = (__pyx_v_nwrow + __pyx_v_blen);
    __pyx_L4_continue:;
  }

  /* "bcolz/carray_ext.pyx":2359
 * 
 *         # Safety check
 *         assert (nwrow == vlen)             # <<<<<<<<<<<<<<
 * 
 *     cdef reset_iter_sentinels(self):
 */
  __Pyx_TraceLine(2359,0,__PYX_ERR(0, 2359, __pyx_L1_error))
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_nwrow == __pyx_v_vlen) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 2359, __pyx_L1_error)
    }
  }
  #endif

  /* "bcolz/carray_ext.pyx":2307
 *             start += cblen
 * 
 *     cdef void bool_update(self, boolarr, value):             # <<<<<<<<<<<<<<
 *         """Update self in positions where `boolarr` is true with `value`
 *         array."""
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("bcolz.carray_ext.carray.bool_update", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_XDECREF(__pyx_v_cdata);
  __Pyx_XDECREF(__pyx_v_boolb);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_lastchunkarr);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
}

/* "bcolz/carray_ext.pyx":2361
 *         assert (nwrow == vlen)
 * 
 *     cdef reset_iter_sentinels(self):             # <<<<<<<<<<<<<<
 *         """Reset sentinels for iterator."""
 *         self.sss_mode = False
 */

static PyObject *__pyx_f_5bcolz_10carray_ext_6carray_reset_iter_sentinels(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2;
  __Pyx_RefNannySetupContext("reset_iter_sentinels", 0);
  __Pyx_TraceCall("reset_iter_sentinels", __pyx_f[0], 2361, 0, __PYX_ERR(0, 2361, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2363
 *     cdef reset_iter_sentinels(self):
 *         """Reset sentinels for iterator."""
 *         self.sss_mode = False             # <<<<<<<<<<<<<<
 *         self.wheretrue_mode = False
 *         self.where_mode = False
 */
  __Pyx_TraceLine(2363,0,__PYX_ERR(0, 2363, __pyx_L1_error))
  __pyx_v_self->sss_mode = 0;

  /* "bcolz/carray_ext.pyx":2364
 *         """Reset sentinels for iterator."""
 *         self.sss_mode = False
 *         self.wheretrue_mode = False             # <<<<<<<<<<<<<<
 *         self.where_mode = False
 *         self.where_arr = None
 */
  __Pyx_TraceLine(2364,0,__PYX_ERR(0, 2364, __pyx_L1_error))
  __pyx_v_self->wheretrue_mode = 0;

  /* "bcolz/carray_ext.pyx":2365
 *         self.sss_mode = False
 *         self.wheretrue_mode = False
 *         self.where_mode = False             # <<<<<<<<<<<<<<
 *         self.where_arr = None
 *         self.nhits = 0
 */
  __Pyx_TraceLine(2365,0,__PYX_ERR(0, 2365, __pyx_L1_error))
  __pyx_v_self->where_mode = 0;

  /* "bcolz/carray_ext.pyx":2366
 *         self.wheretrue_mode = False
 *         self.where_mode = False
 *         self.where_arr = None             # <<<<<<<<<<<<<<
 *         self.nhits = 0
 *         self.limit = _MAXINT
 */
  __Pyx_TraceLine(2366,0,__PYX_ERR(0, 2366, __pyx_L1_error))
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->where_arr);
  __Pyx_DECREF(__pyx_v_self->where_arr);
  __pyx_v_self->where_arr = Py_None;

  /* "bcolz/carray_ext.pyx":2367
 *         self.where_mode = False
 *         self.where_arr = None
 *         self.nhits = 0             # <<<<<<<<<<<<<<
 *         self.limit = _MAXINT
 *         self.skip = 0
 */
  __Pyx_TraceLine(2367,0,__PYX_ERR(0, 2367, __pyx_L1_error))
  __pyx_v_self->nhits = 0;

  /* "bcolz/carray_ext.pyx":2368
 *         self.where_arr = None
 *         self.nhits = 0
 *         self.limit = _MAXINT             # <<<<<<<<<<<<<<
 *         self.skip = 0
 *         self.start = 0
 */
  __Pyx_TraceLine(2368,0,__PYX_ERR(0, 2368, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MAXINT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->limit = __pyx_t_2;

  /* "bcolz/carray_ext.pyx":2369
 *         self.nhits = 0
 *         self.limit = _MAXINT
 *         self.skip = 0             # <<<<<<<<<<<<<<
 *         self.start = 0
 *         self.stop = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 */
  __Pyx_TraceLine(2369,0,__PYX_ERR(0, 2369, __pyx_L1_error))
  __pyx_v_self->skip = 0;

  /* "bcolz/carray_ext.pyx":2370
 *         self.limit = _MAXINT
 *         self.skip = 0
 *         self.start = 0             # <<<<<<<<<<<<<<
 *         self.stop = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         self.step = 1
 */
  __Pyx_TraceLine(2370,0,__PYX_ERR(0, 2370, __pyx_L1_error))
  __pyx_v_self->start = 0;

  /* "bcolz/carray_ext.pyx":2371
 *         self.skip = 0
 *         self.start = 0
 *         self.stop = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)             # <<<<<<<<<<<<<<
 *         self.step = 1
 *         self.iter_exhausted = False
 */
  __Pyx_TraceLine(2371,0,__PYX_ERR(0, 2371, __pyx_L1_error))
  __pyx_v_self->stop = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->atomsize));

  /* "bcolz/carray_ext.pyx":2372
 *         self.start = 0
 *         self.stop = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         self.step = 1             # <<<<<<<<<<<<<<
 *         self.iter_exhausted = False
 * 
 */
  __Pyx_TraceLine(2372,0,__PYX_ERR(0, 2372, __pyx_L1_error))
  __pyx_v_self->step = 1;

  /* "bcolz/carray_ext.pyx":2373
 *         self.stop = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         self.step = 1
 *         self.iter_exhausted = False             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_TraceLine(2373,0,__PYX_ERR(0, 2373, __pyx_L1_error))
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF(__pyx_v_self->iter_exhausted);
  __Pyx_DECREF(__pyx_v_self->iter_exhausted);
  __pyx_v_self->iter_exhausted = Py_False;

  /* "bcolz/carray_ext.pyx":2361
 *         assert (nwrow == vlen)
 * 
 *     cdef reset_iter_sentinels(self):             # <<<<<<<<<<<<<<
 *         """Reset sentinels for iterator."""
 *         self.sss_mode = False
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.reset_iter_sentinels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2375
 *         self.iter_exhausted = False
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         if self.iter_exhausted:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_47__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_47__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_46__iter__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_46__iter__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  npy_intp __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__iter__", 0);
  __Pyx_TraceCall("__iter__", __pyx_f[0], 2375, 0, __PYX_ERR(0, 2375, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2377
 *     def __iter__(self):
 * 
 *         if self.iter_exhausted:             # <<<<<<<<<<<<<<
 *             # Iterator is exhausted, so return immediately
 *             return self
 */
  __Pyx_TraceLine(2377,0,__PYX_ERR(0, 2377, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->iter_exhausted); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2377, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":2379
 *         if self.iter_exhausted:
 *             # Iterator is exhausted, so return immediately
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         if not (self.sss_mode or
 */
    __Pyx_TraceLine(2379,0,__PYX_ERR(0, 2379, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_r = ((PyObject *)__pyx_v_self);
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2377
 *     def __iter__(self):
 * 
 *         if self.iter_exhausted:             # <<<<<<<<<<<<<<
 *             # Iterator is exhausted, so return immediately
 *             return self
 */
  }

  /* "bcolz/carray_ext.pyx":2381
 *             return self
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  __Pyx_TraceLine(2381,0,__PYX_ERR(0, 2381, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_self->sss_mode != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }

  /* "bcolz/carray_ext.pyx":2382
 * 
 *         if not (self.sss_mode or
 *                 self.wheretrue_mode or             # <<<<<<<<<<<<<<
 *                 self.where_mode):
 *             # No mode.  Probably a direct iter() call.  Use sss_mode here.
 */
  __Pyx_TraceLine(2382,0,__PYX_ERR(0, 2382, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_self->wheretrue_mode != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }

  /* "bcolz/carray_ext.pyx":2383
 *         if not (self.sss_mode or
 *                 self.wheretrue_mode or
 *                 self.where_mode):             # <<<<<<<<<<<<<<
 *             # No mode.  Probably a direct iter() call.  Use sss_mode here.
 *             return self.iter()
 */
  __Pyx_TraceLine(2383,0,__PYX_ERR(0, 2383, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_self->where_mode != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;

  /* "bcolz/carray_ext.pyx":2381
 *             return self
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  __Pyx_TraceLine(2381,0,__PYX_ERR(0, 2381, __pyx_L1_error))
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2385
 *                 self.where_mode):
 *             # No mode.  Probably a direct iter() call.  Use sss_mode here.
 *             return self.iter()             # <<<<<<<<<<<<<<
 * 
 *         # Initialize some internal values
 */
    __Pyx_TraceLine(2385,0,__PYX_ERR(0, 2385, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_iter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2385, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2385, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2381
 *             return self
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  }

  /* "bcolz/carray_ext.pyx":2388
 * 
 *         # Initialize some internal values
 *         self.startb = 0             # <<<<<<<<<<<<<<
 *         self.nrowsread = self.start
 *         self._nrow = self.start - self.step
 */
  __Pyx_TraceLine(2388,0,__PYX_ERR(0, 2388, __pyx_L1_error))
  __pyx_v_self->startb = 0;

  /* "bcolz/carray_ext.pyx":2389
 *         # Initialize some internal values
 *         self.startb = 0
 *         self.nrowsread = self.start             # <<<<<<<<<<<<<<
 *         self._nrow = self.start - self.step
 *         self._row = -1  # a sentinel
 */
  __Pyx_TraceLine(2389,0,__PYX_ERR(0, 2389, __pyx_L1_error))
  __pyx_t_6 = __pyx_v_self->start;
  __pyx_v_self->nrowsread = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":2390
 *         self.startb = 0
 *         self.nrowsread = self.start
 *         self._nrow = self.start - self.step             # <<<<<<<<<<<<<<
 *         self._row = -1  # a sentinel
 *         if self.where_mode and isinstance(self.where_arr, carray):
 */
  __Pyx_TraceLine(2390,0,__PYX_ERR(0, 2390, __pyx_L1_error))
  __pyx_v_self->_nrow = (__pyx_v_self->start - __pyx_v_self->step);

  /* "bcolz/carray_ext.pyx":2391
 *         self.nrowsread = self.start
 *         self._nrow = self.start - self.step
 *         self._row = -1  # a sentinel             # <<<<<<<<<<<<<<
 *         if self.where_mode and isinstance(self.where_arr, carray):
 *             self.nrowsinbuf = self.where_arr.chunklen
 */
  __Pyx_TraceLine(2391,0,__PYX_ERR(0, 2391, __pyx_L1_error))
  __pyx_v_self->_row = -1;

  /* "bcolz/carray_ext.pyx":2392
 *         self._nrow = self.start - self.step
 *         self._row = -1  # a sentinel
 *         if self.where_mode and isinstance(self.where_arr, carray):             # <<<<<<<<<<<<<<
 *             self.nrowsinbuf = self.where_arr.chunklen
 *         else:
 */
  __Pyx_TraceLine(2392,0,__PYX_ERR(0, 2392, __pyx_L1_error))
  __pyx_t_1 = (__pyx_v_self->where_mode != 0);
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_3 = __pyx_v_self->where_arr;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_t_3, __pyx_ptype_5bcolz_10carray_ext_carray); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (__pyx_t_1 != 0);
  __pyx_t_2 = __pyx_t_7;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2393
 *         self._row = -1  # a sentinel
 *         if self.where_mode and isinstance(self.where_arr, carray):
 *             self.nrowsinbuf = self.where_arr.chunklen             # <<<<<<<<<<<<<<
 *         else:
 *             self.nrowsinbuf = self._chunklen
 */
    __Pyx_TraceLine(2393,0,__PYX_ERR(0, 2393, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->where_arr, __pyx_n_s_chunklen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2393, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_self->nrowsinbuf = __pyx_t_8;

    /* "bcolz/carray_ext.pyx":2392
 *         self._nrow = self.start - self.step
 *         self._row = -1  # a sentinel
 *         if self.where_mode and isinstance(self.where_arr, carray):             # <<<<<<<<<<<<<<
 *             self.nrowsinbuf = self.where_arr.chunklen
 *         else:
 */
    goto __pyx_L8;
  }

  /* "bcolz/carray_ext.pyx":2395
 *             self.nrowsinbuf = self.where_arr.chunklen
 *         else:
 *             self.nrowsinbuf = self._chunklen             # <<<<<<<<<<<<<<
 * 
 *         return self
 */
  __Pyx_TraceLine(2395,0,__PYX_ERR(0, 2395, __pyx_L1_error))
  /*else*/ {
    __pyx_t_8 = __pyx_v_self->_chunklen;
    __pyx_v_self->nrowsinbuf = __pyx_t_8;
  }
  __pyx_L8:;

  /* "bcolz/carray_ext.pyx":2397
 *             self.nrowsinbuf = self._chunklen
 * 
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def iter(self, start=0, stop=None, step=1, limit=None, skip=0, _next=False):
 */
  __Pyx_TraceLine(2397,0,__PYX_ERR(0, 2397, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2375
 *         self.iter_exhausted = False
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         if self.iter_exhausted:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2399
 *         return self
 * 
 *     def iter(self, start=0, stop=None, step=1, limit=None, skip=0, _next=False):             # <<<<<<<<<<<<<<
 *         """Iterator with `start`, `stop` and `step` bounds.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_49iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_48iter[] = "carray.iter(self, start=0, stop=None, step=1, limit=None, skip=0, _next=False)\nIterator with `start`, `stop` and `step` bounds.\n\n        Parameters\n        ----------\n        start : int\n            The starting item.\n        stop : int\n            The item after which the iterator stops.\n        step : int\n            The number of items incremented during each iteration.  Cannot be\n            negative.\n        limit : int\n            A maximum number of elements to return.  The default is return\n            everything.\n        skip : int\n            An initial number of elements to skip.  The default is 0.\n\n        Returns\n        -------\n        out : iterator\n\n        See Also\n        --------\n        where, wheretrue\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_49iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_skip = 0;
  PyObject *__pyx_v__next = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iter (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,&__pyx_n_s_limit,&__pyx_n_s_skip,&__pyx_n_s_next,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)__pyx_int_0);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_int_1);
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)__pyx_int_0);
    values[5] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_start);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_next);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iter") < 0)) __PYX_ERR(0, 2399, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
    __pyx_v_limit = values[3];
    __pyx_v_skip = values[4];
    __pyx_v__next = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("iter", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2399, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_48iter(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_limit, __pyx_v_skip, __pyx_v__next);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_48iter(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip, PyObject *__pyx_v__next) {
  PyObject *__pyx_v_cview = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("iter", 0);
  __Pyx_TraceCall("iter", __pyx_f[0], 2399, 0, __PYX_ERR(0, 2399, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2427
 *         """
 *         # Check limits
 *         if step <= 0:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("step param can only be positive")
 *         if _next:
 */
  __Pyx_TraceLine(2427,0,__PYX_ERR(0, 2427, __pyx_L1_error))
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_step, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2427, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2427, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2428
 *         # Check limits
 *         if step <= 0:
 *             raise NotImplementedError("step param can only be positive")             # <<<<<<<<<<<<<<
 *         if _next:
 *             cview = self
 */
    __Pyx_TraceLine(2428,0,__PYX_ERR(0, 2428, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2428, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2427
 *         """
 *         # Check limits
 *         if step <= 0:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("step param can only be positive")
 *         if _next:
 */
  }

  /* "bcolz/carray_ext.pyx":2429
 *         if step <= 0:
 *             raise NotImplementedError("step param can only be positive")
 *         if _next:             # <<<<<<<<<<<<<<
 *             cview = self
 *         else:
 */
  __Pyx_TraceLine(2429,0,__PYX_ERR(0, 2429, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__next); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2429, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2430
 *             raise NotImplementedError("step param can only be positive")
 *         if _next:
 *             cview = self             # <<<<<<<<<<<<<<
 *         else:
 *             cview = self.view()
 */
    __Pyx_TraceLine(2430,0,__PYX_ERR(0, 2430, __pyx_L1_error))
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_v_cview = ((PyObject *)__pyx_v_self);

    /* "bcolz/carray_ext.pyx":2429
 *         if step <= 0:
 *             raise NotImplementedError("step param can only be positive")
 *         if _next:             # <<<<<<<<<<<<<<
 *             cview = self
 *         else:
 */
    goto __pyx_L4;
  }

  /* "bcolz/carray_ext.pyx":2432
 *             cview = self
 *         else:
 *             cview = self.view()             # <<<<<<<<<<<<<<
 *         return cview._init_iter(start, stop, step, limit, skip)
 * 
 */
  __Pyx_TraceLine(2432,0,__PYX_ERR(0, 2432, __pyx_L1_error))
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2432, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2432, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_cview = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "bcolz/carray_ext.pyx":2433
 *         else:
 *             cview = self.view()
 *         return cview._init_iter(start, stop, step, limit, skip)             # <<<<<<<<<<<<<<
 * 
 *     def _init_iter(self, start, stop, step, limit, skip):
 */
  __Pyx_TraceLine(2433,0,__PYX_ERR(0, 2433, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cview, __pyx_n_s_init_iter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_start);
  __Pyx_GIVEREF(__pyx_v_start);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
  __Pyx_INCREF(__pyx_v_stop);
  __Pyx_GIVEREF(__pyx_v_stop);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
  __Pyx_INCREF(__pyx_v_step);
  __Pyx_GIVEREF(__pyx_v_step);
  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
  __Pyx_INCREF(__pyx_v_limit);
  __Pyx_GIVEREF(__pyx_v_limit);
  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_limit);
  __Pyx_INCREF(__pyx_v_skip);
  __Pyx_GIVEREF(__pyx_v_skip);
  PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_skip);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2399
 *         return self
 * 
 *     def iter(self, start=0, stop=None, step=1, limit=None, skip=0, _next=False):             # <<<<<<<<<<<<<<
 *         """Iterator with `start`, `stop` and `step` bounds.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cview);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2435
 *         return cview._init_iter(start, stop, step, limit, skip)
 * 
 *     def _init_iter(self, start, stop, step, limit, skip):             # <<<<<<<<<<<<<<
 *         self.reset_iter_sentinels()
 *         self.sss_mode = True
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_51_init_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_50_init_iter[] = "carray._init_iter(self, start, stop, step, limit, skip)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_51_init_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_skip = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_iter (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,&__pyx_n_s_limit,&__pyx_n_s_skip,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_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_iter", 1, 5, 5, 1); __PYX_ERR(0, 2435, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_iter", 1, 5, 5, 2); __PYX_ERR(0, 2435, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_iter", 1, 5, 5, 3); __PYX_ERR(0, 2435, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_iter", 1, 5, 5, 4); __PYX_ERR(0, 2435, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_iter") < 0)) __PYX_ERR(0, 2435, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      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);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
    __pyx_v_limit = values[3];
    __pyx_v_skip = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_init_iter", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2435, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray._init_iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_50_init_iter(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_limit, __pyx_v_skip);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_50_init_iter(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  npy_intp __pyx_t_7;
  npy_intp __pyx_t_8;
  npy_intp __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("_init_iter", 0);
  __Pyx_TraceCall("_init_iter", __pyx_f[0], 2435, 0, __PYX_ERR(0, 2435, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2436
 * 
 *     def _init_iter(self, start, stop, step, limit, skip):
 *         self.reset_iter_sentinels()             # <<<<<<<<<<<<<<
 *         self.sss_mode = True
 *         self.start, self.stop, self.step = \
 */
  __Pyx_TraceLine(2436,0,__PYX_ERR(0, 2436, __pyx_L1_error))
  __pyx_t_1 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_carray *)__pyx_v_self->__pyx_vtab)->reset_iter_sentinels(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2437
 *     def _init_iter(self, start, stop, step, limit, skip):
 *         self.reset_iter_sentinels()
 *         self.sss_mode = True             # <<<<<<<<<<<<<<
 *         self.start, self.stop, self.step = \
 *             slice(start, stop, step).indices(self.len)
 */
  __Pyx_TraceLine(2437,0,__PYX_ERR(0, 2437, __pyx_L1_error))
  __pyx_v_self->sss_mode = 1;

  /* "bcolz/carray_ext.pyx":2439
 *         self.sss_mode = True
 *         self.start, self.stop, self.step = \
 *             slice(start, stop, step).indices(self.len)             # <<<<<<<<<<<<<<
 *         if limit is not None:
 *             self.limit = limit + skip
 */
  __Pyx_TraceLine(2439,0,__PYX_ERR(0, 2439, __pyx_L1_error))
  __pyx_t_2 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2439, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #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_ERR(0, 2438, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 2; __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_4), 3) < 0) __PYX_ERR(0, 2438, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2438, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }

  /* "bcolz/carray_ext.pyx":2438
 *         self.reset_iter_sentinels()
 *         self.sss_mode = True
 *         self.start, self.stop, self.step = \             # <<<<<<<<<<<<<<
 *             slice(start, stop, step).indices(self.len)
 *         if limit is not None:
 */
  __Pyx_TraceLine(2438,0,__PYX_ERR(0, 2438, __pyx_L1_error))
  __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->start = __pyx_t_7;
  __pyx_v_self->stop = __pyx_t_8;
  __pyx_v_self->step = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":2440
 *         self.start, self.stop, self.step = \
 *             slice(start, stop, step).indices(self.len)
 *         if limit is not None:             # <<<<<<<<<<<<<<
 *             self.limit = limit + skip
 *         self.skip = skip
 */
  __Pyx_TraceLine(2440,0,__PYX_ERR(0, 2440, __pyx_L1_error))
  __pyx_t_10 = (__pyx_v_limit != Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "bcolz/carray_ext.pyx":2441
 *             slice(start, stop, step).indices(self.len)
 *         if limit is not None:
 *             self.limit = limit + skip             # <<<<<<<<<<<<<<
 *         self.skip = skip
 *         return iter(self)
 */
    __Pyx_TraceLine(2441,0,__PYX_ERR(0, 2441, __pyx_L1_error))
    __pyx_t_1 = PyNumber_Add(__pyx_v_limit, __pyx_v_skip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2441, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_self->limit = __pyx_t_9;

    /* "bcolz/carray_ext.pyx":2440
 *         self.start, self.stop, self.step = \
 *             slice(start, stop, step).indices(self.len)
 *         if limit is not None:             # <<<<<<<<<<<<<<
 *             self.limit = limit + skip
 *         self.skip = skip
 */
  }

  /* "bcolz/carray_ext.pyx":2442
 *         if limit is not None:
 *             self.limit = limit + skip
 *         self.skip = skip             # <<<<<<<<<<<<<<
 *         return iter(self)
 * 
 */
  __Pyx_TraceLine(2442,0,__PYX_ERR(0, 2442, __pyx_L1_error))
  __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_skip); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L1_error)
  __pyx_v_self->skip = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":2443
 *             self.limit = limit + skip
 *         self.skip = skip
 *         return iter(self)             # <<<<<<<<<<<<<<
 * 
 *     def wheretrue(self, limit=None, skip=0):
 */
  __Pyx_TraceLine(2443,0,__PYX_ERR(0, 2443, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2435
 *         return cview._init_iter(start, stop, step, limit, skip)
 * 
 *     def _init_iter(self, start, stop, step, limit, skip):             # <<<<<<<<<<<<<<
 *         self.reset_iter_sentinels()
 *         self.sss_mode = True
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._init_iter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2445
 *         return iter(self)
 * 
 *     def wheretrue(self, limit=None, skip=0):             # <<<<<<<<<<<<<<
 *         """Iterator that returns indices where this object is true.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_53wheretrue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_52wheretrue[] = "carray.wheretrue(self, limit=None, skip=0)\nIterator that returns indices where this object is true.\n\n        This is currently only useful for boolean carrays that are unidimensional.\n\n        Parameters\n        ----------\n        limit : int\n            A maximum number of elements to return.  The default is return\n            everything.\n        skip : int\n            An initial number of elements to skip.  The default is 0.\n\n        Returns\n        -------\n        out : iterator\n\n        See Also\n        --------\n        iter, where\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_53wheretrue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_skip = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wheretrue (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_limit,&__pyx_n_s_skip,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_limit);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wheretrue") < 0)) __PYX_ERR(0, 2445, __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);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_limit = values[0];
    __pyx_v_skip = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("wheretrue", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2445, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.wheretrue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_52wheretrue(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_limit, __pyx_v_skip);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_52wheretrue(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip) {
  PyObject *__pyx_v_cview = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("wheretrue", 0);
  __Pyx_TraceCall("wheretrue", __pyx_f[0], 2445, 0, __PYX_ERR(0, 2445, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2468
 *         """
 *         # Check self
 *         if self._dtype.base.type != np.bool_:             # <<<<<<<<<<<<<<
 *             raise ValueError("`self` is not an array of booleans")
 *         if self.ndim > 1:
 */
  __Pyx_TraceLine(2468,0,__PYX_ERR(0, 2468, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bool); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2469
 *         # Check self
 *         if self._dtype.base.type != np.bool_:
 *             raise ValueError("`self` is not an array of booleans")             # <<<<<<<<<<<<<<
 *         if self.ndim > 1:
 *             raise NotImplementedError("`self` is not unidimensional")
 */
    __Pyx_TraceLine(2469,0,__PYX_ERR(0, 2469, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2469, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2468
 *         """
 *         # Check self
 *         if self._dtype.base.type != np.bool_:             # <<<<<<<<<<<<<<
 *             raise ValueError("`self` is not an array of booleans")
 *         if self.ndim > 1:
 */
  }

  /* "bcolz/carray_ext.pyx":2470
 *         if self._dtype.base.type != np.bool_:
 *             raise ValueError("`self` is not an array of booleans")
 *         if self.ndim > 1:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("`self` is not unidimensional")
 *         cview = self.view()
 */
  __Pyx_TraceLine(2470,0,__PYX_ERR(0, 2470, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2470, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2470, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2471
 *             raise ValueError("`self` is not an array of booleans")
 *         if self.ndim > 1:
 *             raise NotImplementedError("`self` is not unidimensional")             # <<<<<<<<<<<<<<
 *         cview = self.view()
 *         return cview._init_wheretrue(limit, skip)
 */
    __Pyx_TraceLine(2471,0,__PYX_ERR(0, 2471, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2471, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2470
 *         if self._dtype.base.type != np.bool_:
 *             raise ValueError("`self` is not an array of booleans")
 *         if self.ndim > 1:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("`self` is not unidimensional")
 *         cview = self.view()
 */
  }

  /* "bcolz/carray_ext.pyx":2472
 *         if self.ndim > 1:
 *             raise NotImplementedError("`self` is not unidimensional")
 *         cview = self.view()             # <<<<<<<<<<<<<<
 *         return cview._init_wheretrue(limit, skip)
 * 
 */
  __Pyx_TraceLine(2472,0,__PYX_ERR(0, 2472, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_view); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2472, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2472, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cview = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":2473
 *             raise NotImplementedError("`self` is not unidimensional")
 *         cview = self.view()
 *         return cview._init_wheretrue(limit, skip)             # <<<<<<<<<<<<<<
 * 
 *     def _init_wheretrue(self, limit, skip):
 */
  __Pyx_TraceLine(2473,0,__PYX_ERR(0, 2473, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cview, __pyx_n_s_init_wheretrue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_v_limit);
  __Pyx_GIVEREF(__pyx_v_limit);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_limit);
  __Pyx_INCREF(__pyx_v_skip);
  __Pyx_GIVEREF(__pyx_v_skip);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_skip);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2445
 *         return iter(self)
 * 
 *     def wheretrue(self, limit=None, skip=0):             # <<<<<<<<<<<<<<
 *         """Iterator that returns indices where this object is true.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.wheretrue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cview);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2475
 *         return cview._init_wheretrue(limit, skip)
 * 
 *     def _init_wheretrue(self, limit, skip):             # <<<<<<<<<<<<<<
 *         self.reset_iter_sentinels()
 *         self.wheretrue_mode = True
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_55_init_wheretrue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_54_init_wheretrue[] = "carray._init_wheretrue(self, limit, skip)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_55_init_wheretrue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_skip = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_wheretrue (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_limit,&__pyx_n_s_skip,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_limit)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_wheretrue", 1, 2, 2, 1); __PYX_ERR(0, 2475, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_wheretrue") < 0)) __PYX_ERR(0, 2475, __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_limit = values[0];
    __pyx_v_skip = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_init_wheretrue", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2475, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray._init_wheretrue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_54_init_wheretrue(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_limit, __pyx_v_skip);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_54_init_wheretrue(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  npy_intp __pyx_t_4;
  __Pyx_RefNannySetupContext("_init_wheretrue", 0);
  __Pyx_TraceCall("_init_wheretrue", __pyx_f[0], 2475, 0, __PYX_ERR(0, 2475, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2476
 * 
 *     def _init_wheretrue(self, limit, skip):
 *         self.reset_iter_sentinels()             # <<<<<<<<<<<<<<
 *         self.wheretrue_mode = True
 *         if limit is not None:
 */
  __Pyx_TraceLine(2476,0,__PYX_ERR(0, 2476, __pyx_L1_error))
  __pyx_t_1 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_carray *)__pyx_v_self->__pyx_vtab)->reset_iter_sentinels(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2477
 *     def _init_wheretrue(self, limit, skip):
 *         self.reset_iter_sentinels()
 *         self.wheretrue_mode = True             # <<<<<<<<<<<<<<
 *         if limit is not None:
 *             self.limit = limit + skip
 */
  __Pyx_TraceLine(2477,0,__PYX_ERR(0, 2477, __pyx_L1_error))
  __pyx_v_self->wheretrue_mode = 1;

  /* "bcolz/carray_ext.pyx":2478
 *         self.reset_iter_sentinels()
 *         self.wheretrue_mode = True
 *         if limit is not None:             # <<<<<<<<<<<<<<
 *             self.limit = limit + skip
 *         self.skip = skip
 */
  __Pyx_TraceLine(2478,0,__PYX_ERR(0, 2478, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_limit != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2479
 *         self.wheretrue_mode = True
 *         if limit is not None:
 *             self.limit = limit + skip             # <<<<<<<<<<<<<<
 *         self.skip = skip
 *         return iter(self)
 */
    __Pyx_TraceLine(2479,0,__PYX_ERR(0, 2479, __pyx_L1_error))
    __pyx_t_1 = PyNumber_Add(__pyx_v_limit, __pyx_v_skip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2479, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_self->limit = __pyx_t_4;

    /* "bcolz/carray_ext.pyx":2478
 *         self.reset_iter_sentinels()
 *         self.wheretrue_mode = True
 *         if limit is not None:             # <<<<<<<<<<<<<<
 *             self.limit = limit + skip
 *         self.skip = skip
 */
  }

  /* "bcolz/carray_ext.pyx":2480
 *         if limit is not None:
 *             self.limit = limit + skip
 *         self.skip = skip             # <<<<<<<<<<<<<<
 *         return iter(self)
 * 
 */
  __Pyx_TraceLine(2480,0,__PYX_ERR(0, 2480, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_skip); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2480, __pyx_L1_error)
  __pyx_v_self->skip = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":2481
 *             self.limit = limit + skip
 *         self.skip = skip
 *         return iter(self)             # <<<<<<<<<<<<<<
 * 
 *     def where(self, boolarr, limit=None, skip=0):
 */
  __Pyx_TraceLine(2481,0,__PYX_ERR(0, 2481, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2475
 *         return cview._init_wheretrue(limit, skip)
 * 
 *     def _init_wheretrue(self, limit, skip):             # <<<<<<<<<<<<<<
 *         self.reset_iter_sentinels()
 *         self.wheretrue_mode = True
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._init_wheretrue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2483
 *         return iter(self)
 * 
 *     def where(self, boolarr, limit=None, skip=0):             # <<<<<<<<<<<<<<
 *         """Iterator that returns values of this object where `boolarr` is true.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_57where(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_56where[] = "carray.where(self, boolarr, limit=None, skip=0)\nIterator that returns values of this object where `boolarr` is true.\n\n        This is currently only useful for boolean carrays that are unidimensional.\n\n        Parameters\n        ----------\n        boolarr : a carray or NumPy array of boolean type\n            The boolean values.\n        limit : int\n            A maximum number of elements to return.  The default is return\n            everything.\n        skip : int\n            An initial number of elements to skip.  The default is 0.\n\n        Returns\n        -------\n        out : iterator\n\n        See Also\n        --------\n        iter, wheretrue\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_57where(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_boolarr = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_skip = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("where (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_boolarr,&__pyx_n_s_limit,&__pyx_n_s_skip,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_boolarr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "where") < 0)) __PYX_ERR(0, 2483, __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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_boolarr = values[0];
    __pyx_v_limit = values[1];
    __pyx_v_skip = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("where", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2483, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.where", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_56where(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_boolarr, __pyx_v_limit, __pyx_v_skip);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_56where(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_boolarr, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip) {
  PyObject *__pyx_v_cview = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("where", 0);
  __Pyx_TraceCall("where", __pyx_f[0], 2483, 0, __PYX_ERR(0, 2483, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2508
 *         """
 *         # Check input
 *         if self.ndim > 1:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("`self` is not unidimensional")
 *         if not hasattr(boolarr, "dtype"):
 */
  __Pyx_TraceLine(2508,0,__PYX_ERR(0, 2508, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2508, __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_ERR(0, 2508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2509
 *         # Check input
 *         if self.ndim > 1:
 *             raise NotImplementedError("`self` is not unidimensional")             # <<<<<<<<<<<<<<
 *         if not hasattr(boolarr, "dtype"):
 *             raise ValueError("`boolarr` is not an array")
 */
    __Pyx_TraceLine(2509,0,__PYX_ERR(0, 2509, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2509, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2508
 *         """
 *         # Check input
 *         if self.ndim > 1:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("`self` is not unidimensional")
 *         if not hasattr(boolarr, "dtype"):
 */
  }

  /* "bcolz/carray_ext.pyx":2510
 *         if self.ndim > 1:
 *             raise NotImplementedError("`self` is not unidimensional")
 *         if not hasattr(boolarr, "dtype"):             # <<<<<<<<<<<<<<
 *             raise ValueError("`boolarr` is not an array")
 *         if boolarr.dtype.type != np.bool_:
 */
  __Pyx_TraceLine(2510,0,__PYX_ERR(0, 2510, __pyx_L1_error))
  __pyx_t_3 = PyObject_HasAttr(__pyx_v_boolarr, __pyx_n_s_dtype); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2510, __pyx_L1_error)
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2511
 *             raise NotImplementedError("`self` is not unidimensional")
 *         if not hasattr(boolarr, "dtype"):
 *             raise ValueError("`boolarr` is not an array")             # <<<<<<<<<<<<<<
 *         if boolarr.dtype.type != np.bool_:
 *             raise ValueError("`boolarr` is not an array of booleans")
 */
    __Pyx_TraceLine(2511,0,__PYX_ERR(0, 2511, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2511, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2510
 *         if self.ndim > 1:
 *             raise NotImplementedError("`self` is not unidimensional")
 *         if not hasattr(boolarr, "dtype"):             # <<<<<<<<<<<<<<
 *             raise ValueError("`boolarr` is not an array")
 *         if boolarr.dtype.type != np.bool_:
 */
  }

  /* "bcolz/carray_ext.pyx":2512
 *         if not hasattr(boolarr, "dtype"):
 *             raise ValueError("`boolarr` is not an array")
 *         if boolarr.dtype.type != np.bool_:             # <<<<<<<<<<<<<<
 *             raise ValueError("`boolarr` is not an array of booleans")
 *         if len(boolarr) != self.len:
 */
  __Pyx_TraceLine(2512,0,__PYX_ERR(0, 2512, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_boolarr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2513
 *             raise ValueError("`boolarr` is not an array")
 *         if boolarr.dtype.type != np.bool_:
 *             raise ValueError("`boolarr` is not an array of booleans")             # <<<<<<<<<<<<<<
 *         if len(boolarr) != self.len:
 *             raise ValueError(
 */
    __Pyx_TraceLine(2513,0,__PYX_ERR(0, 2513, __pyx_L1_error))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2513, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2512
 *         if not hasattr(boolarr, "dtype"):
 *             raise ValueError("`boolarr` is not an array")
 *         if boolarr.dtype.type != np.bool_:             # <<<<<<<<<<<<<<
 *             raise ValueError("`boolarr` is not an array of booleans")
 *         if len(boolarr) != self.len:
 */
  }

  /* "bcolz/carray_ext.pyx":2514
 *         if boolarr.dtype.type != np.bool_:
 *             raise ValueError("`boolarr` is not an array of booleans")
 *         if len(boolarr) != self.len:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "`boolarr` must be of the same length than ``self``")
 */
  __Pyx_TraceLine(2514,0,__PYX_ERR(0, 2514, __pyx_L1_error))
  __pyx_t_6 = PyObject_Length(__pyx_v_boolarr); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2515
 *             raise ValueError("`boolarr` is not an array of booleans")
 *         if len(boolarr) != self.len:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "`boolarr` must be of the same length than ``self``")
 *         cview = self.view()
 */
    __Pyx_TraceLine(2515,0,__PYX_ERR(0, 2515, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2515, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":2514
 *         if boolarr.dtype.type != np.bool_:
 *             raise ValueError("`boolarr` is not an array of booleans")
 *         if len(boolarr) != self.len:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "`boolarr` must be of the same length than ``self``")
 */
  }

  /* "bcolz/carray_ext.pyx":2517
 *             raise ValueError(
 *                 "`boolarr` must be of the same length than ``self``")
 *         cview = self.view()             # <<<<<<<<<<<<<<
 *         return cview._init_where(boolarr, limit, skip)
 * 
 */
  __Pyx_TraceLine(2517,0,__PYX_ERR(0, 2517, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2517, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2517, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_cview = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2518
 *                 "`boolarr` must be of the same length than ``self``")
 *         cview = self.view()
 *         return cview._init_where(boolarr, limit, skip)             # <<<<<<<<<<<<<<
 * 
 *     def _init_where(self, boolarr, limit, skip):
 */
  __Pyx_TraceLine(2518,0,__PYX_ERR(0, 2518, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cview, __pyx_n_s_init_where); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_v_boolarr);
  __Pyx_GIVEREF(__pyx_v_boolarr);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_boolarr);
  __Pyx_INCREF(__pyx_v_limit);
  __Pyx_GIVEREF(__pyx_v_limit);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_limit);
  __Pyx_INCREF(__pyx_v_skip);
  __Pyx_GIVEREF(__pyx_v_skip);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_skip);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2483
 *         return iter(self)
 * 
 *     def where(self, boolarr, limit=None, skip=0):             # <<<<<<<<<<<<<<
 *         """Iterator that returns values of this object where `boolarr` is true.
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.where", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cview);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2520
 *         return cview._init_where(boolarr, limit, skip)
 * 
 *     def _init_where(self, boolarr, limit, skip):             # <<<<<<<<<<<<<<
 *         self.reset_iter_sentinels()
 *         self.where_mode = True
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_59_init_where(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_58_init_where[] = "carray._init_where(self, boolarr, limit, skip)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_59_init_where(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_boolarr = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_skip = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_where (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_boolarr,&__pyx_n_s_limit,&__pyx_n_s_skip,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_boolarr)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_where", 1, 3, 3, 1); __PYX_ERR(0, 2520, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_skip)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_init_where", 1, 3, 3, 2); __PYX_ERR(0, 2520, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_where") < 0)) __PYX_ERR(0, 2520, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_boolarr = values[0];
    __pyx_v_limit = values[1];
    __pyx_v_skip = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_init_where", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2520, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray._init_where", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_58_init_where(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_boolarr, __pyx_v_limit, __pyx_v_skip);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_58_init_where(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_boolarr, PyObject *__pyx_v_limit, PyObject *__pyx_v_skip) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  npy_intp __pyx_t_4;
  __Pyx_RefNannySetupContext("_init_where", 0);
  __Pyx_TraceCall("_init_where", __pyx_f[0], 2520, 0, __PYX_ERR(0, 2520, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2521
 * 
 *     def _init_where(self, boolarr, limit, skip):
 *         self.reset_iter_sentinels()             # <<<<<<<<<<<<<<
 *         self.where_mode = True
 *         self.where_arr = boolarr
 */
  __Pyx_TraceLine(2521,0,__PYX_ERR(0, 2521, __pyx_L1_error))
  __pyx_t_1 = ((struct __pyx_vtabstruct_5bcolz_10carray_ext_carray *)__pyx_v_self->__pyx_vtab)->reset_iter_sentinels(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2522
 *     def _init_where(self, boolarr, limit, skip):
 *         self.reset_iter_sentinels()
 *         self.where_mode = True             # <<<<<<<<<<<<<<
 *         self.where_arr = boolarr
 *         if limit is not None:
 */
  __Pyx_TraceLine(2522,0,__PYX_ERR(0, 2522, __pyx_L1_error))
  __pyx_v_self->where_mode = 1;

  /* "bcolz/carray_ext.pyx":2523
 *         self.reset_iter_sentinels()
 *         self.where_mode = True
 *         self.where_arr = boolarr             # <<<<<<<<<<<<<<
 *         if limit is not None:
 *             self.limit = limit + skip
 */
  __Pyx_TraceLine(2523,0,__PYX_ERR(0, 2523, __pyx_L1_error))
  __Pyx_INCREF(__pyx_v_boolarr);
  __Pyx_GIVEREF(__pyx_v_boolarr);
  __Pyx_GOTREF(__pyx_v_self->where_arr);
  __Pyx_DECREF(__pyx_v_self->where_arr);
  __pyx_v_self->where_arr = __pyx_v_boolarr;

  /* "bcolz/carray_ext.pyx":2524
 *         self.where_mode = True
 *         self.where_arr = boolarr
 *         if limit is not None:             # <<<<<<<<<<<<<<
 *             self.limit = limit + skip
 *         self.skip = skip
 */
  __Pyx_TraceLine(2524,0,__PYX_ERR(0, 2524, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_limit != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2525
 *         self.where_arr = boolarr
 *         if limit is not None:
 *             self.limit = limit + skip             # <<<<<<<<<<<<<<
 *         self.skip = skip
 *         return iter(self)
 */
    __Pyx_TraceLine(2525,0,__PYX_ERR(0, 2525, __pyx_L1_error))
    __pyx_t_1 = PyNumber_Add(__pyx_v_limit, __pyx_v_skip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2525, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_self->limit = __pyx_t_4;

    /* "bcolz/carray_ext.pyx":2524
 *         self.where_mode = True
 *         self.where_arr = boolarr
 *         if limit is not None:             # <<<<<<<<<<<<<<
 *             self.limit = limit + skip
 *         self.skip = skip
 */
  }

  /* "bcolz/carray_ext.pyx":2526
 *         if limit is not None:
 *             self.limit = limit + skip
 *         self.skip = skip             # <<<<<<<<<<<<<<
 *         return iter(self)
 * 
 */
  __Pyx_TraceLine(2526,0,__PYX_ERR(0, 2526, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_skip); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) __PYX_ERR(0, 2526, __pyx_L1_error)
  __pyx_v_self->skip = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":2527
 *             self.limit = limit + skip
 *         self.skip = skip
 *         return iter(self)             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_TraceLine(2527,0,__PYX_ERR(0, 2527, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2520
 *         return cview._init_where(boolarr, limit, skip)
 * 
 *     def _init_where(self, boolarr, limit, skip):             # <<<<<<<<<<<<<<
 *         self.reset_iter_sentinels()
 *         self.where_mode = True
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._init_where", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2529
 *         return iter(self)
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef char *vbool
 *         cdef int nhits_buf
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_61__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_61__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_60__next__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_60__next__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  char *__pyx_v_vbool;
  int __pyx_v_nhits_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  npy_intp __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__next__", 0);
  __Pyx_TraceCall("__next__", __pyx_f[0], 2529, 0, __PYX_ERR(0, 2529, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2533
 *         cdef int nhits_buf
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  __Pyx_TraceLine(2533,0,__PYX_ERR(0, 2533, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_self->sss_mode != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "bcolz/carray_ext.pyx":2534
 * 
 *         if not (self.sss_mode or
 *                 self.wheretrue_mode or             # <<<<<<<<<<<<<<
 *                 self.where_mode):
 *             # No mode.  Probably a direct call to next().  Use sss_mode here.
 */
  __Pyx_TraceLine(2534,0,__PYX_ERR(0, 2534, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_self->wheretrue_mode != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "bcolz/carray_ext.pyx":2535
 *         if not (self.sss_mode or
 *                 self.wheretrue_mode or
 *                 self.where_mode):             # <<<<<<<<<<<<<<
 *             # No mode.  Probably a direct call to next().  Use sss_mode here.
 *             self.iter(_next=True)
 */
  __Pyx_TraceLine(2535,0,__PYX_ERR(0, 2535, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_self->where_mode != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;

  /* "bcolz/carray_ext.pyx":2533
 *         cdef int nhits_buf
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  __Pyx_TraceLine(2533,0,__PYX_ERR(0, 2533, __pyx_L1_error))
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2537
 *                 self.where_mode):
 *             # No mode.  Probably a direct call to next().  Use sss_mode here.
 *             self.iter(_next=True)             # <<<<<<<<<<<<<<
 * 
 *         self.nextelement = self._nrow + self.step
 */
    __Pyx_TraceLine(2537,0,__PYX_ERR(0, 2537, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_iter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_next, Py_True) < 0) __PYX_ERR(0, 2537, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":2533
 *         cdef int nhits_buf
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  }

  /* "bcolz/carray_ext.pyx":2539
 *             self.iter(_next=True)
 * 
 *         self.nextelement = self._nrow + self.step             # <<<<<<<<<<<<<<
 *         while (self.nextelement < self.stop) and (self.nhits < self.limit):
 *             if self.nextelement >= self.nrowsread:
 */
  __Pyx_TraceLine(2539,0,__PYX_ERR(0, 2539, __pyx_L1_error))
  __pyx_v_self->nextelement = (__pyx_v_self->_nrow + __pyx_v_self->step);

  /* "bcolz/carray_ext.pyx":2540
 * 
 *         self.nextelement = self._nrow + self.step
 *         while (self.nextelement < self.stop) and (self.nhits < self.limit):             # <<<<<<<<<<<<<<
 *             if self.nextelement >= self.nrowsread:
 *                 # Skip until there is interesting information
 */
  __Pyx_TraceLine(2540,0,__PYX_ERR(0, 2540, __pyx_L1_error))
  while (1) {
    __pyx_t_1 = ((__pyx_v_self->nextelement < __pyx_v_self->stop) != 0);
    if (__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_1 = ((__pyx_v_self->nhits < __pyx_v_self->limit) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L9_bool_binop_done:;
    if (!__pyx_t_2) break;

    /* "bcolz/carray_ext.pyx":2541
 *         self.nextelement = self._nrow + self.step
 *         while (self.nextelement < self.stop) and (self.nhits < self.limit):
 *             if self.nextelement >= self.nrowsread:             # <<<<<<<<<<<<<<
 *                 # Skip until there is interesting information
 *                 while self.nextelement >= self.nrowsread + self.nrowsinbuf:
 */
    __Pyx_TraceLine(2541,0,__PYX_ERR(0, 2541, __pyx_L1_error))
    __pyx_t_2 = ((__pyx_v_self->nextelement >= __pyx_v_self->nrowsread) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2543
 *             if self.nextelement >= self.nrowsread:
 *                 # Skip until there is interesting information
 *                 while self.nextelement >= self.nrowsread + self.nrowsinbuf:             # <<<<<<<<<<<<<<
 *                     self.nrowsread += self.nrowsinbuf
 *                 # Compute the end for this iteration
 */
      __Pyx_TraceLine(2543,0,__PYX_ERR(0, 2543, __pyx_L1_error))
      while (1) {
        __pyx_t_2 = ((__pyx_v_self->nextelement >= (__pyx_v_self->nrowsread + __pyx_v_self->nrowsinbuf)) != 0);
        if (!__pyx_t_2) break;

        /* "bcolz/carray_ext.pyx":2544
 *                 # Skip until there is interesting information
 *                 while self.nextelement >= self.nrowsread + self.nrowsinbuf:
 *                     self.nrowsread += self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                 # Compute the end for this iteration
 *                 self.stopb = self.stop - self.nrowsread
 */
        __Pyx_TraceLine(2544,0,__PYX_ERR(0, 2544, __pyx_L1_error))
        __pyx_v_self->nrowsread = (__pyx_v_self->nrowsread + __pyx_v_self->nrowsinbuf);
      }

      /* "bcolz/carray_ext.pyx":2546
 *                     self.nrowsread += self.nrowsinbuf
 *                 # Compute the end for this iteration
 *                 self.stopb = self.stop - self.nrowsread             # <<<<<<<<<<<<<<
 *                 if self.stopb > self.nrowsinbuf:
 *                     self.stopb = self.nrowsinbuf
 */
      __Pyx_TraceLine(2546,0,__PYX_ERR(0, 2546, __pyx_L1_error))
      __pyx_v_self->stopb = (__pyx_v_self->stop - __pyx_v_self->nrowsread);

      /* "bcolz/carray_ext.pyx":2547
 *                 # Compute the end for this iteration
 *                 self.stopb = self.stop - self.nrowsread
 *                 if self.stopb > self.nrowsinbuf:             # <<<<<<<<<<<<<<
 *                     self.stopb = self.nrowsinbuf
 *                 self._row = self.startb - self.step
 */
      __Pyx_TraceLine(2547,0,__PYX_ERR(0, 2547, __pyx_L1_error))
      __pyx_t_2 = ((__pyx_v_self->stopb > __pyx_v_self->nrowsinbuf) != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2548
 *                 self.stopb = self.stop - self.nrowsread
 *                 if self.stopb > self.nrowsinbuf:
 *                     self.stopb = self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                 self._row = self.startb - self.step
 * 
 */
        __Pyx_TraceLine(2548,0,__PYX_ERR(0, 2548, __pyx_L1_error))
        __pyx_t_6 = __pyx_v_self->nrowsinbuf;
        __pyx_v_self->stopb = __pyx_t_6;

        /* "bcolz/carray_ext.pyx":2547
 *                 # Compute the end for this iteration
 *                 self.stopb = self.stop - self.nrowsread
 *                 if self.stopb > self.nrowsinbuf:             # <<<<<<<<<<<<<<
 *                     self.stopb = self.nrowsinbuf
 *                 self._row = self.startb - self.step
 */
      }

      /* "bcolz/carray_ext.pyx":2549
 *                 if self.stopb > self.nrowsinbuf:
 *                     self.stopb = self.nrowsinbuf
 *                 self._row = self.startb - self.step             # <<<<<<<<<<<<<<
 * 
 *                 # Skip chunks with zeros if in wheretrue_mode
 */
      __Pyx_TraceLine(2549,0,__PYX_ERR(0, 2549, __pyx_L1_error))
      __pyx_v_self->_row = (__pyx_v_self->startb - __pyx_v_self->step);

      /* "bcolz/carray_ext.pyx":2552
 * 
 *                 # Skip chunks with zeros if in wheretrue_mode
 *                 if self.wheretrue_mode and self.check_zeros(self):             # <<<<<<<<<<<<<<
 *                     self.nrowsread += self.nrowsinbuf
 *                     self.nextelement += self.nrowsinbuf
 */
      __Pyx_TraceLine(2552,0,__PYX_ERR(0, 2552, __pyx_L1_error))
      __pyx_t_1 = (__pyx_v_self->wheretrue_mode != 0);
      if (__pyx_t_1) {
      } else {
        __pyx_t_2 = __pyx_t_1;
        goto __pyx_L16_bool_binop_done;
      }
      __pyx_t_1 = (((struct __pyx_vtabstruct_5bcolz_10carray_ext_carray *)__pyx_v_self->__pyx_vtab)->check_zeros(__pyx_v_self, ((PyObject *)__pyx_v_self)) != 0);
      __pyx_t_2 = __pyx_t_1;
      __pyx_L16_bool_binop_done:;
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2553
 *                 # Skip chunks with zeros if in wheretrue_mode
 *                 if self.wheretrue_mode and self.check_zeros(self):
 *                     self.nrowsread += self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                     self.nextelement += self.nrowsinbuf
 *                     continue
 */
        __Pyx_TraceLine(2553,0,__PYX_ERR(0, 2553, __pyx_L1_error))
        __pyx_v_self->nrowsread = (__pyx_v_self->nrowsread + __pyx_v_self->nrowsinbuf);

        /* "bcolz/carray_ext.pyx":2554
 *                 if self.wheretrue_mode and self.check_zeros(self):
 *                     self.nrowsread += self.nrowsinbuf
 *                     self.nextelement += self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
        __Pyx_TraceLine(2554,0,__PYX_ERR(0, 2554, __pyx_L1_error))
        __pyx_v_self->nextelement = (__pyx_v_self->nextelement + __pyx_v_self->nrowsinbuf);

        /* "bcolz/carray_ext.pyx":2555
 *                     self.nrowsread += self.nrowsinbuf
 *                     self.nextelement += self.nrowsinbuf
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 if self.where_mode:
 */
        __Pyx_TraceLine(2555,0,__PYX_ERR(0, 2555, __pyx_L1_error))
        goto __pyx_L7_continue;

        /* "bcolz/carray_ext.pyx":2552
 * 
 *                 # Skip chunks with zeros if in wheretrue_mode
 *                 if self.wheretrue_mode and self.check_zeros(self):             # <<<<<<<<<<<<<<
 *                     self.nrowsread += self.nrowsinbuf
 *                     self.nextelement += self.nrowsinbuf
 */
      }

      /* "bcolz/carray_ext.pyx":2557
 *                     continue
 * 
 *                 if self.where_mode:             # <<<<<<<<<<<<<<
 *                     # Skip chunks with zeros in where_arr
 *                     if self.check_zeros(self.where_arr):
 */
      __Pyx_TraceLine(2557,0,__PYX_ERR(0, 2557, __pyx_L1_error))
      __pyx_t_2 = (__pyx_v_self->where_mode != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2559
 *                 if self.where_mode:
 *                     # Skip chunks with zeros in where_arr
 *                     if self.check_zeros(self.where_arr):             # <<<<<<<<<<<<<<
 *                         self.nrowsread += self.nrowsinbuf
 *                         self.nextelement += self.nrowsinbuf
 */
        __Pyx_TraceLine(2559,0,__PYX_ERR(0, 2559, __pyx_L1_error))
        __pyx_t_5 = __pyx_v_self->where_arr;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_2 = (((struct __pyx_vtabstruct_5bcolz_10carray_ext_carray *)__pyx_v_self->__pyx_vtab)->check_zeros(__pyx_v_self, __pyx_t_5) != 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_2) {

          /* "bcolz/carray_ext.pyx":2560
 *                     # Skip chunks with zeros in where_arr
 *                     if self.check_zeros(self.where_arr):
 *                         self.nrowsread += self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                         self.nextelement += self.nrowsinbuf
 *                         continue
 */
          __Pyx_TraceLine(2560,0,__PYX_ERR(0, 2560, __pyx_L1_error))
          __pyx_v_self->nrowsread = (__pyx_v_self->nrowsread + __pyx_v_self->nrowsinbuf);

          /* "bcolz/carray_ext.pyx":2561
 *                     if self.check_zeros(self.where_arr):
 *                         self.nrowsread += self.nrowsinbuf
 *                         self.nextelement += self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                         continue
 *                     # Read a chunk of the boolean array
 */
          __Pyx_TraceLine(2561,0,__PYX_ERR(0, 2561, __pyx_L1_error))
          __pyx_v_self->nextelement = (__pyx_v_self->nextelement + __pyx_v_self->nrowsinbuf);

          /* "bcolz/carray_ext.pyx":2562
 *                         self.nrowsread += self.nrowsinbuf
 *                         self.nextelement += self.nrowsinbuf
 *                         continue             # <<<<<<<<<<<<<<
 *                     # Read a chunk of the boolean array
 *                     self.where_buf = self.where_arr[
 */
          __Pyx_TraceLine(2562,0,__PYX_ERR(0, 2562, __pyx_L1_error))
          goto __pyx_L7_continue;

          /* "bcolz/carray_ext.pyx":2559
 *                 if self.where_mode:
 *                     # Skip chunks with zeros in where_arr
 *                     if self.check_zeros(self.where_arr):             # <<<<<<<<<<<<<<
 *                         self.nrowsread += self.nrowsinbuf
 *                         self.nextelement += self.nrowsinbuf
 */
        }

        /* "bcolz/carray_ext.pyx":2564
 *                         continue
 *                     # Read a chunk of the boolean array
 *                     self.where_buf = self.where_arr[             # <<<<<<<<<<<<<<
 *                                      self.nrowsread:self.nrowsread + self.nrowsinbuf]
 * 
 */
        __Pyx_TraceLine(2564,0,__PYX_ERR(0, 2564, __pyx_L1_error))
        __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_self->where_arr, __pyx_v_self->nrowsread, (__pyx_v_self->nrowsread + __pyx_v_self->nrowsinbuf), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2564, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2564, __pyx_L1_error)
        __Pyx_GIVEREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_v_self->where_buf);
        __Pyx_DECREF(((PyObject *)__pyx_v_self->where_buf));
        __pyx_v_self->where_buf = ((PyArrayObject *)__pyx_t_5);
        __pyx_t_5 = 0;

        /* "bcolz/carray_ext.pyx":2557
 *                     continue
 * 
 *                 if self.where_mode:             # <<<<<<<<<<<<<<
 *                     # Skip chunks with zeros in where_arr
 *                     if self.check_zeros(self.where_arr):
 */
      }

      /* "bcolz/carray_ext.pyx":2568
 * 
 *                 # Read a data chunk
 *                 self.iobuf = self[             # <<<<<<<<<<<<<<
 *                              self.nrowsread:self.nrowsread + self.nrowsinbuf]
 *                 self.nrowsread += self.nrowsinbuf
 */
      __Pyx_TraceLine(2568,0,__PYX_ERR(0, 2568, __pyx_L1_error))
      __pyx_t_5 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), __pyx_v_self->nrowsread, (__pyx_v_self->nrowsread + __pyx_v_self->nrowsinbuf), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2568, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->iobuf);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->iobuf));
      __pyx_v_self->iobuf = ((PyArrayObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":2570
 *                 self.iobuf = self[
 *                              self.nrowsread:self.nrowsread + self.nrowsinbuf]
 *                 self.nrowsread += self.nrowsinbuf             # <<<<<<<<<<<<<<
 * 
 *                 # Check if we can skip this buffer
 */
      __Pyx_TraceLine(2570,0,__PYX_ERR(0, 2570, __pyx_L1_error))
      __pyx_v_self->nrowsread = (__pyx_v_self->nrowsread + __pyx_v_self->nrowsinbuf);

      /* "bcolz/carray_ext.pyx":2573
 * 
 *                 # Check if we can skip this buffer
 *                 if (self.wheretrue_mode or self.where_mode) and self.skip > 0:             # <<<<<<<<<<<<<<
 *                     if self.wheretrue_mode:
 *                         nhits_buf = self.iobuf.sum()
 */
      __Pyx_TraceLine(2573,0,__PYX_ERR(0, 2573, __pyx_L1_error))
      __pyx_t_1 = (__pyx_v_self->wheretrue_mode != 0);
      if (!__pyx_t_1) {
      } else {
        goto __pyx_L22_next_and;
      }
      __pyx_t_1 = (__pyx_v_self->where_mode != 0);
      if (__pyx_t_1) {
      } else {
        __pyx_t_2 = __pyx_t_1;
        goto __pyx_L21_bool_binop_done;
      }
      __pyx_L22_next_and:;
      __pyx_t_1 = ((__pyx_v_self->skip > 0) != 0);
      __pyx_t_2 = __pyx_t_1;
      __pyx_L21_bool_binop_done:;
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2574
 *                 # Check if we can skip this buffer
 *                 if (self.wheretrue_mode or self.where_mode) and self.skip > 0:
 *                     if self.wheretrue_mode:             # <<<<<<<<<<<<<<
 *                         nhits_buf = self.iobuf.sum()
 *                     else:
 */
        __Pyx_TraceLine(2574,0,__PYX_ERR(0, 2574, __pyx_L1_error))
        __pyx_t_2 = (__pyx_v_self->wheretrue_mode != 0);
        if (__pyx_t_2) {

          /* "bcolz/carray_ext.pyx":2575
 *                 if (self.wheretrue_mode or self.where_mode) and self.skip > 0:
 *                     if self.wheretrue_mode:
 *                         nhits_buf = self.iobuf.sum()             # <<<<<<<<<<<<<<
 *                     else:
 *                         nhits_buf = self.where_buf.sum()
 */
          __Pyx_TraceLine(2575,0,__PYX_ERR(0, 2575, __pyx_L1_error))
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iobuf), __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2575, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
            }
          }
          if (__pyx_t_3) {
            __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2575, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          } else {
            __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2575, __pyx_L1_error)
          }
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2575, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_v_nhits_buf = __pyx_t_6;

          /* "bcolz/carray_ext.pyx":2574
 *                 # Check if we can skip this buffer
 *                 if (self.wheretrue_mode or self.where_mode) and self.skip > 0:
 *                     if self.wheretrue_mode:             # <<<<<<<<<<<<<<
 *                         nhits_buf = self.iobuf.sum()
 *                     else:
 */
          goto __pyx_L24;
        }

        /* "bcolz/carray_ext.pyx":2577
 *                         nhits_buf = self.iobuf.sum()
 *                     else:
 *                         nhits_buf = self.where_buf.sum()             # <<<<<<<<<<<<<<
 *                     if (self.nhits + nhits_buf) < self.skip:
 *                         self.nhits += nhits_buf
 */
        __Pyx_TraceLine(2577,0,__PYX_ERR(0, 2577, __pyx_L1_error))
        /*else*/ {
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->where_buf), __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2577, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_3)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
            }
          }
          if (__pyx_t_3) {
            __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2577, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          } else {
            __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2577, __pyx_L1_error)
          }
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2577, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_v_nhits_buf = __pyx_t_6;
        }
        __pyx_L24:;

        /* "bcolz/carray_ext.pyx":2578
 *                     else:
 *                         nhits_buf = self.where_buf.sum()
 *                     if (self.nhits + nhits_buf) < self.skip:             # <<<<<<<<<<<<<<
 *                         self.nhits += nhits_buf
 *                         self.nextelement += self.nrowsinbuf
 */
        __Pyx_TraceLine(2578,0,__PYX_ERR(0, 2578, __pyx_L1_error))
        __pyx_t_2 = (((__pyx_v_self->nhits + __pyx_v_nhits_buf) < __pyx_v_self->skip) != 0);
        if (__pyx_t_2) {

          /* "bcolz/carray_ext.pyx":2579
 *                         nhits_buf = self.where_buf.sum()
 *                     if (self.nhits + nhits_buf) < self.skip:
 *                         self.nhits += nhits_buf             # <<<<<<<<<<<<<<
 *                         self.nextelement += self.nrowsinbuf
 *                         continue
 */
          __Pyx_TraceLine(2579,0,__PYX_ERR(0, 2579, __pyx_L1_error))
          __pyx_v_self->nhits = (__pyx_v_self->nhits + __pyx_v_nhits_buf);

          /* "bcolz/carray_ext.pyx":2580
 *                     if (self.nhits + nhits_buf) < self.skip:
 *                         self.nhits += nhits_buf
 *                         self.nextelement += self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                         continue
 * 
 */
          __Pyx_TraceLine(2580,0,__PYX_ERR(0, 2580, __pyx_L1_error))
          __pyx_v_self->nextelement = (__pyx_v_self->nextelement + __pyx_v_self->nrowsinbuf);

          /* "bcolz/carray_ext.pyx":2581
 *                         self.nhits += nhits_buf
 *                         self.nextelement += self.nrowsinbuf
 *                         continue             # <<<<<<<<<<<<<<
 * 
 *             self._row += self.step
 */
          __Pyx_TraceLine(2581,0,__PYX_ERR(0, 2581, __pyx_L1_error))
          goto __pyx_L7_continue;

          /* "bcolz/carray_ext.pyx":2578
 *                     else:
 *                         nhits_buf = self.where_buf.sum()
 *                     if (self.nhits + nhits_buf) < self.skip:             # <<<<<<<<<<<<<<
 *                         self.nhits += nhits_buf
 *                         self.nextelement += self.nrowsinbuf
 */
        }

        /* "bcolz/carray_ext.pyx":2573
 * 
 *                 # Check if we can skip this buffer
 *                 if (self.wheretrue_mode or self.where_mode) and self.skip > 0:             # <<<<<<<<<<<<<<
 *                     if self.wheretrue_mode:
 *                         nhits_buf = self.iobuf.sum()
 */
      }

      /* "bcolz/carray_ext.pyx":2541
 *         self.nextelement = self._nrow + self.step
 *         while (self.nextelement < self.stop) and (self.nhits < self.limit):
 *             if self.nextelement >= self.nrowsread:             # <<<<<<<<<<<<<<
 *                 # Skip until there is interesting information
 *                 while self.nextelement >= self.nrowsread + self.nrowsinbuf:
 */
    }

    /* "bcolz/carray_ext.pyx":2583
 *                         continue
 * 
 *             self._row += self.step             # <<<<<<<<<<<<<<
 *             self._nrow = self.nextelement
 *             if self._row + self.step >= self.stopb:
 */
    __Pyx_TraceLine(2583,0,__PYX_ERR(0, 2583, __pyx_L1_error))
    __pyx_v_self->_row = (__pyx_v_self->_row + __pyx_v_self->step);

    /* "bcolz/carray_ext.pyx":2584
 * 
 *             self._row += self.step
 *             self._nrow = self.nextelement             # <<<<<<<<<<<<<<
 *             if self._row + self.step >= self.stopb:
 *                 # Compute the start row for the next buffer
 */
    __Pyx_TraceLine(2584,0,__PYX_ERR(0, 2584, __pyx_L1_error))
    __pyx_t_7 = __pyx_v_self->nextelement;
    __pyx_v_self->_nrow = __pyx_t_7;

    /* "bcolz/carray_ext.pyx":2585
 *             self._row += self.step
 *             self._nrow = self.nextelement
 *             if self._row + self.step >= self.stopb:             # <<<<<<<<<<<<<<
 *                 # Compute the start row for the next buffer
 *                 self.startb = (self._row + self.step) % self.nrowsinbuf
 */
    __Pyx_TraceLine(2585,0,__PYX_ERR(0, 2585, __pyx_L1_error))
    __pyx_t_2 = (((__pyx_v_self->_row + __pyx_v_self->step) >= __pyx_v_self->stopb) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2587
 *             if self._row + self.step >= self.stopb:
 *                 # Compute the start row for the next buffer
 *                 self.startb = (self._row + self.step) % self.nrowsinbuf             # <<<<<<<<<<<<<<
 *             self.nextelement = self._nrow + self.step
 * 
 */
      __Pyx_TraceLine(2587,0,__PYX_ERR(0, 2587, __pyx_L1_error))
      __pyx_t_7 = (__pyx_v_self->_row + __pyx_v_self->step);
      if (unlikely(__pyx_v_self->nrowsinbuf == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        __PYX_ERR(0, 2587, __pyx_L1_error)
      }
      __pyx_v_self->startb = __Pyx_mod_npy_intp(__pyx_t_7, __pyx_v_self->nrowsinbuf);

      /* "bcolz/carray_ext.pyx":2585
 *             self._row += self.step
 *             self._nrow = self.nextelement
 *             if self._row + self.step >= self.stopb:             # <<<<<<<<<<<<<<
 *                 # Compute the start row for the next buffer
 *                 self.startb = (self._row + self.step) % self.nrowsinbuf
 */
    }

    /* "bcolz/carray_ext.pyx":2588
 *                 # Compute the start row for the next buffer
 *                 self.startb = (self._row + self.step) % self.nrowsinbuf
 *             self.nextelement = self._nrow + self.step             # <<<<<<<<<<<<<<
 * 
 *             # Return a value depending on the mode we are
 */
    __Pyx_TraceLine(2588,0,__PYX_ERR(0, 2588, __pyx_L1_error))
    __pyx_v_self->nextelement = (__pyx_v_self->_nrow + __pyx_v_self->step);

    /* "bcolz/carray_ext.pyx":2591
 * 
 *             # Return a value depending on the mode we are
 *             if self.wheretrue_mode:             # <<<<<<<<<<<<<<
 *                 vbool = <char *> (self.iobuf.data + self._row)
 *                 if vbool[0]:
 */
    __Pyx_TraceLine(2591,0,__PYX_ERR(0, 2591, __pyx_L1_error))
    __pyx_t_2 = (__pyx_v_self->wheretrue_mode != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2592
 *             # Return a value depending on the mode we are
 *             if self.wheretrue_mode:
 *                 vbool = <char *> (self.iobuf.data + self._row)             # <<<<<<<<<<<<<<
 *                 if vbool[0]:
 *                     self.nhits += 1
 */
      __Pyx_TraceLine(2592,0,__PYX_ERR(0, 2592, __pyx_L1_error))
      __pyx_v_vbool = ((char *)(__pyx_v_self->iobuf->data + __pyx_v_self->_row));

      /* "bcolz/carray_ext.pyx":2593
 *             if self.wheretrue_mode:
 *                 vbool = <char *> (self.iobuf.data + self._row)
 *                 if vbool[0]:             # <<<<<<<<<<<<<<
 *                     self.nhits += 1
 *                     if self.nhits <= self.skip:
 */
      __Pyx_TraceLine(2593,0,__PYX_ERR(0, 2593, __pyx_L1_error))
      __pyx_t_2 = ((__pyx_v_vbool[0]) != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2594
 *                 vbool = <char *> (self.iobuf.data + self._row)
 *                 if vbool[0]:
 *                     self.nhits += 1             # <<<<<<<<<<<<<<
 *                     if self.nhits <= self.skip:
 *                         continue
 */
        __Pyx_TraceLine(2594,0,__PYX_ERR(0, 2594, __pyx_L1_error))
        __pyx_v_self->nhits = (__pyx_v_self->nhits + 1);

        /* "bcolz/carray_ext.pyx":2595
 *                 if vbool[0]:
 *                     self.nhits += 1
 *                     if self.nhits <= self.skip:             # <<<<<<<<<<<<<<
 *                         continue
 *                     return self._nrow
 */
        __Pyx_TraceLine(2595,0,__PYX_ERR(0, 2595, __pyx_L1_error))
        __pyx_t_2 = ((__pyx_v_self->nhits <= __pyx_v_self->skip) != 0);
        if (__pyx_t_2) {

          /* "bcolz/carray_ext.pyx":2596
 *                     self.nhits += 1
 *                     if self.nhits <= self.skip:
 *                         continue             # <<<<<<<<<<<<<<
 *                     return self._nrow
 *                 else:
 */
          __Pyx_TraceLine(2596,0,__PYX_ERR(0, 2596, __pyx_L1_error))
          goto __pyx_L7_continue;

          /* "bcolz/carray_ext.pyx":2595
 *                 if vbool[0]:
 *                     self.nhits += 1
 *                     if self.nhits <= self.skip:             # <<<<<<<<<<<<<<
 *                         continue
 *                     return self._nrow
 */
        }

        /* "bcolz/carray_ext.pyx":2597
 *                     if self.nhits <= self.skip:
 *                         continue
 *                     return self._nrow             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
        __Pyx_TraceLine(2597,0,__PYX_ERR(0, 2597, __pyx_L1_error))
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_nrow); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2597, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;

        /* "bcolz/carray_ext.pyx":2593
 *             if self.wheretrue_mode:
 *                 vbool = <char *> (self.iobuf.data + self._row)
 *                 if vbool[0]:             # <<<<<<<<<<<<<<
 *                     self.nhits += 1
 *                     if self.nhits <= self.skip:
 */
      }

      /* "bcolz/carray_ext.pyx":2599
 *                     return self._nrow
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 *             if self.where_mode:
 *                 vbool = <char *> (self.where_buf.data + self._row)
 */
      __Pyx_TraceLine(2599,0,__PYX_ERR(0, 2599, __pyx_L1_error))
      /*else*/ {
        goto __pyx_L7_continue;
      }

      /* "bcolz/carray_ext.pyx":2591
 * 
 *             # Return a value depending on the mode we are
 *             if self.wheretrue_mode:             # <<<<<<<<<<<<<<
 *                 vbool = <char *> (self.iobuf.data + self._row)
 *                 if vbool[0]:
 */
    }

    /* "bcolz/carray_ext.pyx":2600
 *                 else:
 *                     continue
 *             if self.where_mode:             # <<<<<<<<<<<<<<
 *                 vbool = <char *> (self.where_buf.data + self._row)
 *                 if not vbool[0]:
 */
    __Pyx_TraceLine(2600,0,__PYX_ERR(0, 2600, __pyx_L1_error))
    __pyx_t_2 = (__pyx_v_self->where_mode != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2601
 *                     continue
 *             if self.where_mode:
 *                 vbool = <char *> (self.where_buf.data + self._row)             # <<<<<<<<<<<<<<
 *                 if not vbool[0]:
 *                     continue
 */
      __Pyx_TraceLine(2601,0,__PYX_ERR(0, 2601, __pyx_L1_error))
      __pyx_v_vbool = ((char *)(__pyx_v_self->where_buf->data + __pyx_v_self->_row));

      /* "bcolz/carray_ext.pyx":2602
 *             if self.where_mode:
 *                 vbool = <char *> (self.where_buf.data + self._row)
 *                 if not vbool[0]:             # <<<<<<<<<<<<<<
 *                     continue
 *             self.nhits += 1
 */
      __Pyx_TraceLine(2602,0,__PYX_ERR(0, 2602, __pyx_L1_error))
      __pyx_t_2 = ((!((__pyx_v_vbool[0]) != 0)) != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2603
 *                 vbool = <char *> (self.where_buf.data + self._row)
 *                 if not vbool[0]:
 *                     continue             # <<<<<<<<<<<<<<
 *             self.nhits += 1
 *             if self.nhits <= self.skip:
 */
        __Pyx_TraceLine(2603,0,__PYX_ERR(0, 2603, __pyx_L1_error))
        goto __pyx_L7_continue;

        /* "bcolz/carray_ext.pyx":2602
 *             if self.where_mode:
 *                 vbool = <char *> (self.where_buf.data + self._row)
 *                 if not vbool[0]:             # <<<<<<<<<<<<<<
 *                     continue
 *             self.nhits += 1
 */
      }

      /* "bcolz/carray_ext.pyx":2600
 *                 else:
 *                     continue
 *             if self.where_mode:             # <<<<<<<<<<<<<<
 *                 vbool = <char *> (self.where_buf.data + self._row)
 *                 if not vbool[0]:
 */
    }

    /* "bcolz/carray_ext.pyx":2604
 *                 if not vbool[0]:
 *                     continue
 *             self.nhits += 1             # <<<<<<<<<<<<<<
 *             if self.nhits <= self.skip:
 *                 continue
 */
    __Pyx_TraceLine(2604,0,__PYX_ERR(0, 2604, __pyx_L1_error))
    __pyx_v_self->nhits = (__pyx_v_self->nhits + 1);

    /* "bcolz/carray_ext.pyx":2605
 *                     continue
 *             self.nhits += 1
 *             if self.nhits <= self.skip:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Return the current value in I/O buffer
 */
    __Pyx_TraceLine(2605,0,__PYX_ERR(0, 2605, __pyx_L1_error))
    __pyx_t_2 = ((__pyx_v_self->nhits <= __pyx_v_self->skip) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2606
 *             self.nhits += 1
 *             if self.nhits <= self.skip:
 *                 continue             # <<<<<<<<<<<<<<
 *             # Return the current value in I/O buffer
 *             if self.itemsize == self.atomsize:
 */
      __Pyx_TraceLine(2606,0,__PYX_ERR(0, 2606, __pyx_L1_error))
      goto __pyx_L7_continue;

      /* "bcolz/carray_ext.pyx":2605
 *                     continue
 *             self.nhits += 1
 *             if self.nhits <= self.skip:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Return the current value in I/O buffer
 */
    }

    /* "bcolz/carray_ext.pyx":2608
 *                 continue
 *             # Return the current value in I/O buffer
 *             if self.itemsize == self.atomsize:             # <<<<<<<<<<<<<<
 *                 return PyArray_GETITEM(
 *                     self.iobuf, self.iobuf.data + self._row * self.atomsize)
 */
    __Pyx_TraceLine(2608,0,__PYX_ERR(0, 2608, __pyx_L1_error))
    __pyx_t_2 = ((__pyx_v_self->itemsize == __pyx_v_self->atomsize) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2609
 *             # Return the current value in I/O buffer
 *             if self.itemsize == self.atomsize:
 *                 return PyArray_GETITEM(             # <<<<<<<<<<<<<<
 *                     self.iobuf, self.iobuf.data + self._row * self.atomsize)
 *             else:
 */
      __Pyx_TraceLine(2609,0,__PYX_ERR(0, 2609, __pyx_L1_error))
      __Pyx_XDECREF(__pyx_r);

      /* "bcolz/carray_ext.pyx":2610
 *             if self.itemsize == self.atomsize:
 *                 return PyArray_GETITEM(
 *                     self.iobuf, self.iobuf.data + self._row * self.atomsize)             # <<<<<<<<<<<<<<
 *             else:
 *                 return self.iobuf[self._row]
 */
      __Pyx_TraceLine(2610,0,__PYX_ERR(0, 2610, __pyx_L1_error))
      __pyx_t_5 = ((PyObject *)__pyx_v_self->iobuf);
      __Pyx_INCREF(__pyx_t_5);

      /* "bcolz/carray_ext.pyx":2609
 *             # Return the current value in I/O buffer
 *             if self.itemsize == self.atomsize:
 *                 return PyArray_GETITEM(             # <<<<<<<<<<<<<<
 *                     self.iobuf, self.iobuf.data + self._row * self.atomsize)
 *             else:
 */
      __Pyx_TraceLine(2609,0,__PYX_ERR(0, 2609, __pyx_L1_error))
      __pyx_t_4 = PyArray_GETITEM(((PyArrayObject *)__pyx_t_5), (__pyx_v_self->iobuf->data + (__pyx_v_self->_row * __pyx_v_self->atomsize))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":2608
 *                 continue
 *             # Return the current value in I/O buffer
 *             if self.itemsize == self.atomsize:             # <<<<<<<<<<<<<<
 *                 return PyArray_GETITEM(
 *                     self.iobuf, self.iobuf.data + self._row * self.atomsize)
 */
    }

    /* "bcolz/carray_ext.pyx":2612
 *                     self.iobuf, self.iobuf.data + self._row * self.atomsize)
 *             else:
 *                 return self.iobuf[self._row]             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_TraceLine(2612,0,__PYX_ERR(0, 2612, __pyx_L1_error))
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->iobuf), __pyx_v_self->_row, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
    __pyx_L7_continue:;
  }

  /* "bcolz/carray_ext.pyx":2616
 *         else:
 *             # Release buffers
 *             self.iobuf = np.empty(0, dtype=self._dtype)             # <<<<<<<<<<<<<<
 *             self.where_buf = np.empty(0, dtype=np.bool_)
 *             self.iter_exhausted = True
 */
  __Pyx_TraceLine(2616,0,__PYX_ERR(0, 2616, __pyx_L1_error))
  /*else*/ {
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) __PYX_ERR(0, 2616, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__110, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2616, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->iobuf);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->iobuf));
    __pyx_v_self->iobuf = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":2617
 *             # Release buffers
 *             self.iobuf = np.empty(0, dtype=self._dtype)
 *             self.where_buf = np.empty(0, dtype=np.bool_)             # <<<<<<<<<<<<<<
 *             self.iter_exhausted = True
 *             raise StopIteration  # end of iteration
 */
    __Pyx_TraceLine(2617,0,__PYX_ERR(0, 2617, __pyx_L1_error))
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_bool); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 2617, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__111, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2617, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_8);
    __Pyx_GOTREF(__pyx_v_self->where_buf);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->where_buf));
    __pyx_v_self->where_buf = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "bcolz/carray_ext.pyx":2618
 *             self.iobuf = np.empty(0, dtype=self._dtype)
 *             self.where_buf = np.empty(0, dtype=np.bool_)
 *             self.iter_exhausted = True             # <<<<<<<<<<<<<<
 *             raise StopIteration  # end of iteration
 * 
 */
    __Pyx_TraceLine(2618,0,__PYX_ERR(0, 2618, __pyx_L1_error))
    __Pyx_INCREF(Py_True);
    __Pyx_GIVEREF(Py_True);
    __Pyx_GOTREF(__pyx_v_self->iter_exhausted);
    __Pyx_DECREF(__pyx_v_self->iter_exhausted);
    __pyx_v_self->iter_exhausted = Py_True;

    /* "bcolz/carray_ext.pyx":2619
 *             self.where_buf = np.empty(0, dtype=np.bool_)
 *             self.iter_exhausted = True
 *             raise StopIteration  # end of iteration             # <<<<<<<<<<<<<<
 * 
 *     cdef int check_zeros(self, object barr):
 */
    __Pyx_TraceLine(2619,0,__PYX_ERR(0, 2619, __pyx_L1_error))
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 2619, __pyx_L1_error)
  }

  /* "bcolz/carray_ext.pyx":2529
 *         return iter(self)
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef char *vbool
 *         cdef int nhits_buf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2621
 *             raise StopIteration  # end of iteration
 * 
 *     cdef int check_zeros(self, object barr):             # <<<<<<<<<<<<<<
 *         """Check for zeros.  Return 1 if all zeros, else return 0."""
 *         cdef int bsize
 */

static int __pyx_f_5bcolz_10carray_ext_6carray_check_zeros(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_barr) {
  int __pyx_v_bsize;
  npy_intp __pyx_v_nchunk;
  struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_carr = 0;
  PyArrayObject *__pyx_v_ndarr = 0;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = 0;
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("check_zeros", 0);
  __Pyx_TraceCall("check_zeros", __pyx_f[0], 2621, 0, __PYX_ERR(0, 2621, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2629
 *         cdef chunk chunk_
 * 
 *         if isinstance(barr, carray):             # <<<<<<<<<<<<<<
 *             # Check for zero'ed chunks in carrays
 *             carr = barr
 */
  __Pyx_TraceLine(2629,0,__PYX_ERR(0, 2629, __pyx_L1_error))
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_barr, __pyx_ptype_5bcolz_10carray_ext_carray); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2631
 *         if isinstance(barr, carray):
 *             # Check for zero'ed chunks in carrays
 *             carr = barr             # <<<<<<<<<<<<<<
 *             nchunk = <npy_intp> cython.cdiv(self.nrowsread, self.nrowsinbuf)
 *             if nchunk < len(carr.chunks):
 */
    __Pyx_TraceLine(2631,0,__PYX_ERR(0, 2631, __pyx_L1_error))
    if (!(likely(((__pyx_v_barr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_barr, __pyx_ptype_5bcolz_10carray_ext_carray))))) __PYX_ERR(0, 2631, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_barr;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_carr = ((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":2632
 *             # Check for zero'ed chunks in carrays
 *             carr = barr
 *             nchunk = <npy_intp> cython.cdiv(self.nrowsread, self.nrowsinbuf)             # <<<<<<<<<<<<<<
 *             if nchunk < len(carr.chunks):
 *                 chunk_ = carr.chunks[nchunk]
 */
    __Pyx_TraceLine(2632,0,__PYX_ERR(0, 2632, __pyx_L1_error))
    __pyx_v_nchunk = ((npy_intp)(__pyx_v_self->nrowsread / __pyx_v_self->nrowsinbuf));

    /* "bcolz/carray_ext.pyx":2633
 *             carr = barr
 *             nchunk = <npy_intp> cython.cdiv(self.nrowsread, self.nrowsinbuf)
 *             if nchunk < len(carr.chunks):             # <<<<<<<<<<<<<<
 *                 chunk_ = carr.chunks[nchunk]
 *                 if chunk_.isconstant and chunk_.constant in (0, ''):
 */
    __Pyx_TraceLine(2633,0,__PYX_ERR(0, 2633, __pyx_L1_error))
    __pyx_t_3 = __pyx_v_carr->chunks;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2633, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = ((__pyx_v_nchunk < __pyx_t_4) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2634
 *             nchunk = <npy_intp> cython.cdiv(self.nrowsread, self.nrowsinbuf)
 *             if nchunk < len(carr.chunks):
 *                 chunk_ = carr.chunks[nchunk]             # <<<<<<<<<<<<<<
 *                 if chunk_.isconstant and chunk_.constant in (0, ''):
 *                     return 1
 */
      __Pyx_TraceLine(2634,0,__PYX_ERR(0, 2634, __pyx_L1_error))
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_carr->chunks, __pyx_v_nchunk, npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5bcolz_10carray_ext_chunk))))) __PYX_ERR(0, 2634, __pyx_L1_error)
      __pyx_v_chunk_ = ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":2635
 *             if nchunk < len(carr.chunks):
 *                 chunk_ = carr.chunks[nchunk]
 *                 if chunk_.isconstant and chunk_.constant in (0, ''):             # <<<<<<<<<<<<<<
 *                     return 1
 *         else:
 */
      __Pyx_TraceLine(2635,0,__PYX_ERR(0, 2635, __pyx_L1_error))
      __pyx_t_1 = (__pyx_v_chunk_->isconstant != 0);
      if (__pyx_t_1) {
      } else {
        __pyx_t_2 = __pyx_t_1;
        goto __pyx_L6_bool_binop_done;
      }
      __Pyx_INCREF(__pyx_v_chunk_->constant);
      __pyx_t_3 = __pyx_v_chunk_->constant;
      __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2635, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2635, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!__pyx_t_6) {
      } else {
        __pyx_t_1 = __pyx_t_6;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_kp_s__112, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2635, __pyx_L1_error)
      __pyx_t_1 = __pyx_t_6;
      __pyx_L8_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = (__pyx_t_1 != 0);
      __pyx_t_2 = __pyx_t_6;
      __pyx_L6_bool_binop_done:;
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2636
 *                 chunk_ = carr.chunks[nchunk]
 *                 if chunk_.isconstant and chunk_.constant in (0, ''):
 *                     return 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Check for zero'ed chunks in ndarrays
 */
        __Pyx_TraceLine(2636,0,__PYX_ERR(0, 2636, __pyx_L1_error))
        __pyx_r = 1;
        goto __pyx_L0;

        /* "bcolz/carray_ext.pyx":2635
 *             if nchunk < len(carr.chunks):
 *                 chunk_ = carr.chunks[nchunk]
 *                 if chunk_.isconstant and chunk_.constant in (0, ''):             # <<<<<<<<<<<<<<
 *                     return 1
 *         else:
 */
      }

      /* "bcolz/carray_ext.pyx":2633
 *             carr = barr
 *             nchunk = <npy_intp> cython.cdiv(self.nrowsread, self.nrowsinbuf)
 *             if nchunk < len(carr.chunks):             # <<<<<<<<<<<<<<
 *                 chunk_ = carr.chunks[nchunk]
 *                 if chunk_.isconstant and chunk_.constant in (0, ''):
 */
    }

    /* "bcolz/carray_ext.pyx":2629
 *         cdef chunk chunk_
 * 
 *         if isinstance(barr, carray):             # <<<<<<<<<<<<<<
 *             # Check for zero'ed chunks in carrays
 *             carr = barr
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":2639
 *         else:
 *             # Check for zero'ed chunks in ndarrays
 *             ndarr = barr             # <<<<<<<<<<<<<<
 *             bsize = self.nrowsinbuf
 *             if self.nrowsread + bsize > self.len:
 */
  __Pyx_TraceLine(2639,0,__PYX_ERR(0, 2639, __pyx_L1_error))
  /*else*/ {
    if (!(likely(((__pyx_v_barr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_barr, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2639, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_barr;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_ndarr = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":2640
 *             # Check for zero'ed chunks in ndarrays
 *             ndarr = barr
 *             bsize = self.nrowsinbuf             # <<<<<<<<<<<<<<
 *             if self.nrowsread + bsize > self.len:
 *                 bsize = self.len - self.nrowsread
 */
    __Pyx_TraceLine(2640,0,__PYX_ERR(0, 2640, __pyx_L1_error))
    __pyx_t_7 = __pyx_v_self->nrowsinbuf;
    __pyx_v_bsize = __pyx_t_7;

    /* "bcolz/carray_ext.pyx":2641
 *             ndarr = barr
 *             bsize = self.nrowsinbuf
 *             if self.nrowsread + bsize > self.len:             # <<<<<<<<<<<<<<
 *                 bsize = self.len - self.nrowsread
 *             if check_zeros(ndarr.data + self.nrowsread, bsize):
 */
    __Pyx_TraceLine(2641,0,__PYX_ERR(0, 2641, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_self->nrowsread + __pyx_v_bsize)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2641, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2641, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2642
 *             bsize = self.nrowsinbuf
 *             if self.nrowsread + bsize > self.len:
 *                 bsize = self.len - self.nrowsread             # <<<<<<<<<<<<<<
 *             if check_zeros(ndarr.data + self.nrowsread, bsize):
 *                 return 1
 */
      __Pyx_TraceLine(2642,0,__PYX_ERR(0, 2642, __pyx_L1_error))
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2642, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->nrowsread); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2642, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyNumber_Subtract(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2642, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2642, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_bsize = __pyx_t_7;

      /* "bcolz/carray_ext.pyx":2641
 *             ndarr = barr
 *             bsize = self.nrowsinbuf
 *             if self.nrowsread + bsize > self.len:             # <<<<<<<<<<<<<<
 *                 bsize = self.len - self.nrowsread
 *             if check_zeros(ndarr.data + self.nrowsread, bsize):
 */
    }

    /* "bcolz/carray_ext.pyx":2643
 *             if self.nrowsread + bsize > self.len:
 *                 bsize = self.len - self.nrowsread
 *             if check_zeros(ndarr.data + self.nrowsread, bsize):             # <<<<<<<<<<<<<<
 *                 return 1
 *         return 0
 */
    __Pyx_TraceLine(2643,0,__PYX_ERR(0, 2643, __pyx_L1_error))
    __pyx_t_2 = (__pyx_f_5bcolz_10carray_ext_check_zeros((__pyx_v_ndarr->data + __pyx_v_self->nrowsread), __pyx_v_bsize) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2644
 *                 bsize = self.len - self.nrowsread
 *             if check_zeros(ndarr.data + self.nrowsread, bsize):
 *                 return 1             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
      __Pyx_TraceLine(2644,0,__PYX_ERR(0, 2644, __pyx_L1_error))
      __pyx_r = 1;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":2643
 *             if self.nrowsread + bsize > self.len:
 *                 bsize = self.len - self.nrowsread
 *             if check_zeros(ndarr.data + self.nrowsread, bsize):             # <<<<<<<<<<<<<<
 *                 return 1
 *         return 0
 */
    }
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":2645
 *             if check_zeros(ndarr.data + self.nrowsread, bsize):
 *                 return 1
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def _update_disk_sizes(self):
 */
  __Pyx_TraceLine(2645,0,__PYX_ERR(0, 2645, __pyx_L1_error))
  __pyx_r = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2621
 *             raise StopIteration  # end of iteration
 * 
 *     cdef int check_zeros(self, object barr):             # <<<<<<<<<<<<<<
 *         """Check for zeros.  Return 1 if all zeros, else return 0."""
 *         cdef int bsize
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("bcolz.carray_ext.carray.check_zeros", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_carr);
  __Pyx_XDECREF((PyObject *)__pyx_v_ndarr);
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2647
 *         return 0
 * 
 *     def _update_disk_sizes(self):             # <<<<<<<<<<<<<<
 *         """Update the sizes on-disk."""
 *         sizes = dict()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_63_update_disk_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_62_update_disk_sizes[] = "carray._update_disk_sizes(self)\nUpdate the sizes on-disk.";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_63_update_disk_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_update_disk_sizes (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_62_update_disk_sizes(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_62_update_disk_sizes(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_v_sizes = NULL;
  PyObject *__pyx_v_rowsf = NULL;
  PyObject *__pyx_v_rowsfh = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("_update_disk_sizes", 0);
  __Pyx_TraceCall("_update_disk_sizes", __pyx_f[0], 2647, 0, __PYX_ERR(0, 2647, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2649
 *     def _update_disk_sizes(self):
 *         """Update the sizes on-disk."""
 *         sizes = dict()             # <<<<<<<<<<<<<<
 *         if self._rootdir:
 *             sizes['shape'] = self.shape
 */
  __Pyx_TraceLine(2649,0,__PYX_ERR(0, 2649, __pyx_L1_error))
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sizes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2650
 *         """Update the sizes on-disk."""
 *         sizes = dict()
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             sizes['shape'] = self.shape
 *             sizes['nbytes'] = self.nbytes
 */
  __Pyx_TraceLine(2650,0,__PYX_ERR(0, 2650, __pyx_L1_error))
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_rootdir); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2650, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2651
 *         sizes = dict()
 *         if self._rootdir:
 *             sizes['shape'] = self.shape             # <<<<<<<<<<<<<<
 *             sizes['nbytes'] = self.nbytes
 *             sizes['cbytes'] = self.cbytes
 */
    __Pyx_TraceLine(2651,0,__PYX_ERR(0, 2651, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyDict_SetItem(__pyx_v_sizes, __pyx_n_s_shape, __pyx_t_1) < 0)) __PYX_ERR(0, 2651, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2652
 *         if self._rootdir:
 *             sizes['shape'] = self.shape
 *             sizes['nbytes'] = self.nbytes             # <<<<<<<<<<<<<<
 *             sizes['cbytes'] = self.cbytes
 *             rowsf = os.path.join(self.metadir, SIZES_FILE)
 */
    __Pyx_TraceLine(2652,0,__PYX_ERR(0, 2652, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyDict_SetItem(__pyx_v_sizes, __pyx_n_s_nbytes, __pyx_t_1) < 0)) __PYX_ERR(0, 2652, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2653
 *             sizes['shape'] = self.shape
 *             sizes['nbytes'] = self.nbytes
 *             sizes['cbytes'] = self.cbytes             # <<<<<<<<<<<<<<
 *             rowsf = os.path.join(self.metadir, SIZES_FILE)
 *             with open(rowsf, 'wb') as rowsfh:
 */
    __Pyx_TraceLine(2653,0,__PYX_ERR(0, 2653, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2653, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyDict_SetItem(__pyx_v_sizes, __pyx_n_s_cbytes, __pyx_t_1) < 0)) __PYX_ERR(0, 2653, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2654
 *             sizes['nbytes'] = self.nbytes
 *             sizes['cbytes'] = self.cbytes
 *             rowsf = os.path.join(self.metadir, SIZES_FILE)             # <<<<<<<<<<<<<<
 *             with open(rowsf, 'wb') as rowsfh:
 *                 rowsfh.write(
 */
    __Pyx_TraceLine(2654,0,__PYX_ERR(0, 2654, __pyx_L1_error))
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_SIZES_FILE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self->metadir);
    __Pyx_GIVEREF(__pyx_v_self->metadir);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self->metadir);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_rowsf = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2655
 *             sizes['cbytes'] = self.cbytes
 *             rowsf = os.path.join(self.metadir, SIZES_FILE)
 *             with open(rowsf, 'wb') as rowsfh:             # <<<<<<<<<<<<<<
 *                 rowsfh.write(
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))
 */
    __Pyx_TraceLine(2655,0,__PYX_ERR(0, 2655, __pyx_L1_error))
    /*with:*/ {
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_v_rowsf);
      __Pyx_GIVEREF(__pyx_v_rowsf);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_rowsf);
      __Pyx_INCREF(__pyx_n_s_wb);
      __Pyx_GIVEREF(__pyx_n_s_wb);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_wb);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2655, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2655, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2655, __pyx_L4_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __pyx_t_1;
      __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {
            __pyx_v_rowsfh = __pyx_t_7;
            __pyx_t_7 = 0;

            /* "bcolz/carray_ext.pyx":2656
 *             rowsf = os.path.join(self.metadir, SIZES_FILE)
 *             with open(rowsf, 'wb') as rowsfh:
 *                 rowsfh.write(             # <<<<<<<<<<<<<<
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))
 *                 rowsfh.write(b'\n')
 */
            __Pyx_TraceLine(2656,0,__PYX_ERR(0, 2656, __pyx_L8_error))
            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rowsfh, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2656, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);

            /* "bcolz/carray_ext.pyx":2657
 *             with open(rowsf, 'wb') as rowsfh:
 *                 rowsfh.write(
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))             # <<<<<<<<<<<<<<
 *                 rowsfh.write(b'\n')
 * 
 */
            __Pyx_TraceLine(2657,0,__PYX_ERR(0, 2657, __pyx_L8_error))
            __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2657, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dumps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2657, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2657, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_v_sizes);
            __Pyx_GIVEREF(__pyx_v_sizes);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sizes);
            __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2657, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_5);
            if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_ensure_ascii, Py_True) < 0) __PYX_ERR(0, 2657, __pyx_L8_error)
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2657, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2657, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2657, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_5 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            if (!__pyx_t_5) {
              __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2656, __pyx_L8_error)
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_GOTREF(__pyx_t_7);
            } else {
              __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2656, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
              __Pyx_GIVEREF(__pyx_t_12);
              PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_12);
              __pyx_t_12 = 0;
              __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2656, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

            /* "bcolz/carray_ext.pyx":2658
 *                 rowsfh.write(
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))
 *                 rowsfh.write(b'\n')             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
            __Pyx_TraceLine(2658,0,__PYX_ERR(0, 2658, __pyx_L8_error))
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_rowsfh, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2658, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2658, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "bcolz/carray_ext.pyx":2655
 *             sizes['cbytes'] = self.cbytes
 *             rowsf = os.path.join(self.metadir, SIZES_FILE)
 *             with open(rowsf, 'wb') as rowsfh:             # <<<<<<<<<<<<<<
 *                 rowsfh.write(
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))
 */
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L15_try_end;
          __pyx_L8_error:;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("bcolz.carray_ext.carray._update_disk_sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_7, &__pyx_t_1) < 0) __PYX_ERR(0, 2655, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_12 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2655, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2655, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (__pyx_t_2 < 0) __PYX_ERR(0, 2655, __pyx_L10_except_error)
            __pyx_t_14 = ((!(__pyx_t_2 != 0)) != 0);
            if (__pyx_t_14) {
              __Pyx_GIVEREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_7);
              __Pyx_XGIVEREF(__pyx_t_1);
              __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_7, __pyx_t_1);
              __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_1 = 0; 
              __PYX_ERR(0, 2655, __pyx_L10_except_error)
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_PyThreadState_assign
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_PyThreadState_assign
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          __pyx_L15_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_8) {
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__115, NULL);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2655, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }

    /* "bcolz/carray_ext.pyx":2650
 *         """Update the sizes on-disk."""
 *         sizes = dict()
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             sizes['shape'] = self.shape
 *             sizes['nbytes'] = self.nbytes
 */
  }

  /* "bcolz/carray_ext.pyx":2647
 *         return 0
 * 
 *     def _update_disk_sizes(self):             # <<<<<<<<<<<<<<
 *         """Update the sizes on-disk."""
 *         sizes = dict()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("bcolz.carray_ext.carray._update_disk_sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sizes);
  __Pyx_XDECREF(__pyx_v_rowsf);
  __Pyx_XDECREF(__pyx_v_rowsfh);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2660
 *                 rowsfh.write(b'\n')
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         """Flush data in internal buffers to disk.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_65flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_64flush[] = "carray.flush(self)\nFlush data in internal buffers to disk.\n\n        This call should typically be done after performing modifications\n        (__settitem__(), append()) in persistence mode.  If you don't do this,\n        you risk losing part of your modifications.\n\n        ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_65flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_64flush(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_64flush(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  struct __pyx_obj_5bcolz_10carray_ext_chunk *__pyx_v_chunk_ = 0;
  int __pyx_v_leftover_atoms;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  __Pyx_RefNannySetupContext("flush", 0);
  __Pyx_TraceCall("flush", __pyx_f[0], 2660, 0, __PYX_ERR(0, 2660, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2672
 *         cdef int leftover_atoms
 * 
 *         if self._rootdir is None:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __Pyx_TraceLine(2672,0,__PYX_ERR(0, 2672, __pyx_L1_error))
  __pyx_t_1 = (__pyx_v_self->_rootdir == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2673
 * 
 *         if self._rootdir is None:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if self.leftover:
 */
    __Pyx_TraceLine(2673,0,__PYX_ERR(0, 2673, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2672
 *         cdef int leftover_atoms
 * 
 *         if self._rootdir is None:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":2675
 *             return
 * 
 *         if self.leftover:             # <<<<<<<<<<<<<<
 *             leftover_atoms = cython.cdiv(self.leftover, self.atomsize)
 *             chunk_ = chunk(self.lastchunkarr[:leftover_atoms], self.dtype,
 */
  __Pyx_TraceLine(2675,0,__PYX_ERR(0, 2675, __pyx_L1_error))
  __pyx_t_2 = (__pyx_v_self->leftover != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2676
 * 
 *         if self.leftover:
 *             leftover_atoms = cython.cdiv(self.leftover, self.atomsize)             # <<<<<<<<<<<<<<
 *             chunk_ = chunk(self.lastchunkarr[:leftover_atoms], self.dtype,
 *                            self.cparams,
 */
    __Pyx_TraceLine(2676,0,__PYX_ERR(0, 2676, __pyx_L1_error))
    __pyx_v_leftover_atoms = (__pyx_v_self->leftover / __pyx_v_self->atomsize);

    /* "bcolz/carray_ext.pyx":2677
 *         if self.leftover:
 *             leftover_atoms = cython.cdiv(self.leftover, self.atomsize)
 *             chunk_ = chunk(self.lastchunkarr[:leftover_atoms], self.dtype,             # <<<<<<<<<<<<<<
 *                            self.cparams,
 *                            _memory=self._rootdir is None)
 */
    __Pyx_TraceLine(2677,0,__PYX_ERR(0, 2677, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_self->lastchunkarr, 0, __pyx_v_leftover_atoms, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "bcolz/carray_ext.pyx":2678
 *             leftover_atoms = cython.cdiv(self.leftover, self.atomsize)
 *             chunk_ = chunk(self.lastchunkarr[:leftover_atoms], self.dtype,
 *                            self.cparams,             # <<<<<<<<<<<<<<
 *                            _memory=self._rootdir is None)
 *             # Flush this chunk to disk
 */
    __Pyx_TraceLine(2678,0,__PYX_ERR(0, 2678, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "bcolz/carray_ext.pyx":2677
 *         if self.leftover:
 *             leftover_atoms = cython.cdiv(self.leftover, self.atomsize)
 *             chunk_ = chunk(self.lastchunkarr[:leftover_atoms], self.dtype,             # <<<<<<<<<<<<<<
 *                            self.cparams,
 *                            _memory=self._rootdir is None)
 */
    __Pyx_TraceLine(2677,0,__PYX_ERR(0, 2677, __pyx_L1_error))
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":2679
 *             chunk_ = chunk(self.lastchunkarr[:leftover_atoms], self.dtype,
 *                            self.cparams,
 *                            _memory=self._rootdir is None)             # <<<<<<<<<<<<<<
 *             # Flush this chunk to disk
 *             self.chunks.flush(chunk_)
 */
    __Pyx_TraceLine(2679,0,__PYX_ERR(0, 2679, __pyx_L1_error))
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = (__pyx_v_self->_rootdir == Py_None);
    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory, __pyx_t_4) < 0) __PYX_ERR(0, 2679, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":2677
 *         if self.leftover:
 *             leftover_atoms = cython.cdiv(self.leftover, self.atomsize)
 *             chunk_ = chunk(self.lastchunkarr[:leftover_atoms], self.dtype,             # <<<<<<<<<<<<<<
 *                            self.cparams,
 *                            _memory=self._rootdir is None)
 */
    __Pyx_TraceLine(2677,0,__PYX_ERR(0, 2677, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_chunk_ = ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":2681
 *                            _memory=self._rootdir is None)
 *             # Flush this chunk to disk
 *             self.chunks.flush(chunk_)             # <<<<<<<<<<<<<<
 * 
 *         # Finally, update the sizes metadata on-disk
 */
    __Pyx_TraceLine(2681,0,__PYX_ERR(0, 2681, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->chunks, __pyx_n_s_flush); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_chunk_)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_chunk_));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_chunk_));
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_chunk_));
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":2675
 *             return
 * 
 *         if self.leftover:             # <<<<<<<<<<<<<<
 *             leftover_atoms = cython.cdiv(self.leftover, self.atomsize)
 *             chunk_ = chunk(self.lastchunkarr[:leftover_atoms], self.dtype,
 */
  }

  /* "bcolz/carray_ext.pyx":2684
 * 
 *         # Finally, update the sizes metadata on-disk
 *         self._update_disk_sizes()             # <<<<<<<<<<<<<<
 * 
 *     # XXX This does not work.  Will have to realize how to properly
 */
  __Pyx_TraceLine(2684,0,__PYX_ERR(0, 2684, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update_disk_sizes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2684, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2684, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "bcolz/carray_ext.pyx":2660
 *                 rowsfh.write(b'\n')
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         """Flush data in internal buffers to disk.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk_);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2692
 *     #   self.flush()
 * 
 *     def purge(self):             # <<<<<<<<<<<<<<
 *         """ Remove the underlying data for on-disk arrays. """
 *         if self.rootdir:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_67purge(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_66purge[] = "carray.purge(self)\n Remove the underlying data for on-disk arrays. ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_67purge(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("purge (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_66purge(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_66purge(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("purge", 0);
  __Pyx_TraceCall("purge", __pyx_f[0], 2692, 0, __PYX_ERR(0, 2692, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2694
 *     def purge(self):
 *         """ Remove the underlying data for on-disk arrays. """
 *         if self.rootdir:             # <<<<<<<<<<<<<<
 *             shutil.rmtree(self.rootdir)
 * 
 */
  __Pyx_TraceLine(2694,0,__PYX_ERR(0, 2694, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rootdir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2694, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2695
 *         """ Remove the underlying data for on-disk arrays. """
 *         if self.rootdir:
 *             shutil.rmtree(self.rootdir)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
    __Pyx_TraceLine(2695,0,__PYX_ERR(0, 2695, __pyx_L1_error))
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_shutil); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_rmtree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rootdir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2695, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2695, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2694
 *     def purge(self):
 *         """ Remove the underlying data for on-disk arrays. """
 *         if self.rootdir:             # <<<<<<<<<<<<<<
 *             shutil.rmtree(self.rootdir)
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":2692
 *     #   self.flush()
 * 
 *     def purge(self):             # <<<<<<<<<<<<<<
 *         """ Remove the underlying data for on-disk arrays. """
 *         if self.rootdir:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.purge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2697
 *             shutil.rmtree(self.rootdir)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return array2string(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_69__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_69__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_68__str__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_68__str__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);
  __Pyx_TraceCall("__str__", __pyx_f[0], 2697, 0, __PYX_ERR(0, 2697, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2698
 * 
 *     def __str__(self):
 *         return array2string(self)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_TraceLine(2698,0,__PYX_ERR(0, 2698, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_array2string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_self));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2697
 *             shutil.rmtree(self.rootdir)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return array2string(self)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2700
 *         return array2string(self)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         snbytes = utils.human_readable_size(self._nbytes)
 *         scbytes = utils.human_readable_size(self._cbytes)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_71__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_71__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_70__repr__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_70__repr__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_v_snbytes = NULL;
  PyObject *__pyx_v_scbytes = NULL;
  PyObject *__pyx_v_cratio = NULL;
  PyObject *__pyx_v_header = NULL;
  PyObject *__pyx_v_blocksize = NULL;
  PyObject *__pyx_v_fullrepr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __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;
  Py_ssize_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__repr__", 0);
  __Pyx_TraceCall("__repr__", __pyx_f[0], 2700, 0, __PYX_ERR(0, 2700, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2701
 * 
 *     def __repr__(self):
 *         snbytes = utils.human_readable_size(self._nbytes)             # <<<<<<<<<<<<<<
 *         scbytes = utils.human_readable_size(self._cbytes)
 *         if not self._cbytes:
 */
  __Pyx_TraceLine(2701,0,__PYX_ERR(0, 2701, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_human_readable_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_nbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2701, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_snbytes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2702
 *     def __repr__(self):
 *         snbytes = utils.human_readable_size(self._nbytes)
 *         scbytes = utils.human_readable_size(self._cbytes)             # <<<<<<<<<<<<<<
 *         if not self._cbytes:
 *             cratio = np.nan
 */
  __Pyx_TraceLine(2702,0,__PYX_ERR(0, 2702, __pyx_L1_error))
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_human_readable_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_cbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2702, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_scbytes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2703
 *         snbytes = utils.human_readable_size(self._nbytes)
 *         scbytes = utils.human_readable_size(self._cbytes)
 *         if not self._cbytes:             # <<<<<<<<<<<<<<
 *             cratio = np.nan
 *         else:
 */
  __Pyx_TraceLine(2703,0,__PYX_ERR(0, 2703, __pyx_L1_error))
  __pyx_t_6 = ((!(__pyx_v_self->_cbytes != 0)) != 0);
  if (__pyx_t_6) {

    /* "bcolz/carray_ext.pyx":2704
 *         scbytes = utils.human_readable_size(self._cbytes)
 *         if not self._cbytes:
 *             cratio = np.nan             # <<<<<<<<<<<<<<
 *         else:
 *             cratio = self._nbytes / float(self._cbytes)
 */
    __Pyx_TraceLine(2704,0,__PYX_ERR(0, 2704, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_cratio = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":2703
 *         snbytes = utils.human_readable_size(self._nbytes)
 *         scbytes = utils.human_readable_size(self._cbytes)
 *         if not self._cbytes:             # <<<<<<<<<<<<<<
 *             cratio = np.nan
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":2706
 *             cratio = np.nan
 *         else:
 *             cratio = self._nbytes / float(self._cbytes)             # <<<<<<<<<<<<<<
 *         header = "carray(%s, %s)\n" % (self.shape, self.dtype)
 *         header += "  nbytes := %s; cbytes := %s; ratio: %.2f\n" % (
 */
  __Pyx_TraceLine(2706,0,__PYX_ERR(0, 2706, __pyx_L1_error))
  /*else*/ {
    if (unlikely(((double)__pyx_v_self->_cbytes) == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 2706, __pyx_L1_error)
    }
    __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->_nbytes / ((double)__pyx_v_self->_cbytes))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_cratio = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":2707
 *         else:
 *             cratio = self._nbytes / float(self._cbytes)
 *         header = "carray(%s, %s)\n" % (self.shape, self.dtype)             # <<<<<<<<<<<<<<
 *         header += "  nbytes := %s; cbytes := %s; ratio: %.2f\n" % (
 *             snbytes, scbytes, cratio)
 */
  __Pyx_TraceLine(2707,0,__PYX_ERR(0, 2707, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __pyx_t_5 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_carray_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_header = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2709
 *         header = "carray(%s, %s)\n" % (self.shape, self.dtype)
 *         header += "  nbytes := %s; cbytes := %s; ratio: %.2f\n" % (
 *             snbytes, scbytes, cratio)             # <<<<<<<<<<<<<<
 *         header += "  cparams := %r\n" % self.cparams
 *         blocksize = self.chunks[0].blocksize if len(self.chunks) > 0 else 0
 */
  __Pyx_TraceLine(2709,0,__PYX_ERR(0, 2709, __pyx_L1_error))
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_snbytes);
  __Pyx_GIVEREF(__pyx_v_snbytes);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_snbytes);
  __Pyx_INCREF(__pyx_v_scbytes);
  __Pyx_GIVEREF(__pyx_v_scbytes);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_scbytes);
  __Pyx_INCREF(__pyx_v_cratio);
  __Pyx_GIVEREF(__pyx_v_cratio);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_cratio);

  /* "bcolz/carray_ext.pyx":2708
 *             cratio = self._nbytes / float(self._cbytes)
 *         header = "carray(%s, %s)\n" % (self.shape, self.dtype)
 *         header += "  nbytes := %s; cbytes := %s; ratio: %.2f\n" % (             # <<<<<<<<<<<<<<
 *             snbytes, scbytes, cratio)
 *         header += "  cparams := %r\n" % self.cparams
 */
  __Pyx_TraceLine(2708,0,__PYX_ERR(0, 2708, __pyx_L1_error))
  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_nbytes_s_cbytes_s_ratio_2f, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_header, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_header, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2710
 *         header += "  nbytes := %s; cbytes := %s; ratio: %.2f\n" % (
 *             snbytes, scbytes, cratio)
 *         header += "  cparams := %r\n" % self.cparams             # <<<<<<<<<<<<<<
 *         blocksize = self.chunks[0].blocksize if len(self.chunks) > 0 else 0
 *         header += "  chunklen := %s; chunksize: %s; blocksize: %s\n" % (
 */
  __Pyx_TraceLine(2710,0,__PYX_ERR(0, 2710, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_cparams_r, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_header, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_header, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2711
 *             snbytes, scbytes, cratio)
 *         header += "  cparams := %r\n" % self.cparams
 *         blocksize = self.chunks[0].blocksize if len(self.chunks) > 0 else 0             # <<<<<<<<<<<<<<
 *         header += "  chunklen := %s; chunksize: %s; blocksize: %s\n" % (
 *             self.chunklen, self._chunksize, blocksize)
 */
  __Pyx_TraceLine(2711,0,__PYX_ERR(0, 2711, __pyx_L1_error))
  __pyx_t_4 = __pyx_v_self->chunks;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 2711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (((__pyx_t_7 > 0) != 0)) {
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self->chunks, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_blocksize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_1 = __pyx_int_0;
  }
  __pyx_v_blocksize = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2713
 *         blocksize = self.chunks[0].blocksize if len(self.chunks) > 0 else 0
 *         header += "  chunklen := %s; chunksize: %s; blocksize: %s\n" % (
 *             self.chunklen, self._chunksize, blocksize)             # <<<<<<<<<<<<<<
 *         if self._rootdir:
 *             header += "  rootdir := '%s'\n" % self._rootdir
 */
  __Pyx_TraceLine(2713,0,__PYX_ERR(0, 2713, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunklen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->_chunksize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_blocksize);
  __Pyx_GIVEREF(__pyx_v_blocksize);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_blocksize);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":2712
 *         header += "  cparams := %r\n" % self.cparams
 *         blocksize = self.chunks[0].blocksize if len(self.chunks) > 0 else 0
 *         header += "  chunklen := %s; chunksize: %s; blocksize: %s\n" % (             # <<<<<<<<<<<<<<
 *             self.chunklen, self._chunksize, blocksize)
 *         if self._rootdir:
 */
  __Pyx_TraceLine(2712,0,__PYX_ERR(0, 2712, __pyx_L1_error))
  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_chunklen_s_chunksize_s_blocksiz, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_header, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_header, ((PyObject*)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "bcolz/carray_ext.pyx":2714
 *         header += "  chunklen := %s; chunksize: %s; blocksize: %s\n" % (
 *             self.chunklen, self._chunksize, blocksize)
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             header += "  rootdir := '%s'\n" % self._rootdir
 *             header += "  mode    := '%s'\n" % self.mode
 */
  __Pyx_TraceLine(2714,0,__PYX_ERR(0, 2714, __pyx_L1_error))
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_self->_rootdir); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2714, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "bcolz/carray_ext.pyx":2715
 *             self.chunklen, self._chunksize, blocksize)
 *         if self._rootdir:
 *             header += "  rootdir := '%s'\n" % self._rootdir             # <<<<<<<<<<<<<<
 *             header += "  mode    := '%s'\n" % self.mode
 *         fullrepr = header + str(self)
 */
    __Pyx_TraceLine(2715,0,__PYX_ERR(0, 2715, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_rootdir_s, __pyx_v_self->_rootdir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_header, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_header, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":2716
 *         if self._rootdir:
 *             header += "  rootdir := '%s'\n" % self._rootdir
 *             header += "  mode    := '%s'\n" % self.mode             # <<<<<<<<<<<<<<
 *         fullrepr = header + str(self)
 *         return fullrepr
 */
    __Pyx_TraceLine(2716,0,__PYX_ERR(0, 2716, __pyx_L1_error))
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_mode_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_header, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_header, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":2714
 *         header += "  chunklen := %s; chunksize: %s; blocksize: %s\n" % (
 *             self.chunklen, self._chunksize, blocksize)
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             header += "  rootdir := '%s'\n" % self._rootdir
 *             header += "  mode    := '%s'\n" % self.mode
 */
  }

  /* "bcolz/carray_ext.pyx":2717
 *             header += "  rootdir := '%s'\n" % self._rootdir
 *             header += "  mode    := '%s'\n" % self.mode
 *         fullrepr = header + str(self)             # <<<<<<<<<<<<<<
 *         return fullrepr
 * 
 */
  __Pyx_TraceLine(2717,0,__PYX_ERR(0, 2717, __pyx_L1_error))
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_v_header, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_fullrepr = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":2718
 *             header += "  mode    := '%s'\n" % self.mode
 *         fullrepr = header + str(self)
 *         return fullrepr             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_TraceLine(2718,0,__PYX_ERR(0, 2718, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fullrepr);
  __pyx_r = __pyx_v_fullrepr;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2700
 *         return array2string(self)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         snbytes = utils.human_readable_size(self._nbytes)
 *         scbytes = utils.human_readable_size(self._cbytes)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_snbytes);
  __Pyx_XDECREF(__pyx_v_scbytes);
  __Pyx_XDECREF(__pyx_v_cratio);
  __Pyx_XDECREF(__pyx_v_header);
  __Pyx_XDECREF(__pyx_v_blocksize);
  __Pyx_XDECREF(__pyx_v_fullrepr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2720
 *         return fullrepr
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         if self.rootdir:
 *             return (build_carray, (None,self.rootdir,))
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_73__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_72__reduce__[] = "carray.__reduce__(self)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_73__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_72__reduce__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_72__reduce__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);
  __Pyx_TraceCall("__reduce__", __pyx_f[0], 2720, 0, __PYX_ERR(0, 2720, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2721
 * 
 *     def __reduce__(self):
 *         if self.rootdir:             # <<<<<<<<<<<<<<
 *             return (build_carray, (None,self.rootdir,))
 *         else:
 */
  __Pyx_TraceLine(2721,0,__PYX_ERR(0, 2721, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rootdir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2721, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2722
 *     def __reduce__(self):
 *         if self.rootdir:
 *             return (build_carray, (None,self.rootdir,))             # <<<<<<<<<<<<<<
 *         else:
 *             return (build_carray,(self[:],None,))
 */
    __Pyx_TraceLine(2722,0,__PYX_ERR(0, 2722, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_build_carray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rootdir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_4, 0, Py_None);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2721
 * 
 *     def __reduce__(self):
 *         if self.rootdir:             # <<<<<<<<<<<<<<
 *             return (build_carray, (None,self.rootdir,))
 *         else:
 */
  }

  /* "bcolz/carray_ext.pyx":2724
 *             return (build_carray, (None,self.rootdir,))
 *         else:
 *             return (build_carray,(self[:],None,))             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __Pyx_TraceLine(2724,0,__PYX_ERR(0, 2724, __pyx_L1_error))
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_build_carray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, 0, NULL, NULL, &__pyx_slice__116, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "bcolz/carray_ext.pyx":2720
 *         return fullrepr
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         if self.rootdir:
 *             return (build_carray, (None,self.rootdir,))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2726
 *             return (build_carray,(self[:],None,))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_75__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_74__enter__[] = "carray.__enter__(self)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_75__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_74__enter__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_74__enter__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);
  __Pyx_TraceCall("__enter__", __pyx_f[0], 2726, 0, __PYX_ERR(0, 2726, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2727
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, type, value, tb):
 */
  __Pyx_TraceLine(2727,0,__PYX_ERR(0, 2727, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2726
 *             return (build_carray,(self[:],None,))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2729
 *         return self
 * 
 *     def __exit__(self, type, value, tb):             # <<<<<<<<<<<<<<
 *         if self.mode != 'r':
 *             self.flush()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_77__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_76__exit__[] = "carray.__exit__(self, type, value, tb)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_77__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 2729, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 2729, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 2729, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_type = values[0];
    __pyx_v_value = values[1];
    __pyx_v_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2729, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_76__exit__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_type, __pyx_v_value, __pyx_v_tb);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_76__exit__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_type, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);
  __Pyx_TraceCall("__exit__", __pyx_f[0], 2729, 0, __PYX_ERR(0, 2729, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2730
 * 
 *     def __exit__(self, type, value, tb):
 *         if self.mode != 'r':             # <<<<<<<<<<<<<<
 *             self.flush()
 * 
 */
  __Pyx_TraceLine(2730,0,__PYX_ERR(0, 2730, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_r, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2730, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2731
 *     def __exit__(self, type, value, tb):
 *         if self.mode != 'r':
 *             self.flush()             # <<<<<<<<<<<<<<
 * 
 *     def __array__(self, dtype=None, **kwargs):
 */
    __Pyx_TraceLine(2731,0,__PYX_ERR(0, 2731, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flush); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2730
 * 
 *     def __exit__(self, type, value, tb):
 *         if self.mode != 'r':             # <<<<<<<<<<<<<<
 *             self.flush()
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":2729
 *         return self
 * 
 *     def __exit__(self, type, value, tb):             # <<<<<<<<<<<<<<
 *         if self.mode != 'r':
 *             self.flush()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2733
 *             self.flush()
 * 
 *     def __array__(self, dtype=None, **kwargs):             # <<<<<<<<<<<<<<
 *         x = self[:]
 *         if dtype and x.dtype != dtype:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_79__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_78__array__[] = "carray.__array__(self, dtype=None, **kwargs)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_79__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dtype = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__array__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,0};
    PyObject* values[1] = {0};
    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_dtype);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__array__") < 0)) __PYX_ERR(0, 2733, __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_dtype = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__array__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2733, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_78__array__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), __pyx_v_dtype, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_78__array__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_dtype, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__array__", 0);
  __Pyx_TraceCall("__array__", __pyx_f[0], 2733, 0, __PYX_ERR(0, 2733, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":2734
 * 
 *     def __array__(self, dtype=None, **kwargs):
 *         x = self[:]             # <<<<<<<<<<<<<<
 *         if dtype and x.dtype != dtype:
 *             x = x.astype(dtype)
 */
  __Pyx_TraceLine(2734,0,__PYX_ERR(0, 2734, __pyx_L1_error))
  __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, 0, NULL, NULL, &__pyx_slice__117, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2735
 *     def __array__(self, dtype=None, **kwargs):
 *         x = self[:]
 *         if dtype and x.dtype != dtype:             # <<<<<<<<<<<<<<
 *             x = x.astype(dtype)
 *         return x
 */
  __Pyx_TraceLine(2735,0,__PYX_ERR(0, 2735, __pyx_L1_error))
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_dtype); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2735, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_dtype, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2735, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2735, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2736
 *         x = self[:]
 *         if dtype and x.dtype != dtype:
 *             x = x.astype(dtype)             # <<<<<<<<<<<<<<
 *         return x
 * 
 */
    __Pyx_TraceLine(2736,0,__PYX_ERR(0, 2736, __pyx_L1_error))
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2736, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2736, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_dtype);
      __Pyx_GIVEREF(__pyx_v_dtype);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_dtype);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2736, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":2735
 *     def __array__(self, dtype=None, **kwargs):
 *         x = self[:]
 *         if dtype and x.dtype != dtype:             # <<<<<<<<<<<<<<
 *             x = x.astype(dtype)
 *         return x
 */
  }

  /* "bcolz/carray_ext.pyx":2737
 *         if dtype and x.dtype != dtype:
 *             x = x.astype(dtype)
 *         return x             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_TraceLine(2737,0,__PYX_ERR(0, 2737, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_x);
  __pyx_r = __pyx_v_x;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2733
 *             self.flush()
 * 
 *     def __array__(self, dtype=None, **kwargs):             # <<<<<<<<<<<<<<
 *         x = self[:]
 *         if dtype and x.dtype != dtype:
 */

  /* function exit code */
  __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("bcolz.carray_ext.carray.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pxd":30
 * 
 * cdef class carray:
 *     cdef public int itemsize, atomsize             # <<<<<<<<<<<<<<
 *     cdef int _chunksize, _chunklen, leftover
 *     cdef int nrowsinbuf, _row
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_8itemsize_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_8itemsize___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_8itemsize___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[1], 30, 0, __PYX_ERR(1, 30, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6carray_8itemsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_6carray_8itemsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_8itemsize_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_6carray_8itemsize_2__set__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[1], 30, 0, __PYX_ERR(1, 30, __pyx_L1_error));
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error)
  __pyx_v_self->itemsize = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.itemsize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_8atomsize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_8atomsize_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_8atomsize___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_8atomsize___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[1], 30, 0, __PYX_ERR(1, 30, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->atomsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("bcolz.carray_ext.carray.atomsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6carray_8atomsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_6carray_8atomsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_8atomsize_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_6carray_8atomsize_2__set__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[1], 30, 0, __PYX_ERR(1, 30, __pyx_L1_error));
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error)
  __pyx_v_self->atomsize = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.atomsize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pxd":45
 *     cdef object _dtype
 *     cdef object _safe
 *     cdef public object chunks             # <<<<<<<<<<<<<<
 *     cdef object _rootdir, datadir, metadir, _mode
 *     cdef object _attrs, iter_exhausted
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_6chunks_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_6chunks_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_6chunks___get__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_6chunks___get__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_TraceCall("__get__", __pyx_f[1], 45, 0, __PYX_ERR(1, 45, __pyx_L1_error));
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->chunks);
  __pyx_r = __pyx_v_self->chunks;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.chunks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6carray_6chunks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_6carray_6chunks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_6chunks_2__set__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_5bcolz_10carray_ext_6carray_6chunks_2__set__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_TraceCall("__set__", __pyx_f[1], 45, 0, __PYX_ERR(1, 45, __pyx_L1_error));
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->chunks);
  __Pyx_DECREF(__pyx_v_self->chunks);
  __pyx_v_self->chunks = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.chunks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5bcolz_10carray_ext_6carray_6chunks_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5bcolz_10carray_ext_6carray_6chunks_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_6chunks_4__del__(((struct __pyx_obj_5bcolz_10carray_ext_carray *)__pyx_v_self));

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

static int __pyx_pf_5bcolz_10carray_ext_6carray_6chunks_4__del__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  int __pyx_r;
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_TraceCall("__del__", __pyx_f[1], 45, 0, __PYX_ERR(1, 45, __pyx_L1_error));
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->chunks);
  __Pyx_DECREF(__pyx_v_self->chunks);
  __pyx_v_self->chunks = Py_None;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("bcolz.carray_ext.carray.chunks.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # 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.
 */

/* 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));

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

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_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  __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);
  }
  __Pyx_TraceCall("__getbuffer__", __pyx_f[2], 197, 0, __PYX_ERR(2, 197, __pyx_L1_error));

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __Pyx_TraceLine(203,0,__PYX_ERR(2, 203, __pyx_L1_error))
  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __Pyx_TraceLine(206,0,__PYX_ERR(2, 206, __pyx_L1_error))
  __pyx_v_endian_detector = 1;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207
 *             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_TraceLine(207,0,__PYX_ERR(2, 207, __pyx_L1_error))
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __Pyx_TraceLine(209,0,__PYX_ERR(2, 209, __pyx_L1_error))
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __Pyx_TraceLine(211,0,__PYX_ERR(2, 211, __pyx_L1_error))
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __Pyx_TraceLine(212,0,__PYX_ERR(2, 212, __pyx_L1_error))
    __pyx_v_copy_shape = 1;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
    goto __pyx_L4;
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
  __Pyx_TraceLine(214,0,__PYX_ERR(2, 214, __pyx_L1_error))
  /*else*/ {
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 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_TraceLine(216,0,__PYX_ERR(2, 216, __pyx_L1_error))
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217
 * 
 *             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_TraceLine(217,0,__PYX_ERR(2, 217, __pyx_L1_error))
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 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_TraceLine(216,0,__PYX_ERR(2, 216, __pyx_L1_error))
  if (__pyx_t_1) {

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             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_TraceLine(218,0,__PYX_ERR(2, 218, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 218, __pyx_L1_error)

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 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")
 */
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 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_TraceLine(220,0,__PYX_ERR(2, 220, __pyx_L1_error))
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L9_bool_binop_done;
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221
 * 
 *             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_TraceLine(221,0,__PYX_ERR(2, 221, __pyx_L1_error))
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 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_TraceLine(220,0,__PYX_ERR(2, 220, __pyx_L1_error))
  if (__pyx_t_1) {

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             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_TraceLine(222,0,__PYX_ERR(2, 222, __pyx_L1_error))
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 222, __pyx_L1_error)

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 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")
 */
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __Pyx_TraceLine(224,0,__PYX_ERR(2, 224, __pyx_L1_error))
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __Pyx_TraceLine(225,0,__PYX_ERR(2, 225, __pyx_L1_error))
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226
 *             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.
 */
  __Pyx_TraceLine(226,0,__PYX_ERR(2, 226, __pyx_L1_error))
  __pyx_t_1 = (__pyx_v_copy_shape != 0);
  if (__pyx_t_1) {

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229
 *                 # 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_TraceLine(229,0,__PYX_ERR(2, 229, __pyx_L1_error))
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230
 *                 # 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_TraceLine(230,0,__PYX_ERR(2, 230, __pyx_L1_error))
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231
 *                 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_TraceLine(231,0,__PYX_ERR(2, 231, __pyx_L1_error))
    __pyx_t_4 = __pyx_v_ndim;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232
 *                 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_TraceLine(232,0,__PYX_ERR(2, 232, __pyx_L1_error))
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233
 *                 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_TraceLine(233,0,__PYX_ERR(2, 233, __pyx_L1_error))
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226
 *             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.
 */
    goto __pyx_L11;
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235
 *                     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_TraceLine(235,0,__PYX_ERR(2, 235, __pyx_L1_error))
  /*else*/ {
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236
 *             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_TraceLine(236,0,__PYX_ERR(2, 236, __pyx_L1_error))
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L11:;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237
 *                 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_TraceLine(237,0,__PYX_ERR(2, 237, __pyx_L1_error))
  __pyx_v_info->suboffsets = NULL;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __Pyx_TraceLine(238,0,__PYX_ERR(2, 238, __pyx_L1_error))
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __Pyx_TraceLine(239,0,__PYX_ERR(2, 239, __pyx_L1_error))
  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef int offset
 */
  __Pyx_TraceLine(242,0,__PYX_ERR(2, 242, __pyx_L1_error))
  __pyx_v_f = NULL;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef int offset
 * 
 */
  __Pyx_TraceLine(243,0,__PYX_ERR(2, 243, __pyx_L1_error))
  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __Pyx_TraceLine(246,0,__PYX_ERR(2, 246, __pyx_L1_error))
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __Pyx_TraceLine(248,0,__PYX_ERR(2, 248, __pyx_L1_error))
  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_1) {

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_TraceLine(250,0,__PYX_ERR(2, 250, __pyx_L1_error))
    __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;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
    goto __pyx_L14;
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
  __Pyx_TraceLine(253,0,__PYX_ERR(2, 253, __pyx_L1_error))
  /*else*/ {
    __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_L14:;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __Pyx_TraceLine(255,0,__PYX_ERR(2, 255, __pyx_L1_error))
  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_1) {

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __Pyx_TraceLine(256,0,__PYX_ERR(2, 256, __pyx_L1_error))
    __pyx_t_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             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_TraceLine(257,0,__PYX_ERR(2, 257, __pyx_L1_error))
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
    if (!__pyx_t_2) {
      goto __pyx_L20_next_or;
    } else {
    }
    __pyx_t_2 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_L20_next_or:;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258
 *                 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_TraceLine(258,0,__PYX_ERR(2, 258, __pyx_L1_error))
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L19_bool_binop_done:;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             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_TraceLine(257,0,__PYX_ERR(2, 257, __pyx_L1_error))
    if (__pyx_t_1) {

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259
 *                 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_TraceLine(259,0,__PYX_ERR(2, 259, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(2, 259, __pyx_L1_error)

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257
 *             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")
 */
    }

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260
 *                     (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_TraceLine(260,0,__PYX_ERR(2, 260, __pyx_L1_error))
    switch (__pyx_v_t) {
      case NPY_BYTE:
      __pyx_v_f = ((char *)"b");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261
 *                     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_TraceLine(261,0,__PYX_ERR(2, 261, __pyx_L1_error))
      case NPY_UBYTE:
      __pyx_v_f = ((char *)"B");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262
 *                 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_TraceLine(262,0,__PYX_ERR(2, 262, __pyx_L1_error))
      case NPY_SHORT:
      __pyx_v_f = ((char *)"h");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263
 *                 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_TraceLine(263,0,__PYX_ERR(2, 263, __pyx_L1_error))
      case NPY_USHORT:
      __pyx_v_f = ((char *)"H");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264
 *                 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_TraceLine(264,0,__PYX_ERR(2, 264, __pyx_L1_error))
      case NPY_INT:
      __pyx_v_f = ((char *)"i");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265
 *                 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_TraceLine(265,0,__PYX_ERR(2, 265, __pyx_L1_error))
      case NPY_UINT:
      __pyx_v_f = ((char *)"I");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266
 *                 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_TraceLine(266,0,__PYX_ERR(2, 266, __pyx_L1_error))
      case NPY_LONG:
      __pyx_v_f = ((char *)"l");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267
 *                 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_TraceLine(267,0,__PYX_ERR(2, 267, __pyx_L1_error))
      case NPY_ULONG:
      __pyx_v_f = ((char *)"L");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268
 *                 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_TraceLine(268,0,__PYX_ERR(2, 268, __pyx_L1_error))
      case NPY_LONGLONG:
      __pyx_v_f = ((char *)"q");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269
 *                 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_TraceLine(269,0,__PYX_ERR(2, 269, __pyx_L1_error))
      case NPY_ULONGLONG:
      __pyx_v_f = ((char *)"Q");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270
 *                 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_TraceLine(270,0,__PYX_ERR(2, 270, __pyx_L1_error))
      case NPY_FLOAT:
      __pyx_v_f = ((char *)"f");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271
 *                 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_TraceLine(271,0,__PYX_ERR(2, 271, __pyx_L1_error))
      case NPY_DOUBLE:
      __pyx_v_f = ((char *)"d");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272
 *                 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_TraceLine(272,0,__PYX_ERR(2, 272, __pyx_L1_error))
      case NPY_LONGDOUBLE:
      __pyx_v_f = ((char *)"g");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273
 *                 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_TraceLine(273,0,__PYX_ERR(2, 273, __pyx_L1_error))
      case NPY_CFLOAT:
      __pyx_v_f = ((char *)"Zf");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274
 *                 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_TraceLine(274,0,__PYX_ERR(2, 274, __pyx_L1_error))
      case NPY_CDOUBLE:
      __pyx_v_f = ((char *)"Zd");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275
 *                 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_TraceLine(275,0,__PYX_ERR(2, 275, __pyx_L1_error))
      case NPY_CLONGDOUBLE:
      __pyx_v_f = ((char *)"Zg");
      break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276
 *                 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_TraceLine(276,0,__PYX_ERR(2, 276, __pyx_L1_error))
      case NPY_OBJECT:
      __pyx_v_f = ((char *)"O");
      break;
      default:

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __Pyx_TraceLine(278,0,__PYX_ERR(2, 278, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(2, 278, __pyx_L1_error)
      break;
    }

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __Pyx_TraceLine(279,0,__PYX_ERR(2, 279, __pyx_L1_error))
    __pyx_v_info->format = __pyx_v_f;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280
 *                     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_TraceLine(280,0,__PYX_ERR(2, 280, __pyx_L1_error))
    __pyx_r = 0;
    goto __pyx_L0;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
  __Pyx_TraceLine(282,0,__PYX_ERR(2, 282, __pyx_L1_error))
  /*else*/ {
    __pyx_v_info->format = ((char *)malloc(0xFF));

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283
 *             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_TraceLine(283,0,__PYX_ERR(2, 283, __pyx_L1_error))
    (__pyx_v_info->format[0]) = '^';

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284
 *                 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_TraceLine(284,0,__PYX_ERR(2, 284, __pyx_L1_error))
    __pyx_v_offset = 0;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 */
    __Pyx_TraceLine(285,0,__PYX_ERR(2, 285, __pyx_L1_error))
    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(2, 285, __pyx_L1_error)
    __pyx_v_f = __pyx_t_7;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    __Pyx_TraceLine(288,0,__PYX_ERR(2, 288, __pyx_L1_error))
    (__pyx_v_f[0]) = '\x00';
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # 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.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __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_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

/* 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));

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

static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  __Pyx_TraceCall("__releasebuffer__", __pyx_f[2], 290, 0, __PYX_ERR(2, 290, __pyx_L1_error));

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __Pyx_TraceLine(291,0,__PYX_ERR(2, 291, __pyx_L1_error))
  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  if (__pyx_t_1) {

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292
 *         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)
 */
    __Pyx_TraceLine(292,0,__PYX_ERR(2, 292, __pyx_L1_error))
    free(__pyx_v_info->format);

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293
 *             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_TraceLine(293,0,__PYX_ERR(2, 293, __pyx_L1_error))
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294
 *                 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_TraceLine(294,0,__PYX_ERR(2, 294, __pyx_L1_error))
    free(__pyx_v_info->strides);

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293
 *             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
 */
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("numpy.ndarray.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
}

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770
 * 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_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
  __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[2], 770, 0, __PYX_ERR(2, 770, __pyx_L1_error));

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_TraceLine(771,0,__PYX_ERR(2, 771, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773
 *     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_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
  __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[2], 773, 0, __PYX_ERR(2, 773, __pyx_L1_error));

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_TraceLine(774,0,__PYX_ERR(2, 774, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776
 *     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_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
  __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[2], 776, 0, __PYX_ERR(2, 776, __pyx_L1_error));

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777
 * 
 * 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_TraceLine(777,0,__PYX_ERR(2, 777, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779
 *     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_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
  __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[2], 779, 0, __PYX_ERR(2, 779, __pyx_L1_error));

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780
 * 
 * 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_TraceLine(780,0,__PYX_ERR(2, 780, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782
 *     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_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
  __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[2], 782, 0, __PYX_ERR(2, 782, __pyx_L1_error));

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783
 * 
 * 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_TraceLine(783,0,__PYX_ERR(2, 783, __pyx_L1_error))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785
 *     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_TraceDeclarations
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  char *__pyx_t_9;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
  __Pyx_TraceCall("_util_dtypestring", __pyx_f[2], 785, 0, __PYX_ERR(2, 785, __pyx_L1_error));

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790
 * 
 *     cdef dtype child
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __Pyx_TraceLine(790,0,__PYX_ERR(2, 790, __pyx_L1_error))
  __pyx_v_endian_detector = 1;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791
 *     cdef dtype child
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __Pyx_TraceLine(791,0,__PYX_ERR(2, 791, __pyx_L1_error))
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  __Pyx_TraceLine(794,0,__PYX_ERR(2, 794, __pyx_L1_error))
  if (unlikely(__pyx_v_descr->names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(2, 794, __pyx_L1_error)
  }
  __pyx_t_1 = __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_ERR(2, 794, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    __Pyx_TraceLine(795,0,__PYX_ERR(2, 795, __pyx_L1_error))
    if (unlikely(__pyx_v_descr->fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 795, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 795, __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 %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 795, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 */
    __Pyx_TraceLine(796,0,__PYX_ERR(2, 796, __pyx_L1_error))
    if (likely(__pyx_v_fields != Py_None)) {
      PyObject* sequence = __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_ERR(2, 796, __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_ERR(2, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 796, __pyx_L1_error)
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 796, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __Pyx_TraceLine(798,0,__PYX_ERR(2, 798, __pyx_L1_error))
    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 798, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
    if (__pyx_t_6) {

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799
 * 
 *         if (end - f) - <int>(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_TraceLine(799,0,__PYX_ERR(2, 799, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(2, 799, __pyx_L1_error)

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    }

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(801,0,__PYX_ERR(2, 801, __pyx_L1_error))
    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
    if (!__pyx_t_7) {
      goto __pyx_L8_next_or;
    } else {
    }
    __pyx_t_7 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_L8_next_or:;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(802,0,__PYX_ERR(2, 802, __pyx_L1_error))
    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(801,0,__PYX_ERR(2, 801, __pyx_L1_error))
    if (__pyx_t_6) {

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(803,0,__PYX_ERR(2, 803, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 803, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(2, 803, __pyx_L1_error)

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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")
 */
    }

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    __Pyx_TraceLine(813,0,__PYX_ERR(2, 813, __pyx_L1_error))
    while (1) {
      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 813, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 813, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_6) break;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      __Pyx_TraceLine(814,0,__PYX_ERR(2, 814, __pyx_L1_error))
      (__pyx_v_f[0]) = 0x78;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __Pyx_TraceLine(815,0,__PYX_ERR(2, 815, __pyx_L1_error))
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __Pyx_TraceLine(816,0,__PYX_ERR(2, 816, __pyx_L1_error))
      __pyx_t_8 = 0;
      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
    }

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __Pyx_TraceLine(818,0,__PYX_ERR(2, 818, __pyx_L1_error))
    __pyx_t_8 = 0;
    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __Pyx_TraceLine(820,0,__PYX_ERR(2, 820, __pyx_L1_error))
    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
    if (__pyx_t_6) {

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __Pyx_TraceLine(821,0,__PYX_ERR(2, 821, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 821, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __Pyx_TraceLine(822,0,__PYX_ERR(2, 822, __pyx_L1_error))
      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
      if (__pyx_t_6) {

        /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(823,0,__PYX_ERR(2, 823, __pyx_L1_error))
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 823, __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_ERR(2, 823, __pyx_L1_error)

        /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(826,0,__PYX_ERR(2, 826, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 826, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 826, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(827,0,__PYX_ERR(2, 827, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 827, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 827, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 827, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(828,0,__PYX_ERR(2, 828, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 828, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 828, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x68;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(829,0,__PYX_ERR(2, 829, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 829, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 829, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(830,0,__PYX_ERR(2, 830, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 830, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 830, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 830, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x69;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(831,0,__PYX_ERR(2, 831, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 831, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 831, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(832,0,__PYX_ERR(2, 832, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 832, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x6C;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(833,0,__PYX_ERR(2, 833, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 833, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 833, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 833, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(834,0,__PYX_ERR(2, 834, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 834, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 834, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x71;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(835,0,__PYX_ERR(2, 835, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 835, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 835, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(836,0,__PYX_ERR(2, 836, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 836, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 836, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 836, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x66;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(837,0,__PYX_ERR(2, 837, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x64;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(838,0,__PYX_ERR(2, 838, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x67;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(839,0,__PYX_ERR(2, 839, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x66;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(840,0,__PYX_ERR(2, 840, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x64;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(841,0,__PYX_ERR(2, 841, __pyx_L1_error))
      __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 0x67;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(842,0,__PYX_ERR(2, 842, __pyx_L1_error))
      __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L15;
      }

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_TraceLine(844,0,__PYX_ERR(2, 844, __pyx_L1_error))
      /*else*/ {
        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(2, 844, __pyx_L1_error)
      }
      __pyx_L15:;

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __Pyx_TraceLine(845,0,__PYX_ERR(2, 845, __pyx_L1_error))
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
      goto __pyx_L13;
    }

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
    __Pyx_TraceLine(849,0,__PYX_ERR(2, 849, __pyx_L1_error))
    /*else*/ {
      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(2, 849, __pyx_L1_error)
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
    __Pyx_TraceLine(794,0,__PYX_ERR(2, 794, __pyx_L1_error))
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_TraceLine(850,0,__PYX_ERR(2, 850, __pyx_L1_error))
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785
 *     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.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966
 * 
 * 
 * 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_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_array_base", 0);
  __Pyx_TraceCall("set_array_base", __pyx_f[2], 966, 0, __PYX_ERR(2, 966, __pyx_L1_error));

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
  __Pyx_TraceLine(968,0,__PYX_ERR(2, 968, __pyx_L1_error))
  __pyx_t_1 = (__pyx_v_base == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __Pyx_TraceLine(969,0,__PYX_ERR(2, 969, __pyx_L1_error))
    __pyx_v_baseptr = NULL;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
    goto __pyx_L3;
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
  __Pyx_TraceLine(971,0,__PYX_ERR(2, 971, __pyx_L1_error))
  /*else*/ {
    Py_INCREF(__pyx_v_base);

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr
 */
    __Pyx_TraceLine(972,0,__PYX_ERR(2, 972, __pyx_L1_error))
    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
 *      arr.base = baseptr
 * 
 */
  __Pyx_TraceLine(973,0,__PYX_ERR(2, 973, __pyx_L1_error))
  Py_XDECREF(__pyx_v_arr->base);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __Pyx_TraceLine(974,0,__PYX_ERR(2, 974, __pyx_L1_error))
  __pyx_v_arr->base = __pyx_v_baseptr;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_TraceReturn(Py_None, 0);
  __Pyx_RefNannyFinishContext();
}

/* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *      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_TraceDeclarations
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);
  __Pyx_TraceCall("get_array_base", __pyx_f[2], 976, 0, __PYX_ERR(2, 976, __pyx_L1_error));

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __Pyx_TraceLine(977,0,__PYX_ERR(2, 977, __pyx_L1_error))
  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  if (__pyx_t_1) {

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <object>arr.base
 */
    __Pyx_TraceLine(978,0,__PYX_ERR(2, 978, __pyx_L1_error))
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
  __Pyx_TraceLine(980,0,__PYX_ERR(2, 980, __pyx_L1_error))
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r, 0);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk __pyx_vtable_5bcolz_10carray_ext_chunk;

static PyObject *__pyx_tp_new_5bcolz_10carray_ext_chunk(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5bcolz_10carray_ext_chunk *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)o);
  p->__pyx_vtab = __pyx_vtabptr_5bcolz_10carray_ext_chunk;
  p->dobject = Py_None; Py_INCREF(Py_None);
  p->atom = Py_None; Py_INCREF(Py_None);
  p->constant = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_5bcolz_10carray_ext_5chunk_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5bcolz_10carray_ext_chunk(PyObject *o) {
  struct __pyx_obj_5bcolz_10carray_ext_chunk *p = (struct __pyx_obj_5bcolz_10carray_ext_chunk *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->dobject);
  Py_CLEAR(p->atom);
  Py_CLEAR(p->constant);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5bcolz_10carray_ext_chunk(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *p = (struct __pyx_obj_5bcolz_10carray_ext_chunk *)o;
  if (p->dobject) {
    e = (*v)(p->dobject, a); if (e) return e;
  }
  if (p->atom) {
    e = (*v)(p->atom, a); if (e) return e;
  }
  if (p->constant) {
    e = (*v)(p->constant, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5bcolz_10carray_ext_chunk(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5bcolz_10carray_ext_chunk *p = (struct __pyx_obj_5bcolz_10carray_ext_chunk *)o;
  tmp = ((PyObject*)p->dobject);
  p->dobject = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->atom);
  p->atom = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->constant);
  p->constant = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_5bcolz_10carray_ext_chunk(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_5bcolz_10carray_ext_chunk(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_5chunk_9__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_5chunk_dtype(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_5chunk_5dtype_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_5chunk_atomsize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_5chunk_8atomsize_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_5chunk_atomsize(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_5chunk_8atomsize_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_5chunk_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_5chunk_8itemsize_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_5chunk_itemsize(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_5chunk_8itemsize_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_5chunk_blocksize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_5chunk_9blocksize_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_5chunk_blocksize(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_5chunk_9blocksize_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_5chunk_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_5chunk_6nbytes_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_5chunk_nbytes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_5chunk_6nbytes_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_5chunk_cbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_5chunk_6cbytes_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_5chunk_cbytes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_5chunk_6cbytes_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_5bcolz_10carray_ext_chunk[] = {
  {"getdata", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_5chunk_3getdata, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_5chunk_2getdata},
  {"getudata", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_5chunk_5getudata, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_5chunk_4getudata},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5bcolz_10carray_ext_chunk[] = {
  {(char *)"dtype", __pyx_getprop_5bcolz_10carray_ext_5chunk_dtype, 0, (char *)"The NumPy dtype for this chunk.", 0},
  {(char *)"atomsize", __pyx_getprop_5bcolz_10carray_ext_5chunk_atomsize, __pyx_setprop_5bcolz_10carray_ext_5chunk_atomsize, (char *)"atomsize: 'int'", 0},
  {(char *)"itemsize", __pyx_getprop_5bcolz_10carray_ext_5chunk_itemsize, __pyx_setprop_5bcolz_10carray_ext_5chunk_itemsize, (char *)"itemsize: 'int'", 0},
  {(char *)"blocksize", __pyx_getprop_5bcolz_10carray_ext_5chunk_blocksize, __pyx_setprop_5bcolz_10carray_ext_5chunk_blocksize, (char *)"blocksize: 'int'", 0},
  {(char *)"nbytes", __pyx_getprop_5bcolz_10carray_ext_5chunk_nbytes, __pyx_setprop_5bcolz_10carray_ext_5chunk_nbytes, (char *)"nbytes: 'int'", 0},
  {(char *)"cbytes", __pyx_getprop_5bcolz_10carray_ext_5chunk_cbytes, __pyx_setprop_5bcolz_10carray_ext_5chunk_cbytes, (char *)"cbytes: 'int'", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_chunk = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_5bcolz_10carray_ext_chunk, /*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_chunk = {
  0, /*mp_length*/
  __pyx_pw_5bcolz_10carray_ext_5chunk_7__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_5bcolz_10carray_ext_chunk, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_5bcolz_10carray_ext_chunk = {
  PyVarObject_HEAD_INIT(0, 0)
  "bcolz.carray_ext.chunk", /*tp_name*/
  sizeof(struct __pyx_obj_5bcolz_10carray_ext_chunk), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5bcolz_10carray_ext_chunk, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_5bcolz_10carray_ext_5chunk_13__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_chunk, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_chunk, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_5bcolz_10carray_ext_5chunk_11__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    chunk(array, atom, cparams)\n\n    Compressed in-memory container for a data chunk.\n\n    This class is meant to be used only by the `carray` class.\n\n    ", /*tp_doc*/
  __pyx_tp_traverse_5bcolz_10carray_ext_chunk, /*tp_traverse*/
  __pyx_tp_clear_5bcolz_10carray_ext_chunk, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5bcolz_10carray_ext_chunk, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5bcolz_10carray_ext_chunk, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5bcolz_10carray_ext_chunk, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_5bcolz_10carray_ext_chunks __pyx_vtable_5bcolz_10carray_ext_chunks;

static PyObject *__pyx_tp_new_5bcolz_10carray_ext_chunks(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5bcolz_10carray_ext_chunks *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5bcolz_10carray_ext_chunks *)o);
  p->__pyx_vtab = __pyx_vtabptr_5bcolz_10carray_ext_chunks;
  p->_rootdir = Py_None; Py_INCREF(Py_None);
  p->_mode = Py_None; Py_INCREF(Py_None);
  p->dtype = Py_None; Py_INCREF(Py_None);
  p->cparams = Py_None; Py_INCREF(Py_None);
  p->lastchunkarr = Py_None; Py_INCREF(Py_None);
  p->chunk_cached = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_5bcolz_10carray_ext_6chunks_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5bcolz_10carray_ext_chunks(PyObject *o) {
  struct __pyx_obj_5bcolz_10carray_ext_chunks *p = (struct __pyx_obj_5bcolz_10carray_ext_chunks *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_rootdir);
  Py_CLEAR(p->_mode);
  Py_CLEAR(p->dtype);
  Py_CLEAR(p->cparams);
  Py_CLEAR(p->lastchunkarr);
  Py_CLEAR(p->chunk_cached);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5bcolz_10carray_ext_chunks(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5bcolz_10carray_ext_chunks *p = (struct __pyx_obj_5bcolz_10carray_ext_chunks *)o;
  if (p->_rootdir) {
    e = (*v)(p->_rootdir, a); if (e) return e;
  }
  if (p->_mode) {
    e = (*v)(p->_mode, a); if (e) return e;
  }
  if (p->dtype) {
    e = (*v)(p->dtype, a); if (e) return e;
  }
  if (p->cparams) {
    e = (*v)(p->cparams, a); if (e) return e;
  }
  if (p->lastchunkarr) {
    e = (*v)(p->lastchunkarr, a); if (e) return e;
  }
  if (p->chunk_cached) {
    e = (*v)(p->chunk_cached, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5bcolz_10carray_ext_chunks(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5bcolz_10carray_ext_chunks *p = (struct __pyx_obj_5bcolz_10carray_ext_chunks *)o;
  tmp = ((PyObject*)p->_rootdir);
  p->_rootdir = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_mode);
  p->_mode = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->dtype);
  p->dtype = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->cparams);
  p->cparams = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->lastchunkarr);
  p->lastchunkarr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->chunk_cached);
  p->chunk_cached = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_5bcolz_10carray_ext_chunks(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_5bcolz_10carray_ext_chunks(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_6chunks_9__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6chunks_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6chunks_4mode_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_6chunks_mode(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_6chunks_4mode_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6chunks_rootdir(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6chunks_7rootdir_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_6chunks_rootdir(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_6chunks_7rootdir_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6chunks_datadir(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6chunks_7datadir_1__get__(o);
}

static PyMethodDef __pyx_methods_5bcolz_10carray_ext_chunks[] = {
  {"__next__", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6chunks_5__next__, METH_NOARGS|METH_COEXIST, 0},
  {"free_cachemem", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6chunks_13free_cachemem, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6chunks_12free_cachemem},
  {"append", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6chunks_15append, METH_O, __pyx_doc_5bcolz_10carray_ext_6chunks_14append},
  {"flush", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6chunks_17flush, METH_O, __pyx_doc_5bcolz_10carray_ext_6chunks_16flush},
  {"pop", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6chunks_19pop, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6chunks_18pop},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5bcolz_10carray_ext_chunks[] = {
  {(char *)"mode", __pyx_getprop_5bcolz_10carray_ext_6chunks_mode, __pyx_setprop_5bcolz_10carray_ext_6chunks_mode, (char *)"The mode used to create/open the `mode`.", 0},
  {(char *)"rootdir", __pyx_getprop_5bcolz_10carray_ext_6chunks_rootdir, __pyx_setprop_5bcolz_10carray_ext_6chunks_rootdir, (char *)"The on-disk directory used for persistency.", 0},
  {(char *)"datadir", __pyx_getprop_5bcolz_10carray_ext_6chunks_datadir, 0, (char *)"The directory for data files.", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_chunks = {
  __pyx_pw_5bcolz_10carray_ext_6chunks_11__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_5bcolz_10carray_ext_chunks, /*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_chunks = {
  __pyx_pw_5bcolz_10carray_ext_6chunks_11__len__, /*mp_length*/
  __pyx_pw_5bcolz_10carray_ext_6chunks_7__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_5bcolz_10carray_ext_chunks, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_5bcolz_10carray_ext_chunks = {
  PyVarObject_HEAD_INIT(0, 0)
  "bcolz.carray_ext.chunks", /*tp_name*/
  sizeof(struct __pyx_obj_5bcolz_10carray_ext_chunks), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5bcolz_10carray_ext_chunks, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_chunks, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_chunks, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Store the different carray chunks in a directory on-disk.", /*tp_doc*/
  __pyx_tp_traverse_5bcolz_10carray_ext_chunks, /*tp_traverse*/
  __pyx_tp_clear_5bcolz_10carray_ext_chunks, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_5bcolz_10carray_ext_6chunks_3__iter__, /*tp_iter*/
  __pyx_pw_5bcolz_10carray_ext_6chunks_5__next__, /*tp_iternext*/
  __pyx_methods_5bcolz_10carray_ext_chunks, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5bcolz_10carray_ext_chunks, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5bcolz_10carray_ext_chunks, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_5bcolz_10carray_ext_carray __pyx_vtable_5bcolz_10carray_ext_carray;

static PyObject *__pyx_tp_new_5bcolz_10carray_ext_carray(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_5bcolz_10carray_ext_carray *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5bcolz_10carray_ext_carray *)o);
  p->__pyx_vtab = __pyx_vtabptr_5bcolz_10carray_ext_carray;
  p->lastchunkarr = Py_None; Py_INCREF(Py_None);
  p->where_arr = Py_None; Py_INCREF(Py_None);
  p->arr1 = Py_None; Py_INCREF(Py_None);
  p->_cparams = Py_None; Py_INCREF(Py_None);
  p->_dflt = Py_None; Py_INCREF(Py_None);
  p->_dtype = Py_None; Py_INCREF(Py_None);
  p->_safe = Py_None; Py_INCREF(Py_None);
  p->chunks = Py_None; Py_INCREF(Py_None);
  p->_rootdir = Py_None; Py_INCREF(Py_None);
  p->datadir = Py_None; Py_INCREF(Py_None);
  p->metadir = Py_None; Py_INCREF(Py_None);
  p->_mode = Py_None; Py_INCREF(Py_None);
  p->_attrs = Py_None; Py_INCREF(Py_None);
  p->iter_exhausted = Py_None; Py_INCREF(Py_None);
  p->iobuf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->where_buf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->blockcache = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_5bcolz_10carray_ext_6carray_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5bcolz_10carray_ext_carray(PyObject *o) {
  struct __pyx_obj_5bcolz_10carray_ext_carray *p = (struct __pyx_obj_5bcolz_10carray_ext_carray *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->lastchunkarr);
  Py_CLEAR(p->where_arr);
  Py_CLEAR(p->arr1);
  Py_CLEAR(p->_cparams);
  Py_CLEAR(p->_dflt);
  Py_CLEAR(p->_dtype);
  Py_CLEAR(p->_safe);
  Py_CLEAR(p->chunks);
  Py_CLEAR(p->_rootdir);
  Py_CLEAR(p->datadir);
  Py_CLEAR(p->metadir);
  Py_CLEAR(p->_mode);
  Py_CLEAR(p->_attrs);
  Py_CLEAR(p->iter_exhausted);
  Py_CLEAR(p->iobuf);
  Py_CLEAR(p->where_buf);
  Py_CLEAR(p->blockcache);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5bcolz_10carray_ext_carray(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5bcolz_10carray_ext_carray *p = (struct __pyx_obj_5bcolz_10carray_ext_carray *)o;
  if (p->lastchunkarr) {
    e = (*v)(p->lastchunkarr, a); if (e) return e;
  }
  if (p->where_arr) {
    e = (*v)(p->where_arr, a); if (e) return e;
  }
  if (p->arr1) {
    e = (*v)(p->arr1, a); if (e) return e;
  }
  if (p->_cparams) {
    e = (*v)(p->_cparams, a); if (e) return e;
  }
  if (p->_dflt) {
    e = (*v)(p->_dflt, a); if (e) return e;
  }
  if (p->_dtype) {
    e = (*v)(p->_dtype, a); if (e) return e;
  }
  if (p->_safe) {
    e = (*v)(p->_safe, a); if (e) return e;
  }
  if (p->chunks) {
    e = (*v)(p->chunks, a); if (e) return e;
  }
  if (p->_rootdir) {
    e = (*v)(p->_rootdir, a); if (e) return e;
  }
  if (p->datadir) {
    e = (*v)(p->datadir, a); if (e) return e;
  }
  if (p->metadir) {
    e = (*v)(p->metadir, a); if (e) return e;
  }
  if (p->_mode) {
    e = (*v)(p->_mode, a); if (e) return e;
  }
  if (p->_attrs) {
    e = (*v)(p->_attrs, a); if (e) return e;
  }
  if (p->iter_exhausted) {
    e = (*v)(p->iter_exhausted, a); if (e) return e;
  }
  if (p->iobuf) {
    e = (*v)(((PyObject*)p->iobuf), a); if (e) return e;
  }
  if (p->where_buf) {
    e = (*v)(((PyObject*)p->where_buf), a); if (e) return e;
  }
  if (p->blockcache) {
    e = (*v)(((PyObject*)p->blockcache), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5bcolz_10carray_ext_carray(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5bcolz_10carray_ext_carray *p = (struct __pyx_obj_5bcolz_10carray_ext_carray *)o;
  tmp = ((PyObject*)p->lastchunkarr);
  p->lastchunkarr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->where_arr);
  p->where_arr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->arr1);
  p->arr1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_cparams);
  p->_cparams = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_dflt);
  p->_dflt = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_dtype);
  p->_dtype = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_safe);
  p->_safe = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->chunks);
  p->chunks = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_rootdir);
  p->_rootdir = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->datadir);
  p->datadir = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->metadir);
  p->metadir = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_mode);
  p->_mode = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_attrs);
  p->_attrs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iter_exhausted);
  p->iter_exhausted = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->iobuf);
  p->iobuf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->where_buf);
  p->where_buf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->blockcache);
  p->blockcache = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_5bcolz_10carray_ext_carray(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_5bcolz_10carray_ext_carray(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_6carray_41__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_leftover_ptr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_12leftover_ptr_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_leftover_array(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_14leftover_array_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_leftover_bytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_14leftover_bytes_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_leftover_elements(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_17leftover_elements_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_nchunks(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_7nchunks_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_partitions(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_10partitions_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_attrs(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_5attrs_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_cbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_6cbytes_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_chunklen(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_8chunklen_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_cparams(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_7cparams_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_dflt(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_4dflt_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_dtype(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_5dtype_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_len(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_3len_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_mode(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_4mode_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_6carray_mode(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_6carray_4mode_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_6nbytes_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_nleftover(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_9nleftover_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_4ndim_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_safe(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_4safe_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_5shape_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_4size_1__get__(o);
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_rootdir(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_7rootdir_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_6carray_rootdir(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_6carray_7rootdir_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_8itemsize_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_6carray_itemsize(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_6carray_8itemsize_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_atomsize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_8atomsize_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_6carray_atomsize(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_6carray_8atomsize_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5bcolz_10carray_ext_6carray_chunks(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5bcolz_10carray_ext_6carray_6chunks_1__get__(o);
}

static int __pyx_setprop_5bcolz_10carray_ext_6carray_chunks(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5bcolz_10carray_ext_6carray_6chunks_3__set__(o, v);
  }
  else {
    return __pyx_pw_5bcolz_10carray_ext_6carray_6chunks_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5bcolz_10carray_ext_carray[] = {
  {"_create_carray", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_3_create_carray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_2_create_carray},
  {"_open_carray", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_5_open_carray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_4_open_carray},
  {"_fill_chunks", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_7_fill_chunks, METH_O, __pyx_doc_5bcolz_10carray_ext_6carray_6_fill_chunks},
  {"_mkdirs", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_9_mkdirs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_8_mkdirs},
  {"_write_meta", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_11_write_meta, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_10_write_meta},
  {"_read_meta", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_13_read_meta, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_12_read_meta},
  {"_store_obj", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_15_store_obj, METH_O, __pyx_doc_5bcolz_10carray_ext_6carray_14_store_obj},
  {"append", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_17append, METH_O, __pyx_doc_5bcolz_10carray_ext_6carray_16append},
  {"trim", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_19trim, METH_O, __pyx_doc_5bcolz_10carray_ext_6carray_18trim},
  {"resize", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_21resize, METH_O, __pyx_doc_5bcolz_10carray_ext_6carray_20resize},
  {"reshape", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_23reshape, METH_O, __pyx_doc_5bcolz_10carray_ext_6carray_22reshape},
  {"copy", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_25copy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_24copy},
  {"view", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_27view, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_26view},
  {"sum", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_29sum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_28sum},
  {"__sizeof__", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_33__sizeof__, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_32__sizeof__},
  {"free_cachemem", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_35free_cachemem, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_34free_cachemem},
  {"_getitem_object", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_37_getitem_object, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_36_getitem_object},
  {"_set_entire_carray", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_43_set_entire_carray, METH_O, __pyx_doc_5bcolz_10carray_ext_6carray_42_set_entire_carray},
  {"_getrange", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_45_getrange, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_44_getrange},
  {"iter", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_49iter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_48iter},
  {"_init_iter", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_51_init_iter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_50_init_iter},
  {"wheretrue", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_53wheretrue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_52wheretrue},
  {"_init_wheretrue", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_55_init_wheretrue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_54_init_wheretrue},
  {"where", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_57where, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_56where},
  {"_init_where", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_59_init_where, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_58_init_where},
  {"__next__", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_61__next__, METH_NOARGS|METH_COEXIST, 0},
  {"_update_disk_sizes", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_63_update_disk_sizes, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_62_update_disk_sizes},
  {"flush", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_65flush, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_64flush},
  {"purge", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_67purge, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_66purge},
  {"__reduce__", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_73__reduce__, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_72__reduce__},
  {"__enter__", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_75__enter__, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_74__enter__},
  {"__exit__", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_77__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_76__exit__},
  {"__array__", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_79__array__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_78__array__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5bcolz_10carray_ext_carray[] = {
  {(char *)"leftover_ptr", __pyx_getprop_5bcolz_10carray_ext_6carray_leftover_ptr, 0, (char *)"Pointer referring to the leftover_array", 0},
  {(char *)"leftover_array", __pyx_getprop_5bcolz_10carray_ext_6carray_leftover_array, 0, (char *)"Array containing the leftovers chunk (uncompressed chunk)", 0},
  {(char *)"leftover_bytes", __pyx_getprop_5bcolz_10carray_ext_6carray_leftover_bytes, 0, (char *)"Number of bytes in the leftover_array", 0},
  {(char *)"leftover_elements", __pyx_getprop_5bcolz_10carray_ext_6carray_leftover_elements, 0, (char *)"Number of elements in the leftover_array", 0},
  {(char *)"nchunks", __pyx_getprop_5bcolz_10carray_ext_6carray_nchunks, 0, (char *)"Number of chunks in the carray", 0},
  {(char *)"partitions", __pyx_getprop_5bcolz_10carray_ext_6carray_partitions, 0, (char *)"List of tuples indicating the bounds for each chunk", 0},
  {(char *)"attrs", __pyx_getprop_5bcolz_10carray_ext_6carray_attrs, 0, (char *)"The attribute accessor.\n\n        See Also\n        --------\n\n        attrs.attrs\n\n        ", 0},
  {(char *)"cbytes", __pyx_getprop_5bcolz_10carray_ext_6carray_cbytes, 0, (char *)"The compressed size of this object (in bytes).", 0},
  {(char *)"chunklen", __pyx_getprop_5bcolz_10carray_ext_6carray_chunklen, 0, (char *)"The chunklen of this object (in rows).", 0},
  {(char *)"cparams", __pyx_getprop_5bcolz_10carray_ext_6carray_cparams, 0, (char *)"The compression parameters for this object.", 0},
  {(char *)"dflt", __pyx_getprop_5bcolz_10carray_ext_6carray_dflt, 0, (char *)"The default value of this object.", 0},
  {(char *)"dtype", __pyx_getprop_5bcolz_10carray_ext_6carray_dtype, 0, (char *)"The dtype of this object.", 0},
  {(char *)"len", __pyx_getprop_5bcolz_10carray_ext_6carray_len, 0, (char *)"The length (leading dimension) of this object.", 0},
  {(char *)"mode", __pyx_getprop_5bcolz_10carray_ext_6carray_mode, __pyx_setprop_5bcolz_10carray_ext_6carray_mode, (char *)"The mode used to create/open the `mode`.", 0},
  {(char *)"nbytes", __pyx_getprop_5bcolz_10carray_ext_6carray_nbytes, 0, (char *)"The original (uncompressed) size of this object (in bytes).", 0},
  {(char *)"nleftover", __pyx_getprop_5bcolz_10carray_ext_6carray_nleftover, 0, (char *)"The number of leftover elements.", 0},
  {(char *)"ndim", __pyx_getprop_5bcolz_10carray_ext_6carray_ndim, 0, (char *)"The number of dimensions of this object.", 0},
  {(char *)"safe", __pyx_getprop_5bcolz_10carray_ext_6carray_safe, 0, (char *)"Whether or not to perform type/shape checks on every operation.", 0},
  {(char *)"shape", __pyx_getprop_5bcolz_10carray_ext_6carray_shape, 0, (char *)"The shape of this object.", 0},
  {(char *)"size", __pyx_getprop_5bcolz_10carray_ext_6carray_size, 0, (char *)"The size of this object.", 0},
  {(char *)"rootdir", __pyx_getprop_5bcolz_10carray_ext_6carray_rootdir, __pyx_setprop_5bcolz_10carray_ext_6carray_rootdir, (char *)"The on-disk directory used for persistency.", 0},
  {(char *)"itemsize", __pyx_getprop_5bcolz_10carray_ext_6carray_itemsize, __pyx_setprop_5bcolz_10carray_ext_6carray_itemsize, (char *)"itemsize: 'int'", 0},
  {(char *)"atomsize", __pyx_getprop_5bcolz_10carray_ext_6carray_atomsize, __pyx_setprop_5bcolz_10carray_ext_6carray_atomsize, (char *)"atomsize: 'int'", 0},
  {(char *)"chunks", __pyx_getprop_5bcolz_10carray_ext_6carray_chunks, __pyx_setprop_5bcolz_10carray_ext_6carray_chunks, (char *)"chunks: object", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_carray = {
  __pyx_pw_5bcolz_10carray_ext_6carray_31__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_5bcolz_10carray_ext_carray, /*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_carray = {
  __pyx_pw_5bcolz_10carray_ext_6carray_31__len__, /*mp_length*/
  __pyx_pw_5bcolz_10carray_ext_6carray_39__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_5bcolz_10carray_ext_carray, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_5bcolz_10carray_ext_carray = {
  PyVarObject_HEAD_INIT(0, 0)
  "bcolz.carray_ext.carray", /*tp_name*/
  sizeof(struct __pyx_obj_5bcolz_10carray_ext_carray), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5bcolz_10carray_ext_carray, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_5bcolz_10carray_ext_6carray_71__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_carray, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_carray, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_5bcolz_10carray_ext_6carray_69__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    carray(array, cparams=None, dtype=None, dflt=None, expectedlen=None,\n    chunklen=None, rootdir=None, mode='a')\n\n    A compressed and enlargeable data container either in-memory or on-disk.\n\n    `carray` exposes a series of methods for dealing with the compressed\n    container in a NumPy-like way.\n\n    Parameters\n    ----------\n    array : a NumPy-like object\n        This is taken as the input to create the carray.  It can be any Python\n        object that can be converted into a NumPy object.  The data type of\n        the resulting carray will be the same as this NumPy object.\n    cparams : instance of the `cparams` class, optional\n        Parameters to the internal Blosc compressor.\n    dtype : NumPy dtype\n        Force this `dtype` for the carray (rather than the `array` one).\n    dflt : Python or NumPy scalar\n        The value to be used when enlarging the carray.  If None,\n        the default is\n        filling with zeros.\n    expectedlen : int, optional\n        A guess on the expected length of this object.  This will serve to\n        decide the best `chunklen` used for compression and memory I/O\n        purposes.\n    chunklen : int, optional\n        The number of items that fits into a chunk.  By specifying it you can\n        explicitely set the chunk size used for compression and memory I/O.\n        Only use it if you know what are you doing.\n    rootdir : str, optional\n        The directory where all the data and metadata will be stored.  If\n        specified, then the carray object will be disk-based (i.e. all chunks\n        will live on-disk, not in memory) and persistent (i.e. it can be\n        restored in other session, e.g. via the `open()` top-level function).\n    safe : bool (defaults to True)\n        Coerces inputs to array types.  Set to false if you always give\n        correctly typed, strided, and shaped arrays and if you never use Object\n        dtype.\n    mode : str, optional\n        The mode that a"" *persistent* carray should be created/opened.  The\n        values can be:\n\n        * 'r' for read-only\n        * 'w' for read/write.  During carray creation, the `rootdir` will be\n          removed if it exists.  During carray opening, the carray will be\n          resized to 0.\n        * 'a' for append (possible data inside `rootdir` will not be\n          removed).\n\n    ", /*tp_doc*/
  __pyx_tp_traverse_5bcolz_10carray_ext_carray, /*tp_traverse*/
  __pyx_tp_clear_5bcolz_10carray_ext_carray, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_5bcolz_10carray_ext_6carray_47__iter__, /*tp_iter*/
  __pyx_pw_5bcolz_10carray_ext_6carray_61__next__, /*tp_iternext*/
  __pyx_methods_5bcolz_10carray_ext_carray, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5bcolz_10carray_ext_carray, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5bcolz_10carray_ext_carray, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "carray_ext",
    0, /* 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_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 0},
  {&__pyx_n_s_BLOSCPACK_HEADER_LENGTH, __pyx_k_BLOSCPACK_HEADER_LENGTH, sizeof(__pyx_k_BLOSCPACK_HEADER_LENGTH), 0, 0, 1, 1},
  {&__pyx_n_s_BLOSC_HEADER_LENGTH, __pyx_k_BLOSC_HEADER_LENGTH, sizeof(__pyx_k_BLOSC_HEADER_LENGTH), 0, 0, 1, 1},
  {&__pyx_kp_s_Compressor_s_is_not_available_in, __pyx_k_Compressor_s_is_not_available_in, sizeof(__pyx_k_Compressor_s_is_not_available_in), 0, 0, 1, 0},
  {&__pyx_n_s_DATA_DIR, __pyx_k_DATA_DIR, sizeof(__pyx_k_DATA_DIR), 0, 0, 1, 1},
  {&__pyx_n_s_EXTENSION, __pyx_k_EXTENSION, sizeof(__pyx_k_EXTENSION), 0, 0, 1, 1},
  {&__pyx_n_s_FORMAT_VERSION, __pyx_k_FORMAT_VERSION, sizeof(__pyx_k_FORMAT_VERSION), 0, 0, 1, 1},
  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
  {&__pyx_n_s_HIGHEST_PROTOCOL, __pyx_k_HIGHEST_PROTOCOL, sizeof(__pyx_k_HIGHEST_PROTOCOL), 0, 0, 1, 1},
  {&__pyx_kp_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 0},
  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_n_s_IntType, __pyx_k_IntType, sizeof(__pyx_k_IntType), 0, 0, 1, 1},
  {&__pyx_n_s_KB, __pyx_k_KB, sizeof(__pyx_k_KB), 0, 0, 1, 1},
  {&__pyx_n_s_MAGIC, __pyx_k_MAGIC, sizeof(__pyx_k_MAGIC), 0, 0, 1, 1},
  {&__pyx_n_s_MAXINT, __pyx_k_MAXINT, sizeof(__pyx_k_MAXINT), 0, 0, 1, 1},
  {&__pyx_n_s_MAX_CHUNKS, __pyx_k_MAX_CHUNKS, sizeof(__pyx_k_MAX_CHUNKS), 0, 0, 1, 1},
  {&__pyx_n_s_MAX_FORMAT_VERSION, __pyx_k_MAX_FORMAT_VERSION, sizeof(__pyx_k_MAX_FORMAT_VERSION), 0, 0, 1, 1},
  {&__pyx_n_s_MB, __pyx_k_MB, sizeof(__pyx_k_MB), 0, 0, 1, 1},
  {&__pyx_n_s_META_DIR, __pyx_k_META_DIR, sizeof(__pyx_k_META_DIR), 0, 0, 1, 1},
  {&__pyx_n_s_MainThread, __pyx_k_MainThread, sizeof(__pyx_k_MainThread), 0, 0, 1, 1},
  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1},
  {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1},
  {&__pyx_n_s_SIZES_FILE, __pyx_k_SIZES_FILE, sizeof(__pyx_k_SIZES_FILE), 0, 0, 1, 1},
  {&__pyx_n_s_STORAGE_FILE, __pyx_k_STORAGE_FILE, sizeof(__pyx_k_STORAGE_FILE), 0, 0, 1, 1},
  {&__pyx_n_s_SizeType, __pyx_k_SizeType, sizeof(__pyx_k_SizeType), 0, 0, 1, 1},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_kp_s_The_size_cannot_be_larger_than_2, __pyx_k_The_size_cannot_be_larger_than_2, sizeof(__pyx_k_The_size_cannot_be_larger_than_2), 0, 0, 1, 0},
  {&__pyx_kp_s_This_function_can_only_be_used_f, __pyx_k_This_function_can_only_be_used_f, sizeof(__pyx_k_This_function_can_only_be_used_f), 0, 0, 1, 0},
  {&__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_kp_s_You_need_at_least_to_pass_an_arr, __pyx_k_You_need_at_least_to_pass_an_arr, sizeof(__pyx_k_You_need_at_least_to_pass_an_arr), 0, 0, 1, 0},
  {&__pyx_kp_s__112, __pyx_k__112, sizeof(__pyx_k__112), 0, 0, 1, 0},
  {&__pyx_kp_b__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 0, 0},
  {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
  {&__pyx_kp_b__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 0, 0, 0},
  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_array2string, __pyx_k_array2string, sizeof(__pyx_k_array2string), 0, 0, 1, 1},
  {&__pyx_kp_s_array_dtype_does_not_match_with, __pyx_k_array_dtype_does_not_match_with, sizeof(__pyx_k_array_dtype_does_not_match_with), 0, 0, 1, 0},
  {&__pyx_kp_s_array_trailing_dimensions_do_not, __pyx_k_array_trailing_dimensions_do_not, sizeof(__pyx_k_array_trailing_dimensions_do_not), 0, 0, 1, 0},
  {&__pyx_kp_s_arrays_used_as_indices_must_be_i, __pyx_k_arrays_used_as_indices_must_be_i, sizeof(__pyx_k_arrays_used_as_indices_must_be_i), 0, 0, 1, 0},
  {&__pyx_kp_s_arrays_used_as_indices_must_be_o, __pyx_k_arrays_used_as_indices_must_be_o, sizeof(__pyx_k_arrays_used_as_indices_must_be_o), 0, 0, 1, 0},
  {&__pyx_n_s_arrlen, __pyx_k_arrlen, sizeof(__pyx_k_arrlen), 0, 0, 1, 1},
  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
  {&__pyx_n_s_atom, __pyx_k_atom, sizeof(__pyx_k_atom), 0, 0, 1, 1},
  {&__pyx_kp_s_atomic_size_cannot_be_zero, __pyx_k_atomic_size_cannot_be_zero, sizeof(__pyx_k_atomic_size_cannot_be_zero), 0, 0, 1, 0},
  {&__pyx_kp_s_atomic_size_is_too_large_2_GB, __pyx_k_atomic_size_is_too_large_2_GB, sizeof(__pyx_k_atomic_size_is_too_large_2_GB), 0, 0, 1, 0},
  {&__pyx_n_s_attrs, __pyx_k_attrs, sizeof(__pyx_k_attrs), 0, 0, 1, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_bcolz, __pyx_k_bcolz, sizeof(__pyx_k_bcolz), 0, 0, 1, 1},
  {&__pyx_n_s_bcolz_carray_ext, __pyx_k_bcolz_carray_ext, sizeof(__pyx_k_bcolz_carray_ext), 0, 0, 1, 1},
  {&__pyx_n_s_blen, __pyx_k_blen, sizeof(__pyx_k_blen), 0, 0, 1, 1},
  {&__pyx_n_s_blocksize, __pyx_k_blocksize, sizeof(__pyx_k_blocksize), 0, 0, 1, 1},
  {&__pyx_n_s_blosc_compressor_list, __pyx_k_blosc_compressor_list, sizeof(__pyx_k_blosc_compressor_list), 0, 0, 1, 1},
  {&__pyx_n_s_blosc_destroy, __pyx_k_blosc_destroy, sizeof(__pyx_k_blosc_destroy), 0, 0, 1, 1},
  {&__pyx_n_s_blosc_init, __pyx_k_blosc_init, sizeof(__pyx_k_blosc_init), 0, 0, 1, 1},
  {&__pyx_n_s_blosc_set_nthreads, __pyx_k_blosc_set_nthreads, sizeof(__pyx_k_blosc_set_nthreads), 0, 0, 1, 1},
  {&__pyx_n_s_blosc_version, __pyx_k_blosc_version, sizeof(__pyx_k_blosc_version), 0, 0, 1, 1},
  {&__pyx_n_s_blosclz, __pyx_k_blosclz, sizeof(__pyx_k_blosclz), 0, 0, 1, 1},
  {&__pyx_kp_s_blp, __pyx_k_blp, sizeof(__pyx_k_blp), 0, 0, 1, 0},
  {&__pyx_n_b_blpk, __pyx_k_blpk, sizeof(__pyx_k_blpk), 0, 0, 0, 1},
  {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
  {&__pyx_n_s_boolarr, __pyx_k_boolarr, sizeof(__pyx_k_boolarr), 0, 0, 1, 1},
  {&__pyx_kp_s_boolarr_is_not_an_array, __pyx_k_boolarr_is_not_an_array, sizeof(__pyx_k_boolarr_is_not_an_array), 0, 0, 1, 0},
  {&__pyx_kp_s_boolarr_is_not_an_array_of_bool, __pyx_k_boolarr_is_not_an_array_of_bool, sizeof(__pyx_k_boolarr_is_not_an_array_of_bool), 0, 0, 1, 0},
  {&__pyx_kp_s_boolarr_must_be_of_the_same_len, __pyx_k_boolarr_must_be_of_the_same_len, sizeof(__pyx_k_boolarr_must_be_of_the_same_len), 0, 0, 1, 0},
  {&__pyx_kp_s_boolean_array_length_must_match, __pyx_k_boolean_array_length_must_match, sizeof(__pyx_k_boolean_array_length_must_match), 0, 0, 1, 0},
  {&__pyx_kp_s_boolean_expression_outcome_must, __pyx_k_boolean_expression_outcome_must, sizeof(__pyx_k_boolean_expression_outcome_must), 0, 0, 1, 0},
  {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_build_carray, __pyx_k_build_carray, sizeof(__pyx_k_build_carray), 0, 0, 1, 1},
  {&__pyx_n_s_byte, __pyx_k_byte, sizeof(__pyx_k_byte), 0, 0, 1, 1},
  {&__pyx_n_s_calc_chunksize, __pyx_k_calc_chunksize, sizeof(__pyx_k_calc_chunksize), 0, 0, 1, 1},
  {&__pyx_kp_s_cannot_modify_data_because_mode, __pyx_k_cannot_modify_data_because_mode, sizeof(__pyx_k_cannot_modify_data_because_mode), 0, 0, 1, 0},
  {&__pyx_kp_s_cannot_modify_the_rootdir_value, __pyx_k_cannot_modify_the_rootdir_value, sizeof(__pyx_k_cannot_modify_the_rootdir_value), 0, 0, 1, 0},
  {&__pyx_kp_s_cannot_perform_reduce_with_flexi, __pyx_k_cannot_perform_reduce_with_flexi, sizeof(__pyx_k_cannot_perform_reduce_with_flexi), 0, 0, 1, 0},
  {&__pyx_kp_s_carray_s_s, __pyx_k_carray_s_s, sizeof(__pyx_k_carray_s_s), 0, 0, 1, 0},
  {&__pyx_n_s_cbytes, __pyx_k_cbytes, sizeof(__pyx_k_cbytes), 0, 0, 1, 1},
  {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1},
  {&__pyx_kp_s_chunk_filename_s_does_exist, __pyx_k_chunk_filename_s_does_exist, sizeof(__pyx_k_chunk_filename_s_does_exist), 0, 0, 1, 0},
  {&__pyx_kp_s_chunk_s_nbytes_d_cbytes_d_ratio, __pyx_k_chunk_s_nbytes_d_cbytes_d_ratio, sizeof(__pyx_k_chunk_s_nbytes_d_cbytes_d_ratio), 0, 0, 1, 0},
  {&__pyx_kp_s_chunkfile_s_not_found, __pyx_k_chunkfile_s_not_found, sizeof(__pyx_k_chunkfile_s_not_found), 0, 0, 1, 0},
  {&__pyx_n_s_chunklen, __pyx_k_chunklen, sizeof(__pyx_k_chunklen), 0, 0, 1, 1},
  {&__pyx_kp_s_chunklen_must_be_a_positive_inte, __pyx_k_chunklen_must_be_a_positive_inte, sizeof(__pyx_k_chunklen_must_be_a_positive_inte), 0, 0, 1, 0},
  {&__pyx_kp_s_chunklen_s_chunksize_s_blocksiz, __pyx_k_chunklen_s_chunksize_s_blocksiz, sizeof(__pyx_k_chunklen_s_chunksize_s_blocksiz), 0, 0, 1, 0},
  {&__pyx_n_s_clevel, __pyx_k_clevel, sizeof(__pyx_k_clevel), 0, 0, 1, 1},
  {&__pyx_n_s_clist, __pyx_k_clist, sizeof(__pyx_k_clist), 0, 0, 1, 1},
  {&__pyx_n_s_cname, __pyx_k_cname, sizeof(__pyx_k_cname), 0, 0, 1, 1},
  {&__pyx_n_s_compr, __pyx_k_compr, sizeof(__pyx_k_compr), 0, 0, 1, 1},
  {&__pyx_n_s_contiguous, __pyx_k_contiguous, sizeof(__pyx_k_contiguous), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_cparams, __pyx_k_cparams, sizeof(__pyx_k_cparams), 0, 0, 1, 1},
  {&__pyx_kp_s_cparams_param_must_be_an_instan, __pyx_k_cparams_param_must_be_an_instan, sizeof(__pyx_k_cparams_param_must_be_an_instan), 0, 0, 1, 0},
  {&__pyx_kp_s_cparams_r, __pyx_k_cparams_r, sizeof(__pyx_k_cparams_r), 0, 0, 1, 0},
  {&__pyx_n_s_create_carray, __pyx_k_create_carray, sizeof(__pyx_k_create_carray), 0, 0, 1, 1},
  {&__pyx_kp_s_creating_carrays_from_scalar_obj, __pyx_k_creating_carrays_from_scalar_obj, sizeof(__pyx_k_creating_carrays_from_scalar_obj), 0, 0, 1, 0},
  {&__pyx_n_s_ctbytes, __pyx_k_ctbytes, sizeof(__pyx_k_ctbytes), 0, 0, 1, 1},
  {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
  {&__pyx_n_s_current_thread, __pyx_k_current_thread, sizeof(__pyx_k_current_thread), 0, 0, 1, 1},
  {&__pyx_kp_s_d_s, __pyx_k_d_s, sizeof(__pyx_k_d_s), 0, 0, 1, 0},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_kp_s_data_directory_does_not_exist, __pyx_k_data_directory_does_not_exist, sizeof(__pyx_k_data_directory_does_not_exist), 0, 0, 1, 0},
  {&__pyx_n_s_datadir, __pyx_k_datadir, sizeof(__pyx_k_datadir), 0, 0, 1, 1},
  {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_decode_byte, __pyx_k_decode_byte, sizeof(__pyx_k_decode_byte), 0, 0, 1, 1},
  {&__pyx_n_s_decode_uint32, __pyx_k_decode_uint32, sizeof(__pyx_k_decode_uint32), 0, 0, 1, 1},
  {&__pyx_n_s_dflt, __pyx_k_dflt, sizeof(__pyx_k_dflt), 0, 0, 1, 1},
  {&__pyx_n_s_dir, __pyx_k_dir, sizeof(__pyx_k_dir), 0, 0, 1, 1},
  {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1},
  {&__pyx_n_s_dobject, __pyx_k_dobject, sizeof(__pyx_k_dobject), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
  {&__pyx_kp_s_empty_tuple_not_supported, __pyx_k_empty_tuple_not_supported, sizeof(__pyx_k_empty_tuple_not_supported), 0, 0, 1, 0},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_ensure_ascii, __pyx_k_ensure_ascii, sizeof(__pyx_k_ensure_ascii), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_kp_s_error_decompressing_the_last_chu, __pyx_k_error_decompressing_the_last_chu, sizeof(__pyx_k_error_decompressing_the_last_chu), 0, 0, 1, 0},
  {&__pyx_n_s_eval, __pyx_k_eval, sizeof(__pyx_k_eval), 0, 0, 1, 1},
  {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_expectedlen, __pyx_k_expectedlen, sizeof(__pyx_k_expectedlen), 0, 0, 1, 1},
  {&__pyx_kp_s_fatal_error_during_Blosc_compres, __pyx_k_fatal_error_during_Blosc_compres, sizeof(__pyx_k_fatal_error_during_Blosc_compres), 0, 0, 1, 0},
  {&__pyx_kp_s_fatal_error_during_Blosc_decompr, __pyx_k_fatal_error_during_Blosc_decompr, sizeof(__pyx_k_fatal_error_during_Blosc_decompr), 0, 0, 1, 0},
  {&__pyx_n_s_fill_chunks, __pyx_k_fill_chunks, sizeof(__pyx_k_fill_chunks), 0, 0, 1, 1},
  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1},
  {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
  {&__pyx_n_s_fourbyte, __pyx_k_fourbyte, sizeof(__pyx_k_fourbyte), 0, 0, 1, 1},
  {&__pyx_n_s_free_cachemem, __pyx_k_free_cachemem, sizeof(__pyx_k_free_cachemem), 0, 0, 1, 1},
  {&__pyx_n_s_fromiter, __pyx_k_fromiter, sizeof(__pyx_k_fromiter), 0, 0, 1, 1},
  {&__pyx_n_s_get_use_threads, __pyx_k_get_use_threads, sizeof(__pyx_k_get_use_threads), 0, 0, 1, 1},
  {&__pyx_n_s_getdata, __pyx_k_getdata, sizeof(__pyx_k_getdata), 0, 0, 1, 1},
  {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
  {&__pyx_n_s_getitem_object, __pyx_k_getitem_object, sizeof(__pyx_k_getitem_object), 0, 0, 1, 1},
  {&__pyx_n_s_getudata, __pyx_k_getudata, sizeof(__pyx_k_getudata), 0, 0, 1, 1},
  {&__pyx_n_s_hasobject, __pyx_k_hasobject, sizeof(__pyx_k_hasobject), 0, 0, 1, 1},
  {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1},
  {&__pyx_n_s_human_readable_size, __pyx_k_human_readable_size, sizeof(__pyx_k_human_readable_size), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_kp_s_i_nchunks_d_d, __pyx_k_i_nchunks_d_d, sizeof(__pyx_k_i_nchunks_d_d), 0, 0, 1, 0},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_kp_s_index_out_of_range, __pyx_k_index_out_of_range, sizeof(__pyx_k_index_out_of_range), 0, 0, 1, 0},
  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
  {&__pyx_n_s_init_iter, __pyx_k_init_iter, sizeof(__pyx_k_init_iter), 0, 0, 1, 1},
  {&__pyx_n_s_init_where, __pyx_k_init_where, sizeof(__pyx_k_init_where), 0, 0, 1, 1},
  {&__pyx_n_s_init_wheretrue, __pyx_k_init_wheretrue, sizeof(__pyx_k_init_wheretrue), 0, 0, 1, 1},
  {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
  {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1},
  {&__pyx_n_s_inttypes, __pyx_k_inttypes, sizeof(__pyx_k_inttypes), 0, 0, 1, 1},
  {&__pyx_kp_s_is_not_a_supported_dtype, __pyx_k_is_not_a_supported_dtype, sizeof(__pyx_k_is_not_a_supported_dtype), 0, 0, 1, 0},
  {&__pyx_n_s_isdir, __pyx_k_isdir, sizeof(__pyx_k_isdir), 0, 0, 1, 1},
  {&__pyx_n_s_issubsctype, __pyx_k_issubsctype, sizeof(__pyx_k_issubsctype), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
  {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1},
  {&__pyx_kp_s_key_cannot_be_converted_to_an_ar, __pyx_k_key_cannot_be_converted_to_an_ar, sizeof(__pyx_k_key_cannot_be_converted_to_an_ar), 0, 0, 1, 0},
  {&__pyx_kp_s_key_not_suitable, __pyx_k_key_not_suitable, sizeof(__pyx_k_key_not_suitable), 0, 0, 1, 0},
  {&__pyx_kp_s_key_not_supported_s, __pyx_k_key_not_supported_s, sizeof(__pyx_k_key_not_supported_s), 0, 0, 1, 0},
  {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
  {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1},
  {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1},
  {&__pyx_n_s_list_bytes_to_str, __pyx_k_list_bytes_to_str, sizeof(__pyx_k_list_bytes_to_str), 0, 0, 1, 1},
  {&__pyx_n_s_list_compr, __pyx_k_list_compr, sizeof(__pyx_k_list_compr), 0, 0, 1, 1},
  {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
  {&__pyx_n_s_lst, __pyx_k_lst, sizeof(__pyx_k_lst), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_main_thread, __pyx_k_main_thread, sizeof(__pyx_k_main_thread), 0, 0, 1, 1},
  {&__pyx_n_s_maxint, __pyx_k_maxint, sizeof(__pyx_k_maxint), 0, 0, 1, 1},
  {&__pyx_n_s_memory, __pyx_k_memory, sizeof(__pyx_k_memory), 0, 0, 1, 1},
  {&__pyx_n_s_meta, __pyx_k_meta, sizeof(__pyx_k_meta), 0, 0, 1, 1},
  {&__pyx_kp_s_meta_directory_does_not_exist, __pyx_k_meta_directory_does_not_exist, sizeof(__pyx_k_meta_directory_does_not_exist), 0, 0, 1, 0},
  {&__pyx_n_s_metainfo, __pyx_k_metainfo, sizeof(__pyx_k_metainfo), 0, 0, 1, 1},
  {&__pyx_n_s_mkdir, __pyx_k_mkdir, sizeof(__pyx_k_mkdir), 0, 0, 1, 1},
  {&__pyx_n_s_mkdirs, __pyx_k_mkdirs, sizeof(__pyx_k_mkdirs), 0, 0, 1, 1},
  {&__pyx_n_s_mkdtemp, __pyx_k_mkdtemp, sizeof(__pyx_k_mkdtemp), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_kp_s_mode_s, __pyx_k_mode_s, sizeof(__pyx_k_mode_s), 0, 0, 1, 0},
  {&__pyx_kp_s_mode_should_be_r_w_or_a, __pyx_k_mode_should_be_r_w_or_a, sizeof(__pyx_k_mode_should_be_r_w_or_a), 0, 0, 1, 0},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1},
  {&__pyx_n_s_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1},
  {&__pyx_kp_s_nbytes_s_cbytes_s_ratio_2f, __pyx_k_nbytes_s_cbytes_s_ratio_2f, sizeof(__pyx_k_nbytes_s_cbytes_s_ratio_2f), 0, 0, 1, 0},
  {&__pyx_n_s_nchunks, __pyx_k_nchunks, sizeof(__pyx_k_nchunks), 0, 0, 1, 1},
  {&__pyx_kp_s_nchunks_must_be_in_the_range_0, __pyx_k_nchunks_must_be_in_the_range_0, sizeof(__pyx_k_nchunks_must_be_in_the_range_0), 0, 0, 1, 0},
  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_kp_s_newshape_is_not_compatible_with, __pyx_k_newshape_is_not_compatible_with, sizeof(__pyx_k_newshape_is_not_compatible_with), 0, 0, 1, 0},
  {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
  {&__pyx_kp_s_nitems_cannot_be_negative, __pyx_k_nitems_cannot_be_negative, sizeof(__pyx_k_nitems_cannot_be_negative), 0, 0, 1, 0},
  {&__pyx_kp_s_nitems_must_be_an_integer, __pyx_k_nitems_must_be_an_integer, sizeof(__pyx_k_nitems_must_be_an_integer), 0, 0, 1, 0},
  {&__pyx_kp_s_nitems_must_be_less_than_total, __pyx_k_nitems_must_be_less_than_total, sizeof(__pyx_k_nitems_must_be_less_than_total), 0, 0, 1, 0},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_s_nthreads, __pyx_k_nthreads, sizeof(__pyx_k_nthreads), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_kp_s_only_boolean_expressions_support, __pyx_k_only_boolean_expressions_support, sizeof(__pyx_k_only_boolean_expressions_support), 0, 0, 1, 0},
  {&__pyx_kp_s_only_one_shape_dimension_can_be, __pyx_k_only_one_shape_dimension_can_be, sizeof(__pyx_k_only_one_shape_dimension_can_be), 0, 0, 1, 0},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_open_carray, __pyx_k_open_carray, sizeof(__pyx_k_open_carray), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_os_path, __pyx_k_os_path, sizeof(__pyx_k_os_path), 0, 0, 1, 1},
  {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_kp_s_private_tmp_bcolz_bcolz_carray, __pyx_k_private_tmp_bcolz_bcolz_carray, sizeof(__pyx_k_private_tmp_bcolz_bcolz_carray), 0, 0, 1, 0},
  {&__pyx_n_s_prod, __pyx_k_prod, sizeof(__pyx_k_prod), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_kp_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 0},
  {&__pyx_n_s_quantize, __pyx_k_quantize, sizeof(__pyx_k_quantize), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_read_meta, __pyx_k_read_meta, sizeof(__pyx_k_read_meta), 0, 0, 1, 1},
  {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
  {&__pyx_n_s_rename, __pyx_k_rename, sizeof(__pyx_k_rename), 0, 0, 1, 1},
  {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
  {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1},
  {&__pyx_n_s_rmtree, __pyx_k_rmtree, sizeof(__pyx_k_rmtree), 0, 0, 1, 1},
  {&__pyx_kp_s_root_directory_does_not_exist, __pyx_k_root_directory_does_not_exist, sizeof(__pyx_k_root_directory_does_not_exist), 0, 0, 1, 0},
  {&__pyx_n_s_rootdir, __pyx_k_rootdir, sizeof(__pyx_k_rootdir), 0, 0, 1, 1},
  {&__pyx_kp_s_rootdir_s, __pyx_k_rootdir_s, sizeof(__pyx_k_rootdir_s), 0, 0, 1, 0},
  {&__pyx_n_s_safe, __pyx_k_safe, sizeof(__pyx_k_safe), 0, 0, 1, 1},
  {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
  {&__pyx_kp_s_self_is_not_an_array_of_boolean, __pyx_k_self_is_not_an_array_of_boolean, sizeof(__pyx_k_self_is_not_an_array_of_boolean), 0, 0, 1, 0},
  {&__pyx_kp_s_self_is_not_unidimensional, __pyx_k_self_is_not_unidimensional, sizeof(__pyx_k_self_is_not_unidimensional), 0, 0, 1, 0},
  {&__pyx_n_s_set_entire_carray, __pyx_k_set_entire_carray, sizeof(__pyx_k_set_entire_carray), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_s_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 0, 1, 1},
  {&__pyx_n_s_shutil, __pyx_k_shutil, sizeof(__pyx_k_shutil), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_sizes, __pyx_k_sizes, sizeof(__pyx_k_sizes), 0, 0, 1, 1},
  {&__pyx_n_s_skip, __pyx_k_skip, sizeof(__pyx_k_skip), 0, 0, 1, 1},
  {&__pyx_kp_s_specified_rootdir_path_s_already, __pyx_k_specified_rootdir_path_s_already, sizeof(__pyx_k_specified_rootdir_path_s_already), 0, 0, 1, 0},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_squeeze, __pyx_k_squeeze, sizeof(__pyx_k_squeeze), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_kp_s_step_in_slice_can_only_be_positi, __pyx_k_step_in_slice_can_only_be_positi, sizeof(__pyx_k_step_in_slice_can_only_be_positi), 0, 0, 1, 0},
  {&__pyx_kp_s_step_param_can_only_be_positive, __pyx_k_step_param_can_only_be_positive, sizeof(__pyx_k_step_param_can_only_be_positive), 0, 0, 1, 0},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_n_s_storage, __pyx_k_storage, sizeof(__pyx_k_storage), 0, 0, 1, 1},
  {&__pyx_n_s_store_obj, __pyx_k_store_obj, sizeof(__pyx_k_store_obj), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_s_strides, __pyx_k_strides, sizeof(__pyx_k_strides), 0, 0, 1, 1},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_s_suffix, __pyx_k_suffix, sizeof(__pyx_k_suffix), 0, 0, 1, 1},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1},
  {&__pyx_n_s_temp, __pyx_k_temp, sizeof(__pyx_k_temp), 0, 0, 1, 1},
  {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_to_ndarray, __pyx_k_to_ndarray, sizeof(__pyx_k_to_ndarray), 0, 0, 1, 1},
  {&__pyx_n_s_tolist, __pyx_k_tolist, sizeof(__pyx_k_tolist), 0, 0, 1, 1},
  {&__pyx_n_s_trim, __pyx_k_trim, sizeof(__pyx_k_trim), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_typesize, __pyx_k_typesize, sizeof(__pyx_k_typesize), 0, 0, 1, 1},
  {&__pyx_kp_s_typesize_is_d_and_bcolz_does_not, __pyx_k_typesize_is_d_and_bcolz_does_not, sizeof(__pyx_k_typesize_is_d_and_bcolz_does_not), 0, 0, 1, 0},
  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
  {&__pyx_n_s_update_disk_sizes, __pyx_k_update_disk_sizes, sizeof(__pyx_k_update_disk_sizes), 0, 0, 1, 1},
  {&__pyx_n_s_use_threads, __pyx_k_use_threads, sizeof(__pyx_k_use_threads), 0, 0, 1, 1},
  {&__pyx_n_s_use_threads_2, __pyx_k_use_threads_2, sizeof(__pyx_k_use_threads_2), 0, 0, 1, 1},
  {&__pyx_n_s_utils, __pyx_k_utils, sizeof(__pyx_k_utils), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_ver_date, __pyx_k_ver_date, sizeof(__pyx_k_ver_date), 0, 0, 1, 1},
  {&__pyx_n_s_ver_str, __pyx_k_ver_str, sizeof(__pyx_k_ver_str), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
  {&__pyx_n_s_versionlz, __pyx_k_versionlz, sizeof(__pyx_k_versionlz), 0, 0, 1, 1},
  {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_n_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1},
  {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_write_meta, __pyx_k_write_meta, sizeof(__pyx_k_write_meta), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_xchunks, __pyx_k_xchunks, sizeof(__pyx_k_xchunks), 0, 0, 1, 1},
  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 366, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 458, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 473, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 566, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 584, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 768, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 791, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 829, __pyx_L1_error)
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(0, 951, __pyx_L1_error)
  #else
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(0, 951, __pyx_L1_error)
  #endif
  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(0, 1177, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 1437, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 2156, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "bcolz/carray_ext.pyx":159
 *     """
 *     list_compr = blosc_list_compressors()
 *     if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *         # Convert compressor names into regular strings in Python 3 (unicode)
 *         list_compr = list_compr.decode()
 */
  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "bcolz/carray_ext.pyx":162
 *         # Convert compressor names into regular strings in Python 3 (unicode)
 *         list_compr = list_compr.decode()
 *     clist = list_compr.split(',')             # <<<<<<<<<<<<<<
 *     return clist
 * 
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s__3); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "bcolz/carray_ext.pyx":222
 *     """
 *     if isinstance(lst, bytes):
 *         return lst.decode('ascii')             # <<<<<<<<<<<<<<
 *     elif isinstance(lst, list):
 *         return [list_bytes_to_str(x) for x in lst]
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "bcolz/carray_ext.pyx":528
 *             # The chunk is made of constants
 *             constants = np.ndarray(shape=(blen,), dtype=self.dtype,
 *                                    buffer=self.constant, strides=(0,)).copy()             # <<<<<<<<<<<<<<
 *             memcpy(dest, constants.data, bsize)
 *             return
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "bcolz/carray_ext.pyx":549
 *         if isinstance(key, _inttypes):
 *             # Quickly return a single element
 *             array = np.empty(shape=(1,), dtype=self.dtype)             # <<<<<<<<<<<<<<
 *             self._getitem(key, key + 1, array.data)
 *             return PyArray_GETITEM(array, array.data)
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "bcolz/carray_ext.pyx":588
 *     def __str__(self):
 *         """Represent the chunk as an string."""
 *         return str(self[:])             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__14);
  __Pyx_GIVEREF(__pyx_slice__14);

  /* "bcolz/carray_ext.pyx":653
 * else:
 *     def decode_byte(byte):
 *         return int(byte.encode('hex'), 16)             # <<<<<<<<<<<<<<
 * def decode_uint32(fourbyte):
 *     return struct.unpack('<I', fourbyte)[0]
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_hex); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "bcolz/carray_ext.pyx":694
 *             'flags': decode_byte(buffer_[2]),
 *             'typesize': decode_byte(buffer_[3]),
 *             'nbytes': decode_uint32(buffer_[4:8]),             # <<<<<<<<<<<<<<
 *             'blocksize': decode_uint32(buffer_[8:12]),
 *             'ctbytes': decode_uint32(buffer_[12:16])}
 */
  __pyx_slice__21 = PySlice_New(__pyx_int_4, __pyx_int_8, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__21);
  __Pyx_GIVEREF(__pyx_slice__21);

  /* "bcolz/carray_ext.pyx":695
 *             'typesize': decode_byte(buffer_[3]),
 *             'nbytes': decode_uint32(buffer_[4:8]),
 *             'blocksize': decode_uint32(buffer_[8:12]),             # <<<<<<<<<<<<<<
 *             'ctbytes': decode_uint32(buffer_[12:16])}
 * 
 */
  __pyx_slice__22 = PySlice_New(__pyx_int_8, __pyx_int_12, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__22);
  __Pyx_GIVEREF(__pyx_slice__22);

  /* "bcolz/carray_ext.pyx":696
 *             'nbytes': decode_uint32(buffer_[4:8]),
 *             'blocksize': decode_uint32(buffer_[8:12]),
 *             'ctbytes': decode_uint32(buffer_[12:16])}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_slice__23 = PySlice_New(__pyx_int_12, __pyx_int_16, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__23);
  __Pyx_GIVEREF(__pyx_slice__23);

  /* "bcolz/carray_ext.pyx":768
 *         if not os.path.exists(schunkfile):
 *             raise ValueError("chunkfile %s not found" % schunkfile)
 *         with open(schunkfile, 'rb') as schunk:             # <<<<<<<<<<<<<<
 *             bloscpack_header = schunk.read(BLOSCPACK_HEADER_LENGTH)
 *             blosc_header_raw = schunk.read(BLOSC_HEADER_LENGTH)
 */
  __pyx_tuple__24 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "bcolz/carray_ext.pyx":834
 *         schunkfile = self._chunk_file_name(nchunk)
 *         bloscpack_header = create_bloscpack_header(1)
 *         with open(schunkfile, 'wb') as schunk:             # <<<<<<<<<<<<<<
 *             schunk.write(bloscpack_header)
 *             schunk.write(chunk_.getdata())
 */
  __pyx_tuple__25 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "bcolz/carray_ext.pyx":1046
 *         def __set__(self, value):
 *             if not self.rootdir:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "cannot modify the rootdir value of an in-memory carray")
 *             self._rootdir = value
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_cannot_modify_the_rootdir_value); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "bcolz/carray_ext.pyx":1058
 *         self._rootdir = rootdir
 *         if mode not in ('r', 'w', 'a'):
 *             raise ValueError("mode should be 'r', 'w' or 'a'")             # <<<<<<<<<<<<<<
 *         self._mode = mode
 *         self._safe = safe
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_mode_should_be_r_w_or_a); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "bcolz/carray_ext.pyx":1071
 *             _new = False
 *         else:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "You need at least to pass an array or/and a rootdir")
 * 
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_You_need_at_least_to_pass_an_arr); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "bcolz/carray_ext.pyx":1078
 * 
 *         # Cache a len-1 array for accelerating self[int] case
 *         self.arr1 = np.empty(shape=(1,), dtype=self._dtype)             # <<<<<<<<<<<<<<
 * 
 *         # Sentinels
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "bcolz/carray_ext.pyx":1094
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")
 *         else:
 *             dtype_ = np.dtype((dtype_, shape[1:]))             # <<<<<<<<<<<<<<
 * 
 *         return dtype_
 */
  __pyx_slice__30 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(0, 1094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__30);
  __Pyx_GIVEREF(__pyx_slice__30);

  /* "bcolz/carray_ext.pyx":1117
 * 
 *         if not isinstance(cparams, bcolz.cparams):
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "`cparams` param must be an instance of `cparams` class")
 * 
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_cparams_param_must_be_an_instan); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "bcolz/carray_ext.pyx":1130
 *         # (especially when dtypes and compression params match)
 *         if isinstance(array, carray):
 *             array = array[:]             # <<<<<<<<<<<<<<
 * 
 *         array_ = utils.to_ndarray(array, dtype)
 */
  __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(0, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__32);
  __Pyx_GIVEREF(__pyx_slice__32);

  /* "bcolz/carray_ext.pyx":1150
 *         # Check that atom size is less than 2 GB
 *         if dtype.itemsize >= 2 ** 31:
 *             raise ValueError("atomic size is too large (>= 2 GB)")             # <<<<<<<<<<<<<<
 * 
 *         # Check that atom size is larger than 0
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_atomic_size_is_too_large_2_GB); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "bcolz/carray_ext.pyx":1154
 *         # Check that atom size is larger than 0
 *         if dtype.itemsize == 0:
 *             raise TypeError("atomic size cannot be zero")             # <<<<<<<<<<<<<<
 * 
 *         self.atomsize = atomsize = dtype.itemsize
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_atomic_size_cannot_be_zero); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "bcolz/carray_ext.pyx":1162
 * 
 *         # Check defaults for dflt
 *         _dflt = np.zeros((), dtype=dtype.base)             # <<<<<<<<<<<<<<
 *         if dflt is not None:
 *             _dflt[()] = dflt
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "bcolz/carray_ext.pyx":1173
 *                 expectedlen = len(array_)
 *             except TypeError:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "creating carrays from scalar objects is not supported")
 *         try:
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_creating_carrays_from_scalar_obj); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 1173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "bcolz/carray_ext.pyx":1178
 *             self.expectedlen = expectedlen
 *         except OverflowError:
 *             raise OverflowError(             # <<<<<<<<<<<<<<
 *                 "The size cannot be larger than 2**31 on 32-bit platforms")
 *         if chunklen is None:
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_The_size_cannot_be_larger_than_2); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "bcolz/carray_ext.pyx":1191
 *         else:
 *             if not isinstance(chunklen, int) or chunklen < 1:
 *                 raise ValueError("chunklen must be a positive integer")             # <<<<<<<<<<<<<<
 *             chunksize = chunklen * atomsize
 *         chunklen = cython.cdiv(chunksize, atomsize)
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_chunklen_must_be_a_positive_inte); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "bcolz/carray_ext.pyx":1243
 *             # from `self.shape`.  `self.dtype` will always be scalar (NumPy
 *             # convention).
 *             self._dtype = dtype = np.dtype((dtype.base, shape[1:]))             # <<<<<<<<<<<<<<
 * 
 *         self._cparams = cparams
 */
  __pyx_slice__39 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__39)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__39);
  __Pyx_GIVEREF(__pyx_slice__39);

  /* "bcolz/carray_ext.pyx":1263
 *             # Check rootdir hierarchy
 *             if not os.path.isdir(self._rootdir):
 *                 raise IOError("root directory does not exist")             # <<<<<<<<<<<<<<
 *             self.datadir = os.path.join(self._rootdir, DATA_DIR)
 *             if not os.path.isdir(self.datadir):
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_root_directory_does_not_exist); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "bcolz/carray_ext.pyx":1266
 *             self.datadir = os.path.join(self._rootdir, DATA_DIR)
 *             if not os.path.isdir(self.datadir):
 *                 raise IOError("data directory does not exist")             # <<<<<<<<<<<<<<
 *             self.metadir = os.path.join(self._rootdir, META_DIR)
 *             if not os.path.isdir(self.metadir):
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_data_directory_does_not_exist); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 1266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "bcolz/carray_ext.pyx":1269
 *             self.metadir = os.path.join(self._rootdir, META_DIR)
 *             if not os.path.isdir(self.metadir):
 *                 raise IOError("meta directory does not exist")             # <<<<<<<<<<<<<<
 * 
 *             # Finally, open data directory
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_meta_directory_does_not_exist); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "bcolz/carray_ext.pyx":1275
 *             self.chunks = chunks(self._rootdir, metainfo=metainfo, _new=False)
 *         else:
 *             self.chunks, lastchunkarr[:] = xchunks             # <<<<<<<<<<<<<<
 * 
 *         # Update some counters
 */
  __pyx_slice__43 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__43)) __PYX_ERR(0, 1275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__43);
  __Pyx_GIVEREF(__pyx_slice__43);

  /* "bcolz/carray_ext.pyx":1285
 *         if self._mode == "w":
 *             # Remove all entries when mode is 'w'
 *             self.resize(0)             # <<<<<<<<<<<<<<
 * 
 *     def _fill_chunks(self, object array_):
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "bcolz/carray_ext.pyx":1345
 *                 dflt_list = 0
 *             # In Python 3, the json encoder doesn't accept bytes objects
 *             if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *                 dflt_list = list_bytes_to_str(dflt_list)
 *             storagefh.write(json.dumps({
 */
  __pyx_tuple__45 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "bcolz/carray_ext.pyx":1360
 *                 "expectedlen": self.expectedlen,
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))             # <<<<<<<<<<<<<<
 *             storagefh.write(b"\n")
 * 
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "bcolz/carray_ext.pyx":1361
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))
 *             storagefh.write(b"\n")             # <<<<<<<<<<<<<<
 * 
 *     def _read_meta(self):
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_b__47); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "bcolz/carray_ext.pyx":1338
 *         """Write metadata persistently."""
 *         storagef = os.path.join(self.metadir, STORAGE_FILE)
 *         with open(storagef, 'wb') as storagefh:             # <<<<<<<<<<<<<<
 *             dflt_list = self.dflt.tolist()
 *             if type(dflt_list) in (datetime.datetime,
 */
  __pyx_tuple__49 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 1338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "bcolz/carray_ext.pyx":1370
 *         shapef = os.path.join(metadir, SIZES_FILE)
 *         with open(shapef, 'rb') as shapefh:
 *             sizes = json.loads(shapefh.read().decode('ascii'))             # <<<<<<<<<<<<<<
 *         shape = sizes['shape']
 *         if type(shape) == list:
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "bcolz/carray_ext.pyx":1369
 *         metadir = os.path.join(self._rootdir, META_DIR)
 *         shapef = os.path.join(metadir, SIZES_FILE)
 *         with open(shapef, 'rb') as shapefh:             # <<<<<<<<<<<<<<
 *             sizes = json.loads(shapefh.read().decode('ascii'))
 *         shape = sizes['shape']
 */
  __pyx_tuple__51 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "bcolz/carray_ext.pyx":1380
 *         storagef = os.path.join(metadir, STORAGE_FILE)
 *         with open(storagef, 'rb') as storagefh:
 *             data = json.loads(storagefh.read().decode('ascii'))             # <<<<<<<<<<<<<<
 *         dtype_ = np.dtype(data["dtype"])
 *         chunklen = data["chunklen"]
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "bcolz/carray_ext.pyx":1379
 *         # Then the rest of metadata
 *         storagef = os.path.join(metadir, STORAGE_FILE)
 *         with open(storagef, 'rb') as storagefh:             # <<<<<<<<<<<<<<
 *             data = json.loads(storagefh.read().decode('ascii'))
 *         dtype_ = np.dtype(data["dtype"])
 */
  __pyx_tuple__53 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "bcolz/carray_ext.pyx":1400
 * 
 *         pick_obj = pickle.dumps(arrobj, pickle.HIGHEST_PROTOCOL)
 *         chunk_ = chunk(pick_obj, np.dtype('O'), self._cparams,             # <<<<<<<<<<<<<<
 *                        _memory=self._rootdir is None)
 * 
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "bcolz/carray_ext.pyx":1433
 *             arrcpy = utils.to_ndarray(array, self._dtype, safe=self._safe)
 *             if arrcpy.dtype != self._dtype.base:
 *                 raise TypeError("array dtype does not match with self")             # <<<<<<<<<<<<<<
 * 
 *             # Object dtype requires special storage
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_array_dtype_does_not_match_with); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "bcolz/carray_ext.pyx":1443
 *             # Appending a single row should be supported
 *             if np.shape(arrcpy) == self._dtype.shape:
 *                 arrcpy = arrcpy.reshape((1,) + np.shape(arrcpy))             # <<<<<<<<<<<<<<
 *             if np.shape(arrcpy)[1:] != self._dtype.shape:
 *                 raise ValueError(
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "bcolz/carray_ext.pyx":1444
 *             if np.shape(arrcpy) == self._dtype.shape:
 *                 arrcpy = arrcpy.reshape((1,) + np.shape(arrcpy))
 *             if np.shape(arrcpy)[1:] != self._dtype.shape:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "array trailing dimensions do not match with self")
 */
  __pyx_slice__57 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__57)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__57);
  __Pyx_GIVEREF(__pyx_slice__57);

  /* "bcolz/carray_ext.pyx":1445
 *                 arrcpy = arrcpy.reshape((1,) + np.shape(arrcpy))
 *             if np.shape(arrcpy)[1:] != self._dtype.shape:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "array trailing dimensions do not match with self")
 *         else:
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_array_trailing_dimensions_do_not); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 1445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "bcolz/carray_ext.pyx":1534
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):
 *             raise TypeError("`nitems` must be an integer")             # <<<<<<<<<<<<<<
 * 
 *         # Check that we don't run out of space
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_nitems_must_be_an_integer); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "bcolz/carray_ext.pyx":1538
 *         # Check that we don't run out of space
 *         if nitems > self.len:
 *             raise ValueError("`nitems` must be less than total length")             # <<<<<<<<<<<<<<
 *         # A negative number of items means that we want to grow the object
 *         if nitems <= 0:
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_nitems_must_be_less_than_total); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "bcolz/carray_ext.pyx":1601
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):
 *             raise TypeError("`nitems` must be an integer")             # <<<<<<<<<<<<<<
 * 
 *         if nitems == self.len:
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_nitems_must_be_an_integer); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "bcolz/carray_ext.pyx":1606
 *             return
 *         elif nitems < 0:
 *             raise ValueError("`nitems` cannot be negative")             # <<<<<<<<<<<<<<
 * 
 *         if nitems > self.len:
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_nitems_cannot_be_negative); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 1606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "bcolz/carray_ext.pyx":1610
 *         if nitems > self.len:
 *             chunk = np.empty(nitems - self.len, dtype=self._dtype)
 *             chunk[:] = self._dflt             # <<<<<<<<<<<<<<
 *             self.append(chunk)
 *             self.flush()
 */
  __pyx_slice__63 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__63)) __PYX_ERR(0, 1610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__63);
  __Pyx_GIVEREF(__pyx_slice__63);

  /* "bcolz/carray_ext.pyx":1648
 *         # Check for -1 in newshape
 *         if -1 in newshape:
 *             if newshape.count(-1) > 1:             # <<<<<<<<<<<<<<
 *                 raise ValueError("only one shape dimension can be -1")
 *             pos = newshape.index(-1)
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "bcolz/carray_ext.pyx":1649
 *         if -1 in newshape:
 *             if newshape.count(-1) > 1:
 *                 raise ValueError("only one shape dimension can be -1")             # <<<<<<<<<<<<<<
 *             pos = newshape.index(-1)
 *             osize = np.prod(newshape[:pos] + newshape[pos + 1:])
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_only_one_shape_dimension_can_be); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "bcolz/carray_ext.pyx":1650
 *             if newshape.count(-1) > 1:
 *                 raise ValueError("only one shape dimension can be -1")
 *             pos = newshape.index(-1)             # <<<<<<<<<<<<<<
 *             osize = np.prod(newshape[:pos] + newshape[pos + 1:])
 *             if isize == 0:
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "bcolz/carray_ext.pyx":1653
 *             osize = np.prod(newshape[:pos] + newshape[pos + 1:])
 *             if isize == 0:
 *                 newshape = newshape[:pos] + (0,) + newshape[pos + 1:]             # <<<<<<<<<<<<<<
 *             else:
 *                 newshape = newshape[:pos] + (isize / osize,) + newshape[
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 1653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "bcolz/carray_ext.pyx":1661
 *         # Check shape compatibility
 *         if isize != newsize:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "`newshape` is not compatible with the current one")
 *         # Create the output container
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_newshape_is_not_compatible_with); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "bcolz/carray_ext.pyx":1664
 *                 "`newshape` is not compatible with the current one")
 *         # Create the output container
 *         newdtype = np.dtype((self._dtype.base, newshape[1:]))             # <<<<<<<<<<<<<<
 *         newlen = newshape[0]
 * 
 */
  __pyx_slice__69 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__69)) __PYX_ERR(0, 1664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__69);
  __Pyx_GIVEREF(__pyx_slice__69);

  /* "bcolz/carray_ext.pyx":1670
 *         # and then convert again to the final newshape.
 *         if len(ishape) > 1 and len(newshape) > 1:
 *             out = self.reshape(-1)             # <<<<<<<<<<<<<<
 *             return out.reshape(newshape)
 * 
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "bcolz/carray_ext.pyx":1691
 *         else:
 *             for i from 0 <= i < ilen:
 *                 out.append(self[i].reshape(-1))             # <<<<<<<<<<<<<<
 *         out.flush()
 * 
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 1691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "bcolz/carray_ext.pyx":1724
 * 
 *         # Create a new, empty carray
 *         ccopy = carray(np.empty(0, dtype=self._dtype),             # <<<<<<<<<<<<<<
 *                        expectedlen=expectedlen,
 *                        **kwargs)
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "bcolz/carray_ext.pyx":1750
 *         """
 *         # Create a light weight data container
 *         cview = carray(np.empty(0, dtype=self._dtype))             # <<<<<<<<<<<<<<
 *         # And populate it with metainfo (including chunks)
 *         meta_info = (self.shape, self.cparams, self.dtype, self.dflt,
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "bcolz/carray_ext.pyx":1788
 *             dtype = np.dtype(dtype)
 *         if dtype.kind == 'S':
 *             raise TypeError("cannot perform reduce with flexible type")             # <<<<<<<<<<<<<<
 * 
 *         # Get a container for the result
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_cannot_perform_reduce_with_flexi); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "bcolz/carray_ext.pyx":1791
 * 
 *         # Get a container for the result
 *         result = np.zeros(1, dtype=dtype)[0]             # <<<<<<<<<<<<<<
 * 
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "bcolz/carray_ext.pyx":1800
 *                 result += chunk_.true_count
 *             else:
 *                 result += chunk_[:].sum(dtype=dtype)             # <<<<<<<<<<<<<<
 *         if self.leftover:
 *             leftover = self.len - nchunks * self._chunklen
 */
  __pyx_slice__76 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__76)) __PYX_ERR(0, 1800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__76);
  __Pyx_GIVEREF(__pyx_slice__76);

  /* "bcolz/carray_ext.pyx":1940
 *                 key += self.len
 *             if key >= self.len:
 *                 raise IndexError("index out of range")             # <<<<<<<<<<<<<<
 *             arr1 = self.arr1
 *             if self.dtype.char == 'O':
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_range); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "bcolz/carray_ext.pyx":1955
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step and step <= 0:
 *                 raise NotImplementedError("step in slice can only be positive")             # <<<<<<<<<<<<<<
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_step_in_slice_can_only_be_positi); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 1955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "bcolz/carray_ext.pyx":1959
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")             # <<<<<<<<<<<<<<
 *             elif len(key) == 1:
 *                 return self[key[0]]
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_empty_tuple_not_supported); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "bcolz/carray_ext.pyx":1967
 *             # Then, keep only the required elements in other dimensions
 *             if type(key[0]) == slice:
 *                 arr = arr[(slice(None),) + key[1:]]             # <<<<<<<<<<<<<<
 *             else:
 *                 arr = arr[key[1:]]
 */
  __pyx_slice__80 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__80)) __PYX_ERR(0, 1967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__80);
  __Pyx_GIVEREF(__pyx_slice__80);
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_slice__80); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);
  __pyx_slice__82 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__82)) __PYX_ERR(0, 1967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__82);
  __Pyx_GIVEREF(__pyx_slice__82);

  /* "bcolz/carray_ext.pyx":1969
 *                 arr = arr[(slice(None),) + key[1:]]
 *             else:
 *                 arr = arr[key[1:]]             # <<<<<<<<<<<<<<
 *             # Force a copy in case returned array is not contiguous
 *             if not arr.flags.contiguous:
 */
  __pyx_slice__83 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__83)) __PYX_ERR(0, 1969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__83);
  __Pyx_GIVEREF(__pyx_slice__83);

  /* "bcolz/carray_ext.pyx":1980
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "key cannot be converted to an array of indices")
 *             return self[key]
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_key_cannot_be_converted_to_an_ar); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 1980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "bcolz/carray_ext.pyx":1988
 *                 # A boolean array
 *                 if len(key) != self.len:
 *                     raise IndexError(             # <<<<<<<<<<<<<<
 *                         "boolean array length must match len(self)")
 *                 if isinstance(key, carray):
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_boolean_array_length_must_match); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 1988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "bcolz/carray_ext.pyx":2000
 *                 return np.array([self[i] for i in key], dtype=self._dtype.base)
 *             else:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "arrays used as indices must be integer (or boolean)")
 *         # A boolean expression (case of fancy indexing)
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_arrays_used_as_indices_must_be_i); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "bcolz/carray_ext.pyx":2007
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")             # <<<<<<<<<<<<<<
 *             if len(result) != self.len:
 *                 raise IndexError(
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_only_boolean_expressions_support); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "bcolz/carray_ext.pyx":2009
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "boolean expression outcome must match len(self)")
 *             # Call __getitem__ again
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_boolean_expression_outcome_must); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 2009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "bcolz/carray_ext.pyx":2105
 *                 key += self.len
 *             if key >= self.len:
 *                 raise IndexError("index out of range")             # <<<<<<<<<<<<<<
 *             (start, stop, step) = key, key + 1, 1
 *         # Slices
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_range); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 2105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "bcolz/carray_ext.pyx":2112
 *             if step:
 *                 if step <= 0:
 *                     raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                         "step in slice can only be positive")
 *         # Multidimensional keys
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_step_in_slice_can_only_be_positi); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "bcolz/carray_ext.pyx":2117
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")             # <<<<<<<<<<<<<<
 *             elif len(key) == 1:
 *                 self[key[0]] = value
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_empty_tuple_not_supported); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "bcolz/carray_ext.pyx":2126
 *             # Then, assing only the requested elements in other dimensions
 *             if type(key[0]) == slice:
 *                 arr[(slice(None),) + key[1:]] = value             # <<<<<<<<<<<<<<
 *             else:
 *                 arr[key[1:]] = value
 */
  __pyx_slice__92 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__92)) __PYX_ERR(0, 2126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__92);
  __Pyx_GIVEREF(__pyx_slice__92);
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_slice__92); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 2126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_slice__94 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__94)) __PYX_ERR(0, 2126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__94);
  __Pyx_GIVEREF(__pyx_slice__94);

  /* "bcolz/carray_ext.pyx":2128
 *                 arr[(slice(None),) + key[1:]] = value
 *             else:
 *                 arr[key[1:]] = value             # <<<<<<<<<<<<<<
 *             # Finally, update this superset of values in self
 *             self[key[0]] = arr
 */
  __pyx_slice__95 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__95)) __PYX_ERR(0, 2128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__95);
  __Pyx_GIVEREF(__pyx_slice__95);

  /* "bcolz/carray_ext.pyx":2138
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "key cannot be converted to an array of indices")
 *             self[key] = value
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_key_cannot_be_converted_to_an_ar); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "bcolz/carray_ext.pyx":2147
 *                 # A boolean array
 *                 if len(key) != self.len:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         "boolean array length must match len(self)")
 *                 self.bool_update(key, value)
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_boolean_array_length_must_match); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 2147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "bcolz/carray_ext.pyx":2160
 *                 return
 *             else:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "arrays used as indices must be of integer (or boolean) "
 *                     "type")
 */
  __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_arrays_used_as_indices_must_be_o); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 2160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "bcolz/carray_ext.pyx":2168
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")             # <<<<<<<<<<<<<<
 *             if len(result) != self.len:
 *                 raise IndexError(
 */
  __pyx_tuple__99 = PyTuple_Pack(1, __pyx_kp_s_only_boolean_expressions_support); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "bcolz/carray_ext.pyx":2170
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "boolean expression outcome must match len(self)")
 *             # Call __setitem__ again
 */
  __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_s_boolean_expression_outcome_must); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 2170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "bcolz/carray_ext.pyx":2222
 *                 if stopb - startb < chunklen or step > 1:
 *                     # Get all the values in chunk
 *                     cdata = chunk_[:]             # <<<<<<<<<<<<<<
 *                     # Overwrite it with data from value
 *                     cdata[startb:stopb:step] = value[nwrow:nwrow + blen]
 */
  __pyx_slice__101 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__101)) __PYX_ERR(0, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__101);
  __Pyx_GIVEREF(__pyx_slice__101);

  /* "bcolz/carray_ext.pyx":2347
 *                 self._cbytes -= chunk_.cbytes
 *                 # Get all the values there
 *                 cdata = chunk_[:]             # <<<<<<<<<<<<<<
 *                 # Overwrite it with data from value
 *                 cdata[boolb] = value[nwrow:nwrow + blen]
 */
  __pyx_slice__102 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__102)) __PYX_ERR(0, 2347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__102);
  __Pyx_GIVEREF(__pyx_slice__102);

  /* "bcolz/carray_ext.pyx":2428
 *         # Check limits
 *         if step <= 0:
 *             raise NotImplementedError("step param can only be positive")             # <<<<<<<<<<<<<<
 *         if _next:
 *             cview = self
 */
  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_step_param_can_only_be_positive); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 2428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "bcolz/carray_ext.pyx":2469
 *         # Check self
 *         if self._dtype.base.type != np.bool_:
 *             raise ValueError("`self` is not an array of booleans")             # <<<<<<<<<<<<<<
 *         if self.ndim > 1:
 *             raise NotImplementedError("`self` is not unidimensional")
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_self_is_not_an_array_of_boolean); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 2469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "bcolz/carray_ext.pyx":2471
 *             raise ValueError("`self` is not an array of booleans")
 *         if self.ndim > 1:
 *             raise NotImplementedError("`self` is not unidimensional")             # <<<<<<<<<<<<<<
 *         cview = self.view()
 *         return cview._init_wheretrue(limit, skip)
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_self_is_not_unidimensional); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 2471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "bcolz/carray_ext.pyx":2509
 *         # Check input
 *         if self.ndim > 1:
 *             raise NotImplementedError("`self` is not unidimensional")             # <<<<<<<<<<<<<<
 *         if not hasattr(boolarr, "dtype"):
 *             raise ValueError("`boolarr` is not an array")
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_self_is_not_unidimensional); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 2509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "bcolz/carray_ext.pyx":2511
 *             raise NotImplementedError("`self` is not unidimensional")
 *         if not hasattr(boolarr, "dtype"):
 *             raise ValueError("`boolarr` is not an array")             # <<<<<<<<<<<<<<
 *         if boolarr.dtype.type != np.bool_:
 *             raise ValueError("`boolarr` is not an array of booleans")
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_boolarr_is_not_an_array); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 2511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "bcolz/carray_ext.pyx":2513
 *             raise ValueError("`boolarr` is not an array")
 *         if boolarr.dtype.type != np.bool_:
 *             raise ValueError("`boolarr` is not an array of booleans")             # <<<<<<<<<<<<<<
 *         if len(boolarr) != self.len:
 *             raise ValueError(
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_boolarr_is_not_an_array_of_bool); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "bcolz/carray_ext.pyx":2515
 *             raise ValueError("`boolarr` is not an array of booleans")
 *         if len(boolarr) != self.len:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "`boolarr` must be of the same length than ``self``")
 *         cview = self.view()
 */
  __pyx_tuple__109 = PyTuple_Pack(1, __pyx_kp_s_boolarr_must_be_of_the_same_len); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "bcolz/carray_ext.pyx":2616
 *         else:
 *             # Release buffers
 *             self.iobuf = np.empty(0, dtype=self._dtype)             # <<<<<<<<<<<<<<
 *             self.where_buf = np.empty(0, dtype=np.bool_)
 *             self.iter_exhausted = True
 */
  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 2616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "bcolz/carray_ext.pyx":2617
 *             # Release buffers
 *             self.iobuf = np.empty(0, dtype=self._dtype)
 *             self.where_buf = np.empty(0, dtype=np.bool_)             # <<<<<<<<<<<<<<
 *             self.iter_exhausted = True
 *             raise StopIteration  # end of iteration
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 2617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "bcolz/carray_ext.pyx":2657
 *             with open(rowsf, 'wb') as rowsfh:
 *                 rowsfh.write(
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))             # <<<<<<<<<<<<<<
 *                 rowsfh.write(b'\n')
 * 
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 2657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "bcolz/carray_ext.pyx":2658
 *                 rowsfh.write(
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))
 *                 rowsfh.write(b'\n')             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_b__47); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 2658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "bcolz/carray_ext.pyx":2655
 *             sizes['cbytes'] = self.cbytes
 *             rowsf = os.path.join(self.metadir, SIZES_FILE)
 *             with open(rowsf, 'wb') as rowsfh:             # <<<<<<<<<<<<<<
 *                 rowsfh.write(
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))
 */
  __pyx_tuple__115 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 2655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "bcolz/carray_ext.pyx":2724
 *             return (build_carray, (None,self.rootdir,))
 *         else:
 *             return (build_carray,(self[:],None,))             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __pyx_slice__116 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__116)) __PYX_ERR(0, 2724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__116);
  __Pyx_GIVEREF(__pyx_slice__116);

  /* "bcolz/carray_ext.pyx":2734
 * 
 *     def __array__(self, dtype=None, **kwargs):
 *         x = self[:]             # <<<<<<<<<<<<<<
 *         if dtype and x.dtype != dtype:
 *             x = x.astype(dtype)
 */
  __pyx_slice__117 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__117)) __PYX_ERR(0, 2734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__117);
  __Pyx_GIVEREF(__pyx_slice__117);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             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_tuple__118 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(2, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             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_tuple__119 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(2, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259
 *                 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_tuple__120 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(2, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799
 * 
 *         if (end - f) - <int>(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_tuple__121 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(2, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_tuple__122 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(2, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.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_tuple__123 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(2, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "bcolz/carray_ext.pyx":40
 * from .utils import build_carray
 * 
 * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *     _MAXINT = 2 ** 31 - 1
 *     _inttypes = (int, np.integer)
 */
  __pyx_tuple__124 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "bcolz/carray_ext.pyx":143
 * 
 * # Some utilities
 * def blosc_compressor_list():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_compressor_list()
 */
  __pyx_tuple__125 = PyTuple_Pack(2, __pyx_n_s_list_compr, __pyx_n_s_clist); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);
  __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_bcolz_bcolz_carray, __pyx_n_s_blosc_compressor_list, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 143, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":165
 *     return clist
 * 
 * def _blosc_set_nthreads(nthreads):             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_set_nthreads(nthreads)
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_n_s_nthreads); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_bcolz_bcolz_carray, __pyx_n_s_blosc_set_nthreads, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 165, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":183
 *     return blosc_set_nthreads(nthreads)
 * 
 * def _blosc_init():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_init()
 */
  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_bcolz_bcolz_carray, __pyx_n_s_blosc_init, 183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 183, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":192
 *     blosc_init()
 * 
 * def _blosc_destroy():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_destroy()
 */
  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_bcolz_bcolz_carray, __pyx_n_s_blosc_destroy, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 192, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":201
 *     blosc_destroy()
 * 
 * def blosc_version():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_version()
 */
  __pyx_tuple__127 = PyTuple_Pack(2, __pyx_n_s_ver_str, __pyx_n_s_ver_date); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_bcolz_bcolz_carray, __pyx_n_s_blosc_version, 201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 201, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":217
 *     return (ver_str, ver_date)
 * 
 * def list_bytes_to_str(lst):             # <<<<<<<<<<<<<<
 *     """The Python 3 JSON encoder doesn't accept 'bytes' objects,
 *     this utility function converts all bytes to strings.
 */
  __pyx_tuple__128 = PyTuple_Pack(2, __pyx_n_s_lst, __pyx_n_s_x); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);
  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_bcolz_bcolz_carray, __pyx_n_s_list_bytes_to_str, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 217, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":308
 * 
 * 
 * def _get_use_threads():             # <<<<<<<<<<<<<<
 *     global use_threads
 * 
 */
  __pyx_tuple__129 = PyTuple_Pack(1, __pyx_n_s_use_threads_2); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);
  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_bcolz_bcolz_carray, __pyx_n_s_get_use_threads, 308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 308, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":648
 *             struct.pack('<q', nchunks if nchunks is not None else -1))
 * 
 * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *     def decode_byte(byte):
 *         return byte
 */
  __pyx_tuple__130 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);

  /* "bcolz/carray_ext.pyx":649
 * 
 * if sys.version_info >= (3, 0):
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return byte
 * else:
 */
  __pyx_tuple__131 = PyTuple_Pack(1, __pyx_n_s_byte); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);
  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_bcolz_bcolz_carray, __pyx_n_s_decode_byte, 649, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 649, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":652
 *         return byte
 * else:
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):
 */
  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_n_s_byte); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_bcolz_bcolz_carray, __pyx_n_s_decode_byte, 652, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 652, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":654
 *     def decode_byte(byte):
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):             # <<<<<<<<<<<<<<
 *     return struct.unpack('<I', fourbyte)[0]
 * 
 */
  __pyx_tuple__133 = PyTuple_Pack(1, __pyx_n_s_fourbyte); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);
  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_bcolz_bcolz_carray, __pyx_n_s_decode_uint32, 654, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 654, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2147483647 = PyInt_FromLong(2147483647L); if (unlikely(!__pyx_int_2147483647)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_9223372036854775807 = PyInt_FromString((char *)"9223372036854775807", 0, 0); if (unlikely(!__pyx_int_9223372036854775807)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initcarray_ext(void); /*proto*/
PyMODINIT_FUNC initcarray_ext(void)
#else
PyMODINIT_FUNC PyInit_carray_ext(void); /*proto*/
PyMODINIT_FUNC PyInit_carray_ext(void)
#endif
{
  __Pyx_TraceDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __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_carray_ext(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __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("carray_ext", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_bcolz__carray_ext) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "bcolz.carray_ext")) {
      if (unlikely(PyDict_SetItemString(modules, "bcolz.carray_ext", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_5bcolz_10carray_ext_chunk = &__pyx_vtable_5bcolz_10carray_ext_chunk;
  __pyx_vtable_5bcolz_10carray_ext_chunk._getitem = (void (*)(struct __pyx_obj_5bcolz_10carray_ext_chunk *, int, int, char *))__pyx_f_5bcolz_10carray_ext_5chunk__getitem;
  __pyx_vtable_5bcolz_10carray_ext_chunk.compress_data = (PyObject *(*)(struct __pyx_obj_5bcolz_10carray_ext_chunk *, char *, size_t, size_t, PyObject *))__pyx_f_5bcolz_10carray_ext_5chunk_compress_data;
  __pyx_vtable_5bcolz_10carray_ext_chunk.compress_arrdata = (PyObject *(*)(struct __pyx_obj_5bcolz_10carray_ext_chunk *, PyArrayObject *, int, PyObject *, PyObject *))__pyx_f_5bcolz_10carray_ext_5chunk_compress_arrdata;
  if (PyType_Ready(&__pyx_type_5bcolz_10carray_ext_chunk) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
  __pyx_type_5bcolz_10carray_ext_chunk.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5bcolz_10carray_ext_chunk, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 330, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_6__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_6__getitem__.doc = __pyx_doc_5bcolz_10carray_ext_5chunk_6__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5bcolz_10carray_ext_5chunk_6__getitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5bcolz_10carray_ext_chunk, "__setitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 330, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_8__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_8__setitem__.doc = __pyx_doc_5bcolz_10carray_ext_5chunk_8__setitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5bcolz_10carray_ext_5chunk_8__setitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5bcolz_10carray_ext_chunk, "__str__"); if (unlikely(!wrapper)) __PYX_ERR(0, 330, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_10__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_10__str__.doc = __pyx_doc_5bcolz_10carray_ext_5chunk_10__str__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5bcolz_10carray_ext_5chunk_10__str__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5bcolz_10carray_ext_chunk, "__repr__"); if (unlikely(!wrapper)) __PYX_ERR(0, 330, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_12__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5bcolz_10carray_ext_5chunk_12__repr__.doc = __pyx_doc_5bcolz_10carray_ext_5chunk_12__repr__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5bcolz_10carray_ext_5chunk_12__repr__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5bcolz_10carray_ext_chunk.tp_dict, __pyx_vtabptr_5bcolz_10carray_ext_chunk) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "chunk", (PyObject *)&__pyx_type_5bcolz_10carray_ext_chunk) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
  __pyx_ptype_5bcolz_10carray_ext_chunk = &__pyx_type_5bcolz_10carray_ext_chunk;
  __pyx_vtabptr_5bcolz_10carray_ext_chunks = &__pyx_vtable_5bcolz_10carray_ext_chunks;
  __pyx_vtable_5bcolz_10carray_ext_chunks.read_chunk = (PyObject *(*)(struct __pyx_obj_5bcolz_10carray_ext_chunks *, PyObject *))__pyx_f_5bcolz_10carray_ext_6chunks_read_chunk;
  __pyx_vtable_5bcolz_10carray_ext_chunks._save = (PyObject *(*)(struct __pyx_obj_5bcolz_10carray_ext_chunks *, PyObject *, PyObject *))__pyx_f_5bcolz_10carray_ext_6chunks__save;
  __pyx_vtable_5bcolz_10carray_ext_chunks._chunk_file_name = (PyObject *(*)(struct __pyx_obj_5bcolz_10carray_ext_chunks *, PyObject *))__pyx_f_5bcolz_10carray_ext_6chunks__chunk_file_name;
  if (PyType_Ready(&__pyx_type_5bcolz_10carray_ext_chunks) < 0) __PYX_ERR(0, 699, __pyx_L1_error)
  __pyx_type_5bcolz_10carray_ext_chunks.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5bcolz_10carray_ext_chunks.tp_dict, __pyx_vtabptr_5bcolz_10carray_ext_chunks) < 0) __PYX_ERR(0, 699, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "chunks", (PyObject *)&__pyx_type_5bcolz_10carray_ext_chunks) < 0) __PYX_ERR(0, 699, __pyx_L1_error)
  __pyx_ptype_5bcolz_10carray_ext_chunks = &__pyx_type_5bcolz_10carray_ext_chunks;
  __pyx_vtabptr_5bcolz_10carray_ext_carray = &__pyx_vtable_5bcolz_10carray_ext_carray;
  __pyx_vtable_5bcolz_10carray_ext_carray.bool_update = (void (*)(struct __pyx_obj_5bcolz_10carray_ext_carray *, PyObject *, PyObject *))__pyx_f_5bcolz_10carray_ext_6carray_bool_update;
  __pyx_vtable_5bcolz_10carray_ext_carray.getitem_cache = (int (*)(struct __pyx_obj_5bcolz_10carray_ext_carray *, npy_intp, char *))__pyx_f_5bcolz_10carray_ext_6carray_getitem_cache;
  __pyx_vtable_5bcolz_10carray_ext_carray.reset_iter_sentinels = (PyObject *(*)(struct __pyx_obj_5bcolz_10carray_ext_carray *))__pyx_f_5bcolz_10carray_ext_6carray_reset_iter_sentinels;
  __pyx_vtable_5bcolz_10carray_ext_carray.check_zeros = (int (*)(struct __pyx_obj_5bcolz_10carray_ext_carray *, PyObject *))__pyx_f_5bcolz_10carray_ext_6carray_check_zeros;
  __pyx_vtable_5bcolz_10carray_ext_carray._adapt_dtype = (PyObject *(*)(struct __pyx_obj_5bcolz_10carray_ext_carray *, PyObject *, PyObject *))__pyx_f_5bcolz_10carray_ext_6carray__adapt_dtype;
  if (PyType_Ready(&__pyx_type_5bcolz_10carray_ext_carray) < 0) __PYX_ERR(0, 864, __pyx_L1_error)
  __pyx_type_5bcolz_10carray_ext_carray.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5bcolz_10carray_ext_carray, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 864, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5bcolz_10carray_ext_6carray_38__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5bcolz_10carray_ext_6carray_38__getitem__.doc = __pyx_doc_5bcolz_10carray_ext_6carray_38__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5bcolz_10carray_ext_6carray_38__getitem__;
    }
  }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5bcolz_10carray_ext_carray, "__setitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 864, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5bcolz_10carray_ext_6carray_40__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5bcolz_10carray_ext_6carray_40__setitem__.doc = __pyx_doc_5bcolz_10carray_ext_6carray_40__setitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5bcolz_10carray_ext_6carray_40__setitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5bcolz_10carray_ext_carray.tp_dict, __pyx_vtabptr_5bcolz_10carray_ext_carray) < 0) __PYX_ERR(0, 864, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "carray", (PyObject *)&__pyx_type_5bcolz_10carray_ext_carray) < 0) __PYX_ERR(0, 864, __pyx_L1_error)
  __pyx_ptype_5bcolz_10carray_ext_carray = &__pyx_type_5bcolz_10carray_ext_carray;
  /*--- 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_ERR(3, 9, __pyx_L1_error)
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(2, 155, __pyx_L1_error)
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 168, __pyx_L1_error)
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 172, __pyx_L1_error)
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 181, __pyx_L1_error)
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 861, __pyx_L1_error)
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __Pyx_TraceCall("PyMODINIT_FUNC PyInit_carray_ext(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));

  /* "bcolz/carray_ext.pyx":14
 * from __future__ import absolute_import
 * 
 * import sys             # <<<<<<<<<<<<<<
 * import os
 * import os.path
 */
  __Pyx_TraceLine(14,0,__PYX_ERR(0, 14, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":15
 * 
 * import sys
 * import os             # <<<<<<<<<<<<<<
 * import os.path
 * import struct
 */
  __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":16
 * import sys
 * import os
 * import os.path             # <<<<<<<<<<<<<<
 * import struct
 * import shutil
 */
  __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os_path, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":17
 * import os
 * import os.path
 * import struct             # <<<<<<<<<<<<<<
 * import shutil
 * import tempfile
 */
  __Pyx_TraceLine(17,0,__PYX_ERR(0, 17, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":18
 * import os.path
 * import struct
 * import shutil             # <<<<<<<<<<<<<<
 * import tempfile
 * import json
 */
  __Pyx_TraceLine(18,0,__PYX_ERR(0, 18, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_shutil, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_shutil, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":19
 * import struct
 * import shutil
 * import tempfile             # <<<<<<<<<<<<<<
 * import json
 * import datetime
 */
  __Pyx_TraceLine(19,0,__PYX_ERR(0, 19, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_tempfile, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":20
 * import shutil
 * import tempfile
 * import json             # <<<<<<<<<<<<<<
 * import datetime
 * import threading
 */
  __Pyx_TraceLine(20,0,__PYX_ERR(0, 20, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":21
 * import tempfile
 * import json
 * import datetime             # <<<<<<<<<<<<<<
 * import threading
 * 
 */
  __Pyx_TraceLine(21,0,__PYX_ERR(0, 21, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":22
 * import json
 * import datetime
 * import threading             # <<<<<<<<<<<<<<
 * 
 * import numpy as np
 */
  __Pyx_TraceLine(22,0,__PYX_ERR(0, 22, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":24
 * import threading
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * from numpy cimport (ndarray,
 */
  __Pyx_TraceLine(24,0,__PYX_ERR(0, 24, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":35
 * import cython
 * 
 * import bcolz             # <<<<<<<<<<<<<<
 * from bcolz import utils, attrs, array2string
 * 
 */
  __Pyx_TraceLine(35,0,__PYX_ERR(0, 35, __pyx_L1_error))
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_bcolz, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bcolz, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":36
 * 
 * import bcolz
 * from bcolz import utils, attrs, array2string             # <<<<<<<<<<<<<<
 * 
 * from .utils import build_carray
 */
  __Pyx_TraceLine(36,0,__PYX_ERR(0, 36, __pyx_L1_error))
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_utils);
  __Pyx_GIVEREF(__pyx_n_s_utils);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_utils);
  __Pyx_INCREF(__pyx_n_s_attrs);
  __Pyx_GIVEREF(__pyx_n_s_attrs);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_attrs);
  __Pyx_INCREF(__pyx_n_s_array2string);
  __Pyx_GIVEREF(__pyx_n_s_array2string);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_array2string);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_bcolz, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_utils); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_utils, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_attrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_attrs, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_array2string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array2string, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":38
 * from bcolz import utils, attrs, array2string
 * 
 * from .utils import build_carray             # <<<<<<<<<<<<<<
 * 
 * if sys.version_info >= (3, 0):
 */
  __Pyx_TraceLine(38,0,__PYX_ERR(0, 38, __pyx_L1_error))
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_build_carray);
  __Pyx_GIVEREF(__pyx_n_s_build_carray);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_build_carray);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_utils, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_build_carray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_build_carray, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":40
 * from .utils import build_carray
 * 
 * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *     _MAXINT = 2 ** 31 - 1
 *     _inttypes = (int, np.integer)
 */
  __Pyx_TraceLine(40,0,__PYX_ERR(0, 40, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__124, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __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_ERR(0, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":41
 * 
 * if sys.version_info >= (3, 0):
 *     _MAXINT = 2 ** 31 - 1             # <<<<<<<<<<<<<<
 *     _inttypes = (int, np.integer)
 * else:
 */
    __Pyx_TraceLine(41,0,__PYX_ERR(0, 41, __pyx_L1_error))
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXINT, __pyx_int_2147483647) < 0) __PYX_ERR(0, 41, __pyx_L1_error)

    /* "bcolz/carray_ext.pyx":42
 * if sys.version_info >= (3, 0):
 *     _MAXINT = 2 ** 31 - 1
 *     _inttypes = (int, np.integer)             # <<<<<<<<<<<<<<
 * else:
 *     _MAXINT = sys.maxint
 */
    __Pyx_TraceLine(42,0,__PYX_ERR(0, 42, __pyx_L1_error))
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_integer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __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_ERR(0, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_inttypes, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":40
 * from .utils import build_carray
 * 
 * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *     _MAXINT = 2 ** 31 - 1
 *     _inttypes = (int, np.integer)
 */
    goto __pyx_L2;
  }

  /* "bcolz/carray_ext.pyx":44
 *     _inttypes = (int, np.integer)
 * else:
 *     _MAXINT = sys.maxint             # <<<<<<<<<<<<<<
 *     _inttypes = (int, long, np.integer)
 * 
 */
  __Pyx_TraceLine(44,0,__PYX_ERR(0, 44, __pyx_L1_error))
  /*else*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_maxint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXINT, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":45
 * else:
 *     _MAXINT = sys.maxint
 *     _inttypes = (int, long, np.integer)             # <<<<<<<<<<<<<<
 * 
 * _KB = 1024
 */
    __Pyx_TraceLine(45,0,__PYX_ERR(0, 45, __pyx_L1_error))
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_integer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type)));
    __Pyx_INCREF(((PyObject *)(&PyLong_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyLong_Type)));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyLong_Type)));
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
    __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_inttypes, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L2:;

  /* "bcolz/carray_ext.pyx":47
 *     _inttypes = (int, long, np.integer)
 * 
 * _KB = 1024             # <<<<<<<<<<<<<<
 * _MB = 1024 * _KB
 * 
 */
  __Pyx_TraceLine(47,0,__PYX_ERR(0, 47, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KB, __pyx_int_1024) < 0) __PYX_ERR(0, 47, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":48
 * 
 * _KB = 1024
 * _MB = 1024 * _KB             # <<<<<<<<<<<<<<
 * 
 * # Directories for saving the data and metadata for bcolz persistency
 */
  __Pyx_TraceLine(48,0,__PYX_ERR(0, 48, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_KB); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_int_1024, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MB, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":51
 * 
 * # Directories for saving the data and metadata for bcolz persistency
 * DATA_DIR = 'data'             # <<<<<<<<<<<<<<
 * META_DIR = 'meta'
 * SIZES_FILE = 'sizes'
 */
  __Pyx_TraceLine(51,0,__PYX_ERR(0, 51, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DATA_DIR, __pyx_n_s_data) < 0) __PYX_ERR(0, 51, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":52
 * # Directories for saving the data and metadata for bcolz persistency
 * DATA_DIR = 'data'
 * META_DIR = 'meta'             # <<<<<<<<<<<<<<
 * SIZES_FILE = 'sizes'
 * STORAGE_FILE = 'storage'
 */
  __Pyx_TraceLine(52,0,__PYX_ERR(0, 52, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_META_DIR, __pyx_n_s_meta) < 0) __PYX_ERR(0, 52, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":53
 * DATA_DIR = 'data'
 * META_DIR = 'meta'
 * SIZES_FILE = 'sizes'             # <<<<<<<<<<<<<<
 * STORAGE_FILE = 'storage'
 * 
 */
  __Pyx_TraceLine(53,0,__PYX_ERR(0, 53, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIZES_FILE, __pyx_n_s_sizes) < 0) __PYX_ERR(0, 53, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":54
 * META_DIR = 'meta'
 * SIZES_FILE = 'sizes'
 * STORAGE_FILE = 'storage'             # <<<<<<<<<<<<<<
 * 
 * # For the persistence layer
 */
  __Pyx_TraceLine(54,0,__PYX_ERR(0, 54, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STORAGE_FILE, __pyx_n_s_storage) < 0) __PYX_ERR(0, 54, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":57
 * 
 * # For the persistence layer
 * EXTENSION = '.blp'             # <<<<<<<<<<<<<<
 * MAGIC = b'blpk'
 * BLOSCPACK_HEADER_LENGTH = 16
 */
  __Pyx_TraceLine(57,0,__PYX_ERR(0, 57, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTENSION, __pyx_kp_s_blp) < 0) __PYX_ERR(0, 57, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":58
 * # For the persistence layer
 * EXTENSION = '.blp'
 * MAGIC = b'blpk'             # <<<<<<<<<<<<<<
 * BLOSCPACK_HEADER_LENGTH = 16
 * BLOSC_HEADER_LENGTH = 16
 */
  __Pyx_TraceLine(58,0,__PYX_ERR(0, 58, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAGIC, __pyx_n_b_blpk) < 0) __PYX_ERR(0, 58, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":59
 * EXTENSION = '.blp'
 * MAGIC = b'blpk'
 * BLOSCPACK_HEADER_LENGTH = 16             # <<<<<<<<<<<<<<
 * BLOSC_HEADER_LENGTH = 16
 * FORMAT_VERSION = 1
 */
  __Pyx_TraceLine(59,0,__PYX_ERR(0, 59, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLOSCPACK_HEADER_LENGTH, __pyx_int_16) < 0) __PYX_ERR(0, 59, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":60
 * MAGIC = b'blpk'
 * BLOSCPACK_HEADER_LENGTH = 16
 * BLOSC_HEADER_LENGTH = 16             # <<<<<<<<<<<<<<
 * FORMAT_VERSION = 1
 * MAX_FORMAT_VERSION = 255
 */
  __Pyx_TraceLine(60,0,__PYX_ERR(0, 60, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLOSC_HEADER_LENGTH, __pyx_int_16) < 0) __PYX_ERR(0, 60, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":61
 * BLOSCPACK_HEADER_LENGTH = 16
 * BLOSC_HEADER_LENGTH = 16
 * FORMAT_VERSION = 1             # <<<<<<<<<<<<<<
 * MAX_FORMAT_VERSION = 255
 * MAX_CHUNKS = (2 ** 63) - 1
 */
  __Pyx_TraceLine(61,0,__PYX_ERR(0, 61, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORMAT_VERSION, __pyx_int_1) < 0) __PYX_ERR(0, 61, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":62
 * BLOSC_HEADER_LENGTH = 16
 * FORMAT_VERSION = 1
 * MAX_FORMAT_VERSION = 255             # <<<<<<<<<<<<<<
 * MAX_CHUNKS = (2 ** 63) - 1
 * 
 */
  __Pyx_TraceLine(62,0,__PYX_ERR(0, 62, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_FORMAT_VERSION, __pyx_int_255) < 0) __PYX_ERR(0, 62, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":63
 * FORMAT_VERSION = 1
 * MAX_FORMAT_VERSION = 255
 * MAX_CHUNKS = (2 ** 63) - 1             # <<<<<<<<<<<<<<
 * 
 * # The type used for size values: indexes, coordinates, dimension
 */
  __Pyx_TraceLine(63,0,__PYX_ERR(0, 63, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_CHUNKS, __pyx_int_9223372036854775807) < 0) __PYX_ERR(0, 63, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":67
 * # The type used for size values: indexes, coordinates, dimension
 * # lengths, row numbers, shapes, chunk shapes, byte counts...
 * SizeType = np.int64             # <<<<<<<<<<<<<<
 * 
 * # The native int type for this platform
 */
  __Pyx_TraceLine(67,0,__PYX_ERR(0, 67, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SizeType, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":70
 * 
 * # The native int type for this platform
 * IntType = np.dtype(np.int_)             # <<<<<<<<<<<<<<
 * 
 * #-----------------------------------------------------------------
 */
  __Pyx_TraceLine(70,0,__PYX_ERR(0, 70, __pyx_L1_error))
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IntType, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":138
 * # The numpy API requires this function to be called before
 * # using any numpy facilities in an extension module.
 * import_array()             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------
 */
  __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error))
  import_array();

  /* "bcolz/carray_ext.pyx":143
 * 
 * # Some utilities
 * def blosc_compressor_list():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_compressor_list()
 */
  __Pyx_TraceLine(143,0,__PYX_ERR(0, 143, __pyx_L1_error))
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_1blosc_compressor_list, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blosc_compressor_list, __pyx_t_1) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":165
 *     return clist
 * 
 * def _blosc_set_nthreads(nthreads):             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_set_nthreads(nthreads)
 */
  __Pyx_TraceLine(165,0,__PYX_ERR(0, 165, __pyx_L1_error))
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_3_blosc_set_nthreads, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blosc_set_nthreads, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":183
 *     return blosc_set_nthreads(nthreads)
 * 
 * def _blosc_init():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_init()
 */
  __Pyx_TraceLine(183,0,__PYX_ERR(0, 183, __pyx_L1_error))
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_5_blosc_init, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blosc_init, __pyx_t_1) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":192
 *     blosc_init()
 * 
 * def _blosc_destroy():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_destroy()
 */
  __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_7_blosc_destroy, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blosc_destroy, __pyx_t_1) < 0) __PYX_ERR(0, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":201
 *     blosc_destroy()
 * 
 * def blosc_version():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_version()
 */
  __Pyx_TraceLine(201,0,__PYX_ERR(0, 201, __pyx_L1_error))
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_9blosc_version, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blosc_version, __pyx_t_1) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":217
 *     return (ver_str, ver_date)
 * 
 * def list_bytes_to_str(lst):             # <<<<<<<<<<<<<<
 *     """The Python 3 JSON encoder doesn't accept 'bytes' objects,
 *     this utility function converts all bytes to strings.
 */
  __Pyx_TraceLine(217,0,__PYX_ERR(0, 217, __pyx_L1_error))
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_11list_bytes_to_str, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_bytes_to_str, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":305
 * # set the value of this variable to True or False to override the
 * # default adaptive behaviour
 * use_threads = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_TraceLine(305,0,__PYX_ERR(0, 305, __pyx_L1_error))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_use_threads, Py_None) < 0) __PYX_ERR(0, 305, __pyx_L1_error)

  /* "bcolz/carray_ext.pyx":308
 * 
 * 
 * def _get_use_threads():             # <<<<<<<<<<<<<<
 *     global use_threads
 * 
 */
  __Pyx_TraceLine(308,0,__PYX_ERR(0, 308, __pyx_L1_error))
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_13_get_use_threads, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_use_threads, __pyx_t_1) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":598
 * 
 * 
 * cdef create_bloscpack_header(nchunks=None, format_version=FORMAT_VERSION):             # <<<<<<<<<<<<<<
 *     """Create the bloscpack header string.
 * 
 */
  __Pyx_TraceLine(598,0,__PYX_ERR(0, 598, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT_VERSION); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__15 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":648
 *             struct.pack('<q', nchunks if nchunks is not None else -1))
 * 
 * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *     def decode_byte(byte):
 *         return byte
 */
  __Pyx_TraceLine(648,0,__PYX_ERR(0, 648, __pyx_L1_error))
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__130, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __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_ERR(0, 648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":649
 * 
 * if sys.version_info >= (3, 0):
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return byte
 * else:
 */
    __Pyx_TraceLine(649,0,__PYX_ERR(0, 649, __pyx_L1_error))
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_15decode_byte, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_byte, __pyx_t_1) < 0) __PYX_ERR(0, 649, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":648
 *             struct.pack('<q', nchunks if nchunks is not None else -1))
 * 
 * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *     def decode_byte(byte):
 *         return byte
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":652
 *         return byte
 * else:
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):
 */
  __Pyx_TraceLine(652,0,__PYX_ERR(0, 652, __pyx_L1_error))
  /*else*/ {
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_17decode_byte, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_byte, __pyx_t_1) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":654
 *     def decode_byte(byte):
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):             # <<<<<<<<<<<<<<
 *     return struct.unpack('<I', fourbyte)[0]
 * 
 */
  __Pyx_TraceLine(654,0,__PYX_ERR(0, 654, __pyx_L1_error))
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_19decode_uint32, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_uint32, __pyx_t_1) < 0) __PYX_ERR(0, 654, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1
 * #!python             # <<<<<<<<<<<<<<
 * #cython: embedsignature=True
 * #cython: linetrace=True
 */
  __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "../../../Users/faltet/miniconda3/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */
  __Pyx_TraceReturn(Py_None, 0);

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init bcolz.carray_ext", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init bcolz.carray_ext");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((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

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* Profile */
#if CYTHON_PROFILE
static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
                                   PyFrameObject** frame,
                                   const char *funcname,
                                   const char *srcfile,
                                   int firstlineno) {
    PyObject *type, *value, *traceback;
    int retval;
    PyThreadState* tstate = PyThreadState_GET();
    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
        if (*code == NULL) {
            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
            if (*code == NULL) return 0;
        }
        *frame = PyFrame_New(
            tstate,                          /*PyThreadState *tstate*/
            *code,                           /*PyCodeObject *code*/
            __pyx_d,                  /*PyObject *globals*/
            0                                /*PyObject *locals*/
        );
        if (*frame == NULL) return 0;
        if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
            Py_INCREF(Py_None);
            (*frame)->f_trace = Py_None;
        }
#if PY_VERSION_HEX < 0x030400B1
    } else {
        (*frame)->f_tstate = tstate;
#endif
    }
    (*frame)->f_lineno = firstlineno;
    retval = 1;
    tstate->tracing++;
    tstate->use_tracing = 0;
    PyErr_Fetch(&type, &value, &traceback);
    #if CYTHON_TRACE
    if (tstate->c_tracefunc)
        retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
    if (retval && tstate->c_profilefunc)
    #endif
        retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
    tstate->use_tracing = (tstate->c_profilefunc ||
                           (CYTHON_TRACE && tstate->c_tracefunc));
    tstate->tracing--;
    if (retval) {
        PyErr_Restore(type, value, traceback);
        return tstate->use_tracing && retval;
    } else {
        Py_XDECREF(type);
        Py_XDECREF(value);
        Py_XDECREF(traceback);
        return -1;
    }
}
static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyCodeObject *py_code = 0;
    #if PY_MAJOR_VERSION < 3
    py_funcname = PyString_FromString(funcname);
    py_srcfile = PyString_FromString(srcfile);
    #else
    py_funcname = PyUnicode_FromString(funcname);
    py_srcfile = PyUnicode_FromString(srcfile);
    #endif
    if (!py_funcname | !py_srcfile) goto bad;
    py_code = PyCode_New(
        0,
        #if PY_MAJOR_VERSION >= 3
        0,
        #endif
        0,
        0,
        0,
        __pyx_empty_bytes,     /*PyObject *code,*/
        __pyx_empty_tuple,     /*PyObject *consts,*/
        __pyx_empty_tuple,     /*PyObject *names,*/
        __pyx_empty_tuple,     /*PyObject *varnames,*/
        __pyx_empty_tuple,     /*PyObject *freevars,*/
        __pyx_empty_tuple,     /*PyObject *cellvars,*/
        py_srcfile,       /*PyObject *filename,*/
        py_funcname,      /*PyObject *name,*/
        firstlineno,
        __pyx_empty_bytes      /*PyObject *lnotab*/
    );
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return py_code;
}
#endif

/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

/* PyObjectCall */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
  #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* PyObjectCallNoArg */
    #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* None */
      static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* None */
      static CYTHON_INLINE npy_intp __Pyx_mod_npy_intp(npy_intp a, npy_intp b) {
    npy_intp r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* PyErrFetchRestore */
      #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* WriteUnraisableException */
      static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* RaiseArgTupleInvalid */
      static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
      static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
      static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_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,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* ExtTypeTest */
      static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(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;
}

/* RaiseException */
      #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* BytesEquals */
        static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
        static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* RaiseTooManyValuesToUnpack */
        static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
        static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
        static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_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
}

/* UnpackItemEndCheck */
        static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* GetItemInt */
        static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyIntBinop */
        #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyIntBinop */
        #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* SliceObject */
        static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_COMPILING_IN_CPYTHON
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* None */
        static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* SaveResetException */
        #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    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);
}
#endif

/* GetException */
        #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
#endif
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_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;
    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;
}

/* None */
          static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* PyIntBinop */
          #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) {
            Py_RETURN_TRUE;
        } else {
            Py_RETURN_FALSE;
        }
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
                default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
                #else
                default: Py_RETURN_FALSE;
                #endif
            }
        }
            if (a == b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            if ((double)a == (double)b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    return PyObject_RichCompare(op1, op2, Py_EQ);
}
#endif

/* PyErrExceptionMatches */
          #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    return PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* SliceObject */
          static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_ass_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_ass_slice(obj, cstart, cstop, value);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_ass_subscript))
#endif
    {
        int result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_COMPILING_IN_CPYTHON
        result = mp->mp_ass_subscript(obj, py_slice, value);
#else
        result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object does not support slice %.10s",
        Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
bad:
    return -1;
}

/* PyObjectCallMethod1 */
          static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

/* append */
          static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* Import */
          static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                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);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            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
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* PyObjectCallMethod0 */
          static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* UnpackUnboundCMethod */
          static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_O | METH_NOARGS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod0 */
          static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

/* pop */
          static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (Py_TYPE(L) == &PySet_Type) {
        return PySet_Pop(L);
    }
#endif
    return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop);
}
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) {
    if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) {
        Py_SIZE(L) -= 1;
        return PyList_GET_ITEM(L, PyList_GET_SIZE(L));
    }
    return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L);
}
#endif

/* None */
          static CYTHON_INLINE npy_intp __Pyx_div_npy_intp(npy_intp a, npy_intp b) {
    npy_intp q = a / b;
    npy_intp r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* KeywordStringCheck */
          static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_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,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* RaiseNoneIterError */
          static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
          static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
          static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                             int is_tuple, int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
        iternextfunc iternext;
        iter = PyObject_GetIter(tuple);
        if (unlikely(!iter)) goto bad;
        if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
        iternext = Py_TYPE(iter)->tp_iternext;
        value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
        value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
        if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
        Py_DECREF(iter);
    } else {
        if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
            __Pyx_UnpackTupleError(tuple, 2);
            goto bad;
        }
#if CYTHON_COMPILING_IN_PYPY
        value1 = PySequence_ITEM(tuple, 0);
        if (unlikely(!value1)) goto bad;
        value2 = PySequence_ITEM(tuple, 1);
        if (unlikely(!value2)) goto bad;
#else
        value1 = PyTuple_GET_ITEM(tuple, 0);
        value2 = PyTuple_GET_ITEM(tuple, 1);
        Py_INCREF(value1);
        Py_INCREF(value2);
#endif
        if (decref_tuple) { Py_DECREF(tuple); }
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
          static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
#if !CYTHON_COMPILING_IN_PYPY
    if (is_dict) {
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#endif
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* MergeKeywords */
          static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
    PyObject *iter, *key = NULL, *value = NULL;
    int source_is_dict, result;
    Py_ssize_t orig_length, ppos = 0;
    iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_n_s_items, &orig_length, &source_is_dict);
    if (unlikely(!iter)) {
        PyObject *args;
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        args = PyTuple_Pack(1, source_mapping);
        if (likely(args)) {
            PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL);
            Py_DECREF(args);
            if (likely(fallback)) {
                iter = __Pyx_dict_iterator(fallback, 1, __pyx_n_s_items, &orig_length, &source_is_dict);
                Py_DECREF(fallback);
            }
        }
        if (unlikely(!iter)) goto bad;
    }
    while (1) {
        result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict);
        if (unlikely(result < 0)) goto bad;
        if (!result) break;
        if (unlikely(PyDict_Contains(kwdict, key))) {
            __Pyx_RaiseDoubleKeywordsError("function", key);
            result = -1;
        } else {
            result = PyDict_SetItem(kwdict, key, value);
        }
        Py_DECREF(key);
        Py_DECREF(value);
        if (unlikely(result < 0)) goto bad;
    }
    Py_XDECREF(iter);
    return 0;
bad:
    Py_XDECREF(iter);
    return -1;
}

/* SetItemInt */
          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, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || 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 {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* ArgTypeTest */
            static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

/* SetVTable */
            static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* ImportFrom */
            static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CodeObjectCache */
            static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
            #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*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);
}

/* CIntFromPyVerify */
            #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(Py_intptr_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
    const char neg_one = (char) -1, const_zero = (char) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(char) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(char) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(char),
                                     little, !is_unsigned);
    }
}

/* None */
            #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

/* None */
            #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

/* None */
            #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

/* None */
            #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

/* CIntToPy */
            static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
    const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum NPY_TYPES) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
            static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
    const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(Py_intptr_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (Py_intptr_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Py_intptr_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (Py_intptr_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (Py_intptr_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(Py_intptr_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
                            return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
                            return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
                            return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(Py_intptr_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
                            return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(Py_intptr_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, long, PyLong_AsLong(x))
            } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            Py_intptr_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (Py_intptr_t) -1;
        }
    } else {
        Py_intptr_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (Py_intptr_t) -1;
        val = __Pyx_PyInt_As_Py_intptr_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to Py_intptr_t");
    return (Py_intptr_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to Py_intptr_t");
    return (Py_intptr_t) -1;
}

/* CIntFromPy */
            static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
            static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntFromPy */
            static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CheckBinaryVersion */
            static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* ModuleImport */
            #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

/* TypeImport */
            #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_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    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,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

/* InitStrings */
            static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  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_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (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;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
