/* Generated by Cython 0.23.4 */

#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_23_4"
#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_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)
#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]))
#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
#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
  #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 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; 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_Int(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 && __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 int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

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


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

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif

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


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

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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;

/* "../../home/faltet/miniconda/lib/python2.7/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":547
 * 
 * 
 * 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":295
 * 
 * 
 * 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":646
 *             'ctbytes': decode_uint32(buffer_[12:16])}
 * 
 * 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":811
 * 
 * 
 * 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) --- */
#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)

#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

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

#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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

#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

#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

static CYTHON_INLINE long __Pyx_div_long(long, long);

#define UNARY_NEG_WOULD_OVERFLOW(x)\
        (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

static CYTHON_INLINE npy_intp __Pyx_mod_npy_intp(npy_intp, npy_intp);

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

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

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);

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

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

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

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

#include <string.h>

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void);

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

#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);

#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

#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

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);

static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t);

#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

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

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

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

#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

#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

#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);

static double __Pyx__PyObject_AsDouble(PyObject* obj);
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj)\
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
 likely(PyInt_CheckExact(obj)) ?\
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj)\
((likely(PyFloat_CheckExact(obj))) ?\
 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

#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

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

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

typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

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

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));
}

static CYTHON_INLINE npy_intp __Pyx_div_npy_intp(npy_intp, npy_intp);

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

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

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

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);

static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping);

#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);

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

#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

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

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

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

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

static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

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

static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

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

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);

static int __Pyx_check_binary_version(void);

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

static PyObject *__Pyx_ImportModule(const char *name);

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

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 char __pyx_k_B[] = "<B";
static char __pyx_k_H[] = "H";
static char __pyx_k_I[] = "<I";
static char __pyx_k_L[] = "L";
static char __pyx_k_O[] = "O";
static char __pyx_k_Q[] = "Q";
static char __pyx_k_S[] = "S";
static char __pyx_k_a[] = "a";
static char __pyx_k_b[] = "b";
static char __pyx_k_d[] = "d";
static char __pyx_k_f[] = "f";
static char __pyx_k_g[] = "g";
static char __pyx_k_h[] = "h";
static char __pyx_k_i[] = "i";
static char __pyx_k_l[] = "l";
static char __pyx_k_q[] = "<q";
static char __pyx_k_r[] = "r";
static char __pyx_k_w[] = "w";
static char __pyx_k_x[] = "x";
static char __pyx_k_KB[] = "_KB";
static char __pyx_k_MB[] = "_MB";
static char __pyx_k_Zd[] = "Zd";
static char __pyx_k_Zf[] = "Zf";
static char __pyx_k_Zg[] = "Zg";
static char __pyx_k__2[] = ",";
static char __pyx_k__9[] = "\000\000\000";
static char __pyx_k_np[] = "np";
static char __pyx_k_os[] = "os";
static char __pyx_k_rb[] = "rb";
static char __pyx_k_tb[] = "tb";
static char __pyx_k_wb[] = "wb";
static char __pyx_k_B_2[] = "B";
static char __pyx_k_I_2[] = "I";
static char __pyx_k__38[] = "\n";
static char __pyx_k_blp[] = ".blp";
static char __pyx_k_d_s[] = "__%d%s";
static char __pyx_k_dir[] = "dir";
static char __pyx_k_hex[] = "hex";
static char __pyx_k_int[] = "int_";
static char __pyx_k_len[] = "len";
static char __pyx_k_lst[] = "lst";
static char __pyx_k_nan[] = "nan";
static char __pyx_k_new[] = "_new";
static char __pyx_k_out[] = "out";
static char __pyx_k_pop[] = "pop";
static char __pyx_k_q_2[] = "q";
static char __pyx_k_str[] = "__str__";
static char __pyx_k_sum[] = "sum";
static char __pyx_k_sys[] = "sys";
static char __pyx_k__103[] = "";
static char __pyx_k_atom[] = "atom";
static char __pyx_k_base[] = "base";
static char __pyx_k_blen[] = "blen";
static char __pyx_k_blpk[] = "blpk";
static char __pyx_k_bool[] = "bool_";
static char __pyx_k_byte[] = "byte";
static char __pyx_k_char[] = "char";
static char __pyx_k_copy[] = "copy";
static char __pyx_k_data[] = "data";
static char __pyx_k_date[] = "date";
static char __pyx_k_dflt[] = "dflt";
static char __pyx_k_eval[] = "eval";
static char __pyx_k_exit[] = "__exit__";
static char __pyx_k_iter[] = "iter";
static char __pyx_k_join[] = "join";
static char __pyx_k_json[] = "json";
static char __pyx_k_kind[] = "kind";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_meta[] = "meta";
static char __pyx_k_mode[] = "mode";
static char __pyx_k_ndim[] = "ndim";
static char __pyx_k_next[] = "_next";
static char __pyx_k_open[] = "open";
static char __pyx_k_pack[] = "pack";
static char __pyx_k_path[] = "path";
static char __pyx_k_prod[] = "prod";
static char __pyx_k_read[] = "read";
static char __pyx_k_safe[] = "safe";
static char __pyx_k_seek[] = "seek";
static char __pyx_k_size[] = "size";
static char __pyx_k_skip[] = "skip";
static char __pyx_k_step[] = "step";
static char __pyx_k_stop[] = "stop";
static char __pyx_k_temp[] = "__temp__";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_time[] = "time";
static char __pyx_k_trim[] = "trim";
static char __pyx_k_type[] = "type";
static char __pyx_k_view[] = "view";
static char __pyx_k_MAGIC[] = "MAGIC";
static char __pyx_k_array[] = "array";
static char __pyx_k_ascii[] = "ascii";
static char __pyx_k_attrs[] = "attrs";
static char __pyx_k_bcolz[] = "bcolz";
static char __pyx_k_clist[] = "clist";
static char __pyx_k_cname[] = "cname";
static char __pyx_k_compr[] = "_compr";
static char __pyx_k_count[] = "count";
static char __pyx_k_dtype[] = "dtype";
static char __pyx_k_dumps[] = "dumps";
static char __pyx_k_empty[] = "empty";
static char __pyx_k_enter[] = "__enter__";
static char __pyx_k_flags[] = "flags";
static char __pyx_k_flush[] = "flush";
static char __pyx_k_index[] = "index";
static char __pyx_k_int32[] = "int32";
static char __pyx_k_int64[] = "int64";
static char __pyx_k_isdir[] = "isdir";
static char __pyx_k_items[] = "items";
static char __pyx_k_limit[] = "limit";
static char __pyx_k_loads[] = "loads";
static char __pyx_k_mkdir[] = "mkdir";
static char __pyx_k_numpy[] = "numpy";
static char __pyx_k_range[] = "range";
static char __pyx_k_shape[] = "shape";
static char __pyx_k_sizes[] = "sizes";
static char __pyx_k_split[] = "split";
static char __pyx_k_start[] = "start";
static char __pyx_k_utils[] = "utils";
static char __pyx_k_value[] = "value";
static char __pyx_k_where[] = "where";
static char __pyx_k_write[] = "write";
static char __pyx_k_zeros[] = "zeros";
static char __pyx_k_MAXINT[] = "_MAXINT";
static char __pyx_k_append[] = "append";
static char __pyx_k_arange[] = "arange";
static char __pyx_k_arrlen[] = "arrlen";
static char __pyx_k_buffer[] = "buffer";
static char __pyx_k_cbytes[] = "cbytes";
static char __pyx_k_clevel[] = "clevel";
static char __pyx_k_ctypes[] = "ctypes";
static char __pyx_k_decode[] = "decode";
static char __pyx_k_encode[] = "encode";
static char __pyx_k_exists[] = "exists";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_maxint[] = "maxint";
static char __pyx_k_memory[] = "_memory";
static char __pyx_k_mkdirs[] = "_mkdirs";
static char __pyx_k_mode_s[] = "  mode    := '%s'\n";
static char __pyx_k_nbytes[] = "nbytes";
static char __pyx_k_object[] = "object_";
static char __pyx_k_pickle[] = "pickle";
static char __pyx_k_remove[] = "remove";
static char __pyx_k_rename[] = "rename";
static char __pyx_k_resize[] = "resize";
static char __pyx_k_rmtree[] = "rmtree";
static char __pyx_k_shutil[] = "shutil";
static char __pyx_k_struct[] = "struct";
static char __pyx_k_suffix[] = "suffix";
static char __pyx_k_tolist[] = "tolist";
static char __pyx_k_unpack[] = "unpack";
static char __pyx_k_xrange[] = "xrange";
static char __pyx_k_IOError[] = "IOError";
static char __pyx_k_IntType[] = "IntType";
static char __pyx_k_boolarr[] = "boolarr";
static char __pyx_k_cparams[] = "cparams";
static char __pyx_k_ctbytes[] = "ctbytes";
static char __pyx_k_datadir[] = "datadir";
static char __pyx_k_dirname[] = "dirname";
static char __pyx_k_dobject[] = "dobject";
static char __pyx_k_flatten[] = "flatten";
static char __pyx_k_getdata[] = "getdata";
static char __pyx_k_getitem[] = "__getitem__";
static char __pyx_k_indices[] = "indices";
static char __pyx_k_integer[] = "integer";
static char __pyx_k_mkdtemp[] = "mkdtemp";
static char __pyx_k_os_path[] = "os.path";
static char __pyx_k_reshape[] = "reshape";
static char __pyx_k_rootdir[] = "rootdir";
static char __pyx_k_shuffle[] = "shuffle";
static char __pyx_k_squeeze[] = "squeeze";
static char __pyx_k_storage[] = "storage";
static char __pyx_k_strides[] = "strides";
static char __pyx_k_ver_str[] = "ver_str";
static char __pyx_k_version[] = "version";
static char __pyx_k_xchunks[] = "xchunks";
static char __pyx_k_DATA_DIR[] = "DATA_DIR";
static char __pyx_k_META_DIR[] = "META_DIR";
static char __pyx_k_SizeType[] = "SizeType";
static char __pyx_k_chunklen[] = "chunklen";
static char __pyx_k_datetime[] = "datetime";
static char __pyx_k_fourbyte[] = "fourbyte";
static char __pyx_k_fromiter[] = "fromiter";
static char __pyx_k_getudata[] = "getudata";
static char __pyx_k_inttypes[] = "_inttypes";
static char __pyx_k_itemsize[] = "itemsize";
static char __pyx_k_metainfo[] = "metainfo";
static char __pyx_k_nthreads[] = "nthreads";
static char __pyx_k_tempfile[] = "tempfile";
static char __pyx_k_typesize[] = "typesize";
static char __pyx_k_ver_date[] = "ver_date";
static char __pyx_k_EXTENSION[] = "EXTENSION";
static char __pyx_k_TypeError[] = "TypeError";
static char __pyx_k_blocksize[] = "blocksize";
static char __pyx_k_cparams_r[] = "  cparams := %r\n";
static char __pyx_k_enumerate[] = "enumerate";
static char __pyx_k_hasobject[] = "hasobject";
static char __pyx_k_init_iter[] = "_init_iter";
static char __pyx_k_read_meta[] = "_read_meta";
static char __pyx_k_rootdir_s[] = "  rootdir := '%s'\n";
static char __pyx_k_store_obj[] = "_store_obj";
static char __pyx_k_versionlz[] = "versionlz";
static char __pyx_k_IndexError[] = "IndexError";
static char __pyx_k_MAX_CHUNKS[] = "MAX_CHUNKS";
static char __pyx_k_SIZES_FILE[] = "SIZES_FILE";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_blosc_init[] = "_blosc_init";
static char __pyx_k_carray_s_s[] = "carray(%s, %s)\n";
static char __pyx_k_cbytes_int[] = "cbytes: 'int'";
static char __pyx_k_contiguous[] = "contiguous";
static char __pyx_k_init_where[] = "_init_where";
static char __pyx_k_list_compr[] = "list_compr";
static char __pyx_k_nbytes_int[] = "nbytes: 'int'";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_to_ndarray[] = "to_ndarray";
static char __pyx_k_write_meta[] = "_write_meta";
static char __pyx_k_decode_byte[] = "decode_byte";
static char __pyx_k_expectedlen[] = "expectedlen";
static char __pyx_k_fill_chunks[] = "_fill_chunks";
static char __pyx_k_issubsctype[] = "issubsctype";
static char __pyx_k_open_carray[] = "_open_carray";
static char __pyx_k_RuntimeError[] = "RuntimeError";
static char __pyx_k_STORAGE_FILE[] = "STORAGE_FILE";
static char __pyx_k_array2string[] = "array2string";
static char __pyx_k_atomsize_int[] = "atomsize: 'int'";
static char __pyx_k_build_carray[] = "build_carray";
static char __pyx_k_ensure_ascii[] = "ensure_ascii";
static char __pyx_k_itemsize_int[] = "itemsize: 'int'";
static char __pyx_k_version_info[] = "version_info";
static char __pyx_k_OverflowError[] = "OverflowError";
static char __pyx_k_StopIteration[] = "StopIteration";
static char __pyx_k_blocksize_int[] = "blocksize: 'int'";
static char __pyx_k_blosc_destroy[] = "_blosc_destroy";
static char __pyx_k_blosc_version[] = "blosc_version";
static char __pyx_k_chunks_object[] = "chunks: object";
static char __pyx_k_create_carray[] = "_create_carray";
static char __pyx_k_decode_uint32[] = "decode_uint32";
static char __pyx_k_free_cachemem[] = "free_cachemem";
static char __pyx_k_i_nchunks_d_d[] = "i, nchunks: %d, %d";
static char __pyx_k_FORMAT_VERSION[] = "FORMAT_VERSION";
static char __pyx_k_calc_chunksize[] = "calc_chunksize";
static char __pyx_k_getitem_object[] = "_getitem_object";
static char __pyx_k_init_wheretrue[] = "_init_wheretrue";
static char __pyx_k_HIGHEST_PROTOCOL[] = "HIGHEST_PROTOCOL";
static char __pyx_k_bcolz_carray_ext[] = "bcolz.carray_ext";
static char __pyx_k_key_not_suitable[] = "key not suitable:";
static char __pyx_k_list_bytes_to_str[] = "list_bytes_to_str";
static char __pyx_k_update_disk_sizes[] = "_update_disk_sizes";
static char __pyx_k_MAX_FORMAT_VERSION[] = "MAX_FORMAT_VERSION";
static char __pyx_k_blosc_set_nthreads[] = "_blosc_set_nthreads";
static char __pyx_k_index_out_of_range[] = "index out of range";
static char __pyx_k_BLOSC_HEADER_LENGTH[] = "BLOSC_HEADER_LENGTH";
static char __pyx_k_NotImplementedError[] = "NotImplementedError";
static char __pyx_k_human_readable_size[] = "human_readable_size";
static char __pyx_k_key_not_supported_s[] = "key not supported: %s";
static char __pyx_k_blosc_compressor_list[] = "blosc_compressor_list";
static char __pyx_k_chunkfile_s_not_found[] = "chunkfile %s not found";
static char __pyx_k_BLOSCPACK_HEADER_LENGTH[] = "BLOSCPACK_HEADER_LENGTH";
static char __pyx_k_The_size_of_this_object[] = "The size of this object.";
static char __pyx_k_boolarr_is_not_an_array[] = "`boolarr` is not an array";
static char __pyx_k_mode_should_be_r_w_or_a[] = "mode should be 'r', 'w' or 'a'";
static char __pyx_k_The_dtype_of_this_object[] = "The dtype of this object.";
static char __pyx_k_The_shape_of_this_object[] = "The shape of this object.";
static char __pyx_k_is_not_a_supported_dtype[] = " is not a supported dtype";
static char __pyx_k_empty_tuple_not_supported[] = "empty tuple not supported";
static char __pyx_k_nitems_cannot_be_negative[] = "`nitems` cannot be negative";
static char __pyx_k_nitems_must_be_an_integer[] = "`nitems` must be an integer";
static char __pyx_k_atomic_size_cannot_be_zero[] = "atomic size cannot be zero";
static char __pyx_k_nbytes_s_cbytes_s_ratio_2f[] = "  nbytes: %s; cbytes: %s; ratio: %.2f\n";
static char __pyx_k_self_is_not_unidimensional[] = "`self` is not unidimensional";
static char __pyx_k_chunk_filename_s_does_exist[] = "chunk filename %s does exist";
static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static char __pyx_k_The_directory_for_data_files[] = "The directory for data files.";
static char __pyx_k_atomic_size_is_too_large_2_GB[] = "atomic size is too large (>= 2 GB)";
static char __pyx_k_data_directory_does_not_exist[] = "data directory does not exist";
static char __pyx_k_meta_directory_does_not_exist[] = "meta directory does not exist";
static char __pyx_k_root_directory_does_not_exist[] = "root directory does not exist";
static char __pyx_k_Number_of_chunks_in_the_carray[] = "Number of chunks in the carray";
static char __pyx_k_The_NumPy_dtype_for_this_chunk[] = "The NumPy dtype for this chunk.";
static char __pyx_k_nchunks_must_be_in_the_range_0[] = "'nchunks' must be in the range 0 <= n <= %d, not '%s'";
static char __pyx_k_nitems_must_be_less_than_total[] = "`nitems` must be less than total length";
static char __pyx_k_tmp_bcolz_bcolz_carray_ext_pyx[] = "/tmp/bcolz/bcolz/carray_ext.pyx";
static char __pyx_k_Number_of_bytes_in_the_leftover[] = "Number of bytes in the leftover_array";
static char __pyx_k_The_attribute_accessor_See_Also[] = "The attribute accessor.\n\n        See Also\n        --------\n\n        attrs.attrs\n\n        ";
static char __pyx_k_The_length_leading_dimension_of[] = "The length (leading dimension) of this object.";
static char __pyx_k_The_number_of_leftover_elements[] = "The number of leftover elements.";
static char __pyx_k_array_dtype_does_not_match_with[] = "array dtype does not match with self";
static char __pyx_k_boolarr_is_not_an_array_of_bool[] = "`boolarr` is not an array of booleans";
static char __pyx_k_boolarr_must_be_of_the_same_len[] = "`boolarr` must be of the same length than ``self``";
static char __pyx_k_boolean_array_length_must_match[] = "boolean array length must match len(self)";
static char __pyx_k_boolean_expression_outcome_must[] = "boolean expression outcome must match len(self)";
static char __pyx_k_cannot_modify_data_because_mode[] = "cannot modify data because mode is '%s'";
static char __pyx_k_cannot_modify_the_rootdir_value[] = "cannot modify the rootdir value of an in-memory carray";
static char __pyx_k_chunk_s_nbytes_d_cbytes_d_ratio[] = "chunk(%s)  nbytes: %d; cbytes: %d; ratio: %.2f\n%r";
static char __pyx_k_cparams_param_must_be_an_instan[] = "`cparams` param must be an instance of `cparams` class";
static char __pyx_k_newshape_is_not_compatible_with[] = "`newshape` is not compatible with the current one";
static char __pyx_k_only_one_shape_dimension_can_be[] = "only one shape dimension can be -1";
static char __pyx_k_self_is_not_an_array_of_boolean[] = "`self` is not an array of booleans";
static char __pyx_k_step_param_can_only_be_positive[] = "step param can only be positive";
static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_Array_containing_the_leftovers_c[] = "Array containing the leftovers chunk (uncompressed chunk)";
static char __pyx_k_Compressor_s_is_not_available_in[] = "Compressor '%s' is not available in this build";
static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_List_of_tuples_indicating_the_bo[] = "List of tuples indicating the bounds for each chunk";
static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static char __pyx_k_Number_of_elements_in_the_leftov[] = "Number of elements in the leftover_array";
static char __pyx_k_Pointer_referring_to_the_leftove[] = "Pointer referring to the leftover_array";
static char __pyx_k_The_chunklen_of_this_object_in_r[] = "The chunklen of this object (in rows).";
static char __pyx_k_The_compressed_size_of_this_obje[] = "The compressed size of this object (in bytes).";
static char __pyx_k_The_compression_parameters_for_t[] = "The compression parameters for this object.";
static char __pyx_k_The_default_value_of_this_object[] = "The default value of this object.";
static char __pyx_k_The_mode_used_to_create_open_the[] = "The mode used to create/open the `mode`.";
static char __pyx_k_The_number_of_dimensions_of_this[] = "The number of dimensions of this object.";
static char __pyx_k_The_on_disk_directory_used_for_p[] = "The on-disk directory used for persistency.";
static char __pyx_k_The_original_uncompressed_size_o[] = "The original (uncompressed) size of this object (in bytes).";
static char __pyx_k_The_size_cannot_be_larger_than_2[] = "The size cannot be larger than 2**31 on 32-bit platforms";
static char __pyx_k_This_function_can_only_be_used_f[] = "This function can only be used for persistency";
static char __pyx_k_Whether_or_not_to_perform_type_s[] = "Whether or not to perform type/shape checks on every operation.";
static char __pyx_k_You_need_at_least_to_pass_an_arr[] = "You need at least to pass an array or/and a rootdir";
static char __pyx_k_array_trailing_dimensions_do_not[] = "array trailing dimensions do not match with self";
static char __pyx_k_arrays_used_as_indices_must_be_i[] = "arrays used as indices must be integer (or boolean)";
static char __pyx_k_arrays_used_as_indices_must_be_o[] = "arrays used as indices must be of integer (or boolean) type";
static char __pyx_k_cannot_perform_reduce_with_flexi[] = "cannot perform reduce with flexible type";
static char __pyx_k_chunklen_must_be_a_positive_inte[] = "chunklen must be a positive integer";
static char __pyx_k_creating_carrays_from_scalar_obj[] = "creating carrays from scalar objects is not supported";
static char __pyx_k_error_decompressing_the_last_chu[] = "error decompressing the last chunk (error code: %d)";
static char __pyx_k_fatal_error_during_Blosc_compres[] = "fatal error during Blosc compression: %d";
static char __pyx_k_fatal_error_during_Blosc_decompr[] = "fatal error during Blosc decompression: %d";
static char __pyx_k_key_cannot_be_converted_to_an_ar[] = "key cannot be converted to an array of indices";
static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static char __pyx_k_only_boolean_expressions_support[] = "only boolean expressions supported";
static char __pyx_k_specified_rootdir_path_s_already[] = "specified rootdir path '%s' already exists and creation mode is '%s'";
static char __pyx_k_step_in_slice_can_only_be_positi[] = "step in slice can only be positive";
static 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 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_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__103;
static PyObject *__pyx_kp_s__2;
static PyObject *__pyx_kp_b__38;
static PyObject *__pyx_kp_b__9;
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_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_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_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_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_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_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_nan;
static PyObject *__pyx_n_s_nbytes;
static PyObject *__pyx_kp_s_nbytes_s_cbytes_s_ratio_2f;
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_n_s_prod;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_kp_s_q;
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_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_time;
static PyObject *__pyx_kp_s_tmp_bcolz_bcolz_carray_ext_pyx;
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_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_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_12decode_byte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_byte); /* 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_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_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_44__iter__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_46iter(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_48_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_50wheretrue(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_52_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_54where(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_56_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_58__next__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_60_update_disk_sizes(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_62flush(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_64purge(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_66__str__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_68__repr__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_70__reduce__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_72__enter__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5bcolz_10carray_ext_6carray_74__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_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__8;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_slice__7;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_slice__11;
static PyObject *__pyx_slice__12;
static PyObject *__pyx_slice__13;
static PyObject *__pyx_slice__20;
static PyObject *__pyx_slice__22;
static PyObject *__pyx_slice__26;
static PyObject *__pyx_slice__30;
static PyObject *__pyx_slice__34;
static PyObject *__pyx_slice__48;
static PyObject *__pyx_slice__60;
static PyObject *__pyx_slice__67;
static PyObject *__pyx_slice__71;
static PyObject *__pyx_slice__73;
static PyObject *__pyx_slice__74;
static PyObject *__pyx_slice__83;
static PyObject *__pyx_slice__85;
static PyObject *__pyx_slice__86;
static PyObject *__pyx_slice__92;
static PyObject *__pyx_slice__93;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
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__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__84;
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__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_slice__107;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_codeobj__116;
static PyObject *__pyx_codeobj__118;
static PyObject *__pyx_codeobj__119;
static PyObject *__pyx_codeobj__120;
static PyObject *__pyx_codeobj__122;
static PyObject *__pyx_codeobj__124;
static PyObject *__pyx_codeobj__127;
static PyObject *__pyx_codeobj__129;
static PyObject *__pyx_codeobj__131;

/* "bcolz/carray_ext.pyx":134
 * 
 * # 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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("blosc_compressor_list", 0);

  /* "bcolz/carray_ext.pyx":149
 *         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_t_1 = __Pyx_PyBytes_FromString(blosc_list_compressors()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_list_compr = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":150
 *     """
 *     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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple_, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":152
 *     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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_list_compr, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __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":150
 *     """
 *     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":153
 *         # Convert compressor names into regular strings in Python 3 (unicode)
 *         list_compr = list_compr.decode()
 *     clist = list_compr.split(',')             # <<<<<<<<<<<<<<
 *     return clist
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_list_compr, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __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":154
 *         list_compr = list_compr.decode()
 *     clist = list_compr.split(',')
 *     return clist             # <<<<<<<<<<<<<<
 * 
 * def _blosc_set_nthreads(nthreads):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_clist);
  __pyx_r = __pyx_v_clist;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":134
 * 
 * # 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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":156
 *     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_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_blosc_set_nthreads", 0);

  /* "bcolz/carray_ext.pyx":172
 *         The previous setting for the number of threads.
 *     """
 *     return blosc_set_nthreads(nthreads)             # <<<<<<<<<<<<<<
 * 
 * def _blosc_init():
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_nthreads); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_From_int(blosc_set_nthreads(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":156
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":174
 *     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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_blosc_init", 0);

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

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

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

/* "bcolz/carray_ext.pyx":183
 *     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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_blosc_destroy", 0);

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

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

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

/* "bcolz/carray_ext.pyx":192
 *     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_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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("blosc_version", 0);

  /* "bcolz/carray_ext.pyx":200
 *     """
 *     # 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_t_1 = __Pyx_PyBytes_FromString(((char *)BLOSC_VERSION_STRING)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ver_str = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":201
 *     # 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_t_2 = PyObject_HasAttr(__pyx_v_ver_str, __pyx_n_s_decode); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":202
 *     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_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ver_str, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __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":201
 *     # 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":203
 *     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_t_1 = __Pyx_PyBytes_FromString(((char *)BLOSC_VERSION_DATE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ver_date = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":204
 *         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_t_3 = PyObject_HasAttr(__pyx_v_ver_date, __pyx_n_s_decode); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":205
 *     ver_date = <char *> BLOSC_VERSION_DATE
 *     if hasattr(ver_date, "decode"):
 *         ver_date = ver_date.decode()             # <<<<<<<<<<<<<<
 *     return (ver_str, ver_date)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ver_date, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __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":204
 *         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":206
 *     if hasattr(ver_date, "decode"):
 *         ver_date = ver_date.decode()
 *     return (ver_str, ver_date)             # <<<<<<<<<<<<<<
 * 
 * def list_bytes_to_str(lst):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __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":192
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":208
 *     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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_bytes_to_str", 0);

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

    /* "bcolz/carray_ext.pyx":213
 *     """
 *     if isinstance(lst, bytes):
 *         return lst.decode('ascii')             # <<<<<<<<<<<<<<
 *     elif isinstance(lst, list):
 *         return [list_bytes_to_str(x) for x in lst]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_lst, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __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":212
 *     this utility function converts all bytes to strings.
 *     """
 *     if isinstance(lst, bytes):             # <<<<<<<<<<<<<<
 *         return lst.decode('ascii')
 *     elif isinstance(lst, list):
 */
  }

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

    /* "bcolz/carray_ext.pyx":215
 *         return lst.decode('ascii')
 *     elif isinstance(lst, list):
 *         return [list_bytes_to_str(x) for x in lst]             # <<<<<<<<<<<<<<
 *     else:
 *         return lst
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
      } else {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __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":214
 *     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":217
 *         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
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_lst);
    __pyx_r = __pyx_v_lst;
    goto __pyx_L0;
  }

  /* "bcolz/carray_ext.pyx":208
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":220
 * 
 * # 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_RefNannyDeclarations
  int __pyx_t_1;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_len_of_range", 0);

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

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

    /* "bcolz/carray_ext.pyx":227
 *     if start < stop:
 *         # Do not use a cython.cdiv here (do not ask me why!)
 *         n = ((stop - start - 1) // step + 1)             # <<<<<<<<<<<<<<
 *     return n
 * 
 */
    __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_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_n = (__Pyx_div_long(__pyx_t_2, __pyx_v_step) + 1);

    /* "bcolz/carray_ext.pyx":225
 * 
 *     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":228
 *         # 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_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":220
 * 
 * # 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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":230
 *     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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clip_chunk", 0);

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

  /* "bcolz/carray_ext.pyx":236
 * 
 *     startb = start - nchunk * chunklen
 *     stopb = stop - nchunk * chunklen             # <<<<<<<<<<<<<<
 * 
 *     # Check limits
 */
  __pyx_v_stopb = (__pyx_v_stop - (__pyx_v_nchunk * __pyx_v_chunklen));

  /* "bcolz/carray_ext.pyx":239
 * 
 *     # Check limits
 *     if (startb >= chunklen) or (stopb <= 0):             # <<<<<<<<<<<<<<
 *         return startb, stopb, 0  # null size
 *     if startb < 0:
 */
  __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":240
 *     # Check limits
 *     if (startb >= chunklen) or (stopb <= 0):
 *         return startb, stopb, 0  # null size             # <<<<<<<<<<<<<<
 *     if startb < 0:
 *         startb = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __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":239
 * 
 *     # Check limits
 *     if (startb >= chunklen) or (stopb <= 0):             # <<<<<<<<<<<<<<
 *         return startb, stopb, 0  # null size
 *     if startb < 0:
 */
  }

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

    /* "bcolz/carray_ext.pyx":242
 *         return startb, stopb, 0  # null size
 *     if startb < 0:
 *         startb = 0             # <<<<<<<<<<<<<<
 *     if stopb > chunklen:
 *         stopb = chunklen
 */
    __pyx_v_startb = 0;

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

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

    /* "bcolz/carray_ext.pyx":244
 *         startb = 0
 *     if stopb > chunklen:
 *         stopb = chunklen             # <<<<<<<<<<<<<<
 * 
 *     # step corrections
 */
    __pyx_v_stopb = __pyx_v_chunklen;

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

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

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

    /* "bcolz/carray_ext.pyx":250
 *         # Just correcting startb is enough
 *         distance = (nchunk * chunklen + startb) - start
 *         if distance % step > 0:             # <<<<<<<<<<<<<<
 *             startb += (step - (distance % step))
 *             if startb > chunklen:
 */
    if (unlikely(__pyx_v_step == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __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":251
 *         distance = (nchunk * chunklen + startb) - start
 *         if distance % step > 0:
 *             startb += (step - (distance % step))             # <<<<<<<<<<<<<<
 *             if startb > chunklen:
 *                 return startb, stopb, 0  # null size
 */
      if (unlikely(__pyx_v_step == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __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":252
 *         if distance % step > 0:
 *             startb += (step - (distance % step))
 *             if startb > chunklen:             # <<<<<<<<<<<<<<
 *                 return startb, stopb, 0  # null size
 * 
 */
      __pyx_t_1 = ((__pyx_v_startb > __pyx_v_chunklen) != 0);
      if (__pyx_t_1) {

        /* "bcolz/carray_ext.pyx":253
 *             startb += (step - (distance % step))
 *             if startb > chunklen:
 *                 return startb, stopb, 0  # null size             # <<<<<<<<<<<<<<
 * 
 *     # Compute size of the clipped block
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __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":252
 *         if distance % step > 0:
 *             startb += (step - (distance % step))
 *             if startb > chunklen:             # <<<<<<<<<<<<<<
 *                 return startb, stopb, 0  # null size
 * 
 */
      }

      /* "bcolz/carray_ext.pyx":250
 *         # 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":247
 * 
 *     # step corrections
 *     if step > 1:             # <<<<<<<<<<<<<<
 *         # Just correcting startb is enough
 *         distance = (nchunk * chunklen + startb) - start
 */
  }

  /* "bcolz/carray_ext.pyx":256
 * 
 *     # Compute size of the clipped block
 *     blen = get_len_of_range(startb, stopb, step)             # <<<<<<<<<<<<<<
 * 
 *     return startb, stopb, blen
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_blen = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":258
 *     blen = get_len_of_range(startb, stopb, step)
 * 
 *     return startb, stopb, blen             # <<<<<<<<<<<<<<
 * 
 * cdef int check_zeros(char *data, int nbytes):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __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":230
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":260
 *     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_RefNannyDeclarations
  size_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_zeros", 0);

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

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

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

  /* "bcolz/carray_ext.pyx":268
 *     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_t_1 = (sizeof(size_t));
  if (unlikely(__pyx_t_1 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_leftover = (__pyx_v_nbytes % __pyx_t_1);

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

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

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

            /* "bcolz/carray_ext.pyx":272
 *         for i from 0 <= i < chunklen:
 *             if sdata[i] != 0:
 *                 iszero = 0             # <<<<<<<<<<<<<<
 *                 break
 *         else:
 */
            __pyx_v_iszero = 0;

            /* "bcolz/carray_ext.pyx":273
 *             if sdata[i] != 0:
 *                 iszero = 0
 *                 break             # <<<<<<<<<<<<<<
 *         else:
 *             data += nbytes - leftover
 */
            goto __pyx_L7_break;

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

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

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

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

              /* "bcolz/carray_ext.pyx":278
 *             for i from 0 <= i < leftover:
 *                 if data[i] != 0:
 *                     iszero = 0             # <<<<<<<<<<<<<<
 *                     break
 *     return iszero
 */
              __pyx_v_iszero = 0;

              /* "bcolz/carray_ext.pyx":279
 *                 if data[i] != 0:
 *                     iszero = 0
 *                     break             # <<<<<<<<<<<<<<
 *     return iszero
 * 
 */
              goto __pyx_L10_break;

              /* "bcolz/carray_ext.pyx":277
 *             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":269
 *     chunklen = cython.cdiv(nbytes, sizeof(size_t))
 *     leftover = nbytes % sizeof(size_t)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < chunklen:
 *             if sdata[i] != 0:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

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

  /* "bcolz/carray_ext.pyx":260
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":282
 *     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_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("true_count", 0);

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

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

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

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

      /* "bcolz/carray_ext.pyx":286
 *     cdef int i, count
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         count = 0
 *         for i from 0 <= i < nbytes:
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

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

  /* "bcolz/carray_ext.pyx":282
 *     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_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":307
 *     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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

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

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

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

/* "bcolz/carray_ext.pyx":310
 *             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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_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":311
 * 
 *     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_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_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_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __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":310
 *             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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "bcolz/carray_ext.pyx":317
 *         cdef char *data
 * 
 *         self.atom = atom             # <<<<<<<<<<<<<<
 *         self.atomsize = atom.itemsize
 *         dtype_ = atom.base
 */
  __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":318
 * 
 *         self.atom = atom
 *         self.atomsize = atom.itemsize             # <<<<<<<<<<<<<<
 *         dtype_ = atom.base
 *         self.typekind = dtype_.kind
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_atom, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->atomsize = __pyx_t_2;

  /* "bcolz/carray_ext.pyx":319
 *         self.atom = atom
 *         self.atomsize = atom.itemsize
 *         dtype_ = atom.base             # <<<<<<<<<<<<<<
 *         self.typekind = dtype_.kind
 *         # Hack for allowing strings with len > BLOSC_MAX_TYPESIZE
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_atom, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_dtype_ = ((PyArray_Descr *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":320
 *         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_t_3 = __pyx_v_dtype_->kind;
  __pyx_v_self->typekind = __pyx_t_3;

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

    /* "bcolz/carray_ext.pyx":323
 *         # Hack for allowing strings with len > BLOSC_MAX_TYPESIZE
 *         if self.typekind == 'S':
 *             itemsize = 1             # <<<<<<<<<<<<<<
 *         elif self.typekind == 'U':
 *             itemsize = 4
 */
    __pyx_v_itemsize = 1;

    /* "bcolz/carray_ext.pyx":322
 *         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":324
 *         if self.typekind == 'S':
 *             itemsize = 1
 *         elif self.typekind == 'U':             # <<<<<<<<<<<<<<
 *             itemsize = 4
 *         elif self.typekind == 'V' and dtype_.itemsize > BLOSC_MAX_TYPESIZE:
 */
  __pyx_t_4 = ((__pyx_v_self->typekind == 'U') != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":325
 *             itemsize = 1
 *         elif self.typekind == 'U':
 *             itemsize = 4             # <<<<<<<<<<<<<<
 *         elif self.typekind == 'V' and dtype_.itemsize > BLOSC_MAX_TYPESIZE:
 *             itemsize = 1
 */
    __pyx_v_itemsize = 4;

    /* "bcolz/carray_ext.pyx":324
 *         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":326
 *         elif self.typekind == 'U':
 *             itemsize = 4
 *         elif self.typekind == 'V' and dtype_.itemsize > BLOSC_MAX_TYPESIZE:             # <<<<<<<<<<<<<<
 *             itemsize = 1
 *         else:
 */
  __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":327
 *             itemsize = 4
 *         elif self.typekind == 'V' and dtype_.itemsize > BLOSC_MAX_TYPESIZE:
 *             itemsize = 1             # <<<<<<<<<<<<<<
 *         else:
 *             itemsize = dtype_.itemsize
 */
    __pyx_v_itemsize = 1;

    /* "bcolz/carray_ext.pyx":326
 *         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":329
 *             itemsize = 1
 *         else:
 *             itemsize = dtype_.itemsize             # <<<<<<<<<<<<<<
 *         if itemsize > BLOSC_MAX_TYPESIZE:
 *             raise TypeError(
 */
  /*else*/ {
    __pyx_t_2 = __pyx_v_dtype_->elsize;
    __pyx_v_itemsize = __pyx_t_2;
  }
  __pyx_L3:;

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

    /* "bcolz/carray_ext.pyx":333
 *             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_t_1 = __Pyx_PyInt_From_int(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyInt_From_int(BLOSC_MAX_TYPESIZE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "bcolz/carray_ext.pyx":331
 *             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_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":330
 *         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":334
 *                 "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_v_self->itemsize = __pyx_v_itemsize;

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

  /* "bcolz/carray_ext.pyx":337
 *         footprint = 0
 * 
 *         if _compr:             # <<<<<<<<<<<<<<
 *             # Data comes in an already compressed state inside a Python String
 *             self.dobject = dobject
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__compr); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":339
 *         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_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":341
 *             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_v_data = PyBytes_AS_STRING(__pyx_v_dobject);

    /* "bcolz/carray_ext.pyx":342
 *             # 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
 */
    blosc_cbuffer_sizes(__pyx_v_data, (&__pyx_v_nbytes), (&__pyx_v_cbytes), (&__pyx_v_blocksize));

    /* "bcolz/carray_ext.pyx":337
 *         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":343
 *             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_t_4 = (__Pyx_PyString_Equals(((PyObject *)__pyx_v_dtype_), __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":345
 *         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_v_data = PyBytes_AS_STRING(__pyx_v_dobject);

    /* "bcolz/carray_ext.pyx":346
 *             # 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_v_nbytes = PyBytes_GET_SIZE(__pyx_v_dobject);

    /* "bcolz/carray_ext.pyx":347
 *             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_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_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __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":343
 *             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":350
 *         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
 */
  /*else*/ {

    /* "bcolz/carray_ext.pyx":351
 *             # 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
 * 
 */
    if (!(likely(((__pyx_v_dobject) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dobject, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":350
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __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":352
 *             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_v_footprint = (__pyx_v_footprint + 0x80);

  /* "bcolz/carray_ext.pyx":355
 * 
 *         # Fill instance data
 *         self.nbytes = nbytes             # <<<<<<<<<<<<<<
 *         self.cbytes = cbytes + footprint
 *         self.blocksize = blocksize
 */
  __pyx_v_self->nbytes = __pyx_v_nbytes;

  /* "bcolz/carray_ext.pyx":356
 *         # Fill instance data
 *         self.nbytes = nbytes
 *         self.cbytes = cbytes + footprint             # <<<<<<<<<<<<<<
 *         self.blocksize = blocksize
 * 
 */
  __pyx_v_self->cbytes = (__pyx_v_cbytes + __pyx_v_footprint);

  /* "bcolz/carray_ext.pyx":357
 *         self.nbytes = nbytes
 *         self.cbytes = cbytes + footprint
 *         self.blocksize = blocksize             # <<<<<<<<<<<<<<
 * 
 *     cdef compress_arrdata(self, ndarray array, int itemsize,
 */
  __pyx_v_self->blocksize = __pyx_v_blocksize;

  /* "bcolz/carray_ext.pyx":310
 *             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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":359
 *         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_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;
  PyObject *(*__pyx_t_8)(PyObject *);
  size_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compress_arrdata", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_array);

  /* "bcolz/carray_ext.pyx":365
 * 
 *         # Compute the total number of bytes in this array
 *         nbytes = array.itemsize * array.size             # <<<<<<<<<<<<<<
 *         cbytes = 0
 *         footprint = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_nbytes = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":366
 *         # Compute the total number of bytes in this array
 *         nbytes = array.itemsize * array.size
 *         cbytes = 0             # <<<<<<<<<<<<<<
 *         footprint = 0
 * 
 */
  __pyx_v_cbytes = 0;

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

  /* "bcolz/carray_ext.pyx":371
 *         # 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_v_self->isconstant = 0;

  /* "bcolz/carray_ext.pyx":372
 *         # 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_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":373
 *         self.isconstant = 0
 *         self.constant = None
 *         if _memory and (array.strides[0] == 0             # <<<<<<<<<<<<<<
 *                         or check_zeros(array.data, nbytes)):
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v__memory); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }

  /* "bcolz/carray_ext.pyx":374
 *         self.constant = None
 *         if _memory and (array.strides[0] == 0
 *                         or check_zeros(array.data, nbytes)):             # <<<<<<<<<<<<<<
 * 
 *             self.isconstant = 1
 */
  __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":373
 *         self.isconstant = 0
 *         self.constant = None
 *         if _memory and (array.strides[0] == 0             # <<<<<<<<<<<<<<
 *                         or check_zeros(array.data, nbytes)):
 * 
 */
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":376
 *                         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_v_self->isconstant = 1;

    /* "bcolz/carray_ext.pyx":379
 *             # 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_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":380
 *             # 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_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_array), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __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":379
 *             # 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":382
 *                 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
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __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":384
 *                 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_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_footprint); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_footprint = __pyx_t_4;

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

  /* "bcolz/carray_ext.pyx":386
 *             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_t_5 = (__pyx_v_self->isconstant != 0);
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":387
 * 
 *         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_v_blocksize = 0x1000;

    /* "bcolz/carray_ext.pyx":389
 *             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
 */
    if (unlikely(__pyx_v_itemsize == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = (((__pyx_v_blocksize % __pyx_v_itemsize) > 0) != 0);
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":390
 *             # 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_v_blocksize = ((__pyx_v_blocksize / __pyx_v_itemsize) * __pyx_v_itemsize);

      /* "bcolz/carray_ext.pyx":389
 *             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":392
 *                 blocksize = cython.cdiv(blocksize, itemsize) * itemsize
 *             # Correct in case we have a large itemsize
 *             if blocksize == 0:             # <<<<<<<<<<<<<<
 *                 blocksize = itemsize
 *         else:
 */
    __pyx_t_5 = ((__pyx_v_blocksize == 0) != 0);
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":393
 *             # Correct in case we have a large itemsize
 *             if blocksize == 0:
 *                 blocksize = itemsize             # <<<<<<<<<<<<<<
 *         else:
 *             if self.typekind == 'b':
 */
      __pyx_v_blocksize = __pyx_v_itemsize;

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

    /* "bcolz/carray_ext.pyx":386
 *             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":395
 *                 blocksize = itemsize
 *         else:
 *             if self.typekind == 'b':             # <<<<<<<<<<<<<<
 *                 self.true_count = true_count(array.data, nbytes)
 * 
 */
  /*else*/ {
    __pyx_t_5 = ((__pyx_v_self->typekind == 'b') != 0);
    if (__pyx_t_5) {

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

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

    /* "bcolz/carray_ext.pyx":398
 *                 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_t_5 = (((__pyx_v_array->strides[0]) == 0) != 0);
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":400
 *             if array.strides[0] == 0:
 *                 # The chunk is made of constants.  Regenerate the actual data.
 *                 array = array.copy()             # <<<<<<<<<<<<<<
 * 
 *             # Compress data
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_array), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF_SET(__pyx_v_array, ((PyArrayObject *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":398
 *                 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":403
 * 
 *             # Compress data
 *             cbytes, blocksize = self.compress_data(             # <<<<<<<<<<<<<<
 *                 array.data, itemsize, nbytes, cparams)
 * 
 */
    __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_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __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); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_2); if (unlikely(!__pyx_t_7)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L14_unpacking_done;
      __pyx_L13_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L14_unpacking_done:;
    }
    __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_t_7); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_cbytes = __pyx_t_4;
    __pyx_v_blocksize = __pyx_t_9;
  }
  __pyx_L8:;

  /* "bcolz/carray_ext.pyx":406
 *                 array.data, itemsize, nbytes, cparams)
 * 
 *         return (nbytes, cbytes, blocksize, footprint)             # <<<<<<<<<<<<<<
 * 
 *     cdef compress_data(self, char *data, size_t itemsize, size_t nbytes,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_cbytes); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_blocksize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_footprint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_2);
  __pyx_t_3 = 0;
  __pyx_t_7 = 0;
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":359
 *         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_10);
  __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":408
 *         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;
  PyObject *__pyx_v_cname = NULL;
  PyObject *__pyx_r = NULL;
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compress_data", 0);

  /* "bcolz/carray_ext.pyx":415
 *         cdef char *dest
 * 
 *         clevel = cparams.clevel             # <<<<<<<<<<<<<<
 *         shuffle = cparams.shuffle
 *         cname = cparams.cname
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cparams, __pyx_n_s_clevel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_clevel = __pyx_t_2;

  /* "bcolz/carray_ext.pyx":416
 * 
 *         clevel = cparams.clevel
 *         shuffle = cparams.shuffle             # <<<<<<<<<<<<<<
 *         cname = cparams.cname
 *         if type(cname) != bytes:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cparams, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_shuffle = __pyx_t_2;

  /* "bcolz/carray_ext.pyx":417
 *         clevel = cparams.clevel
 *         shuffle = cparams.shuffle
 *         cname = cparams.cname             # <<<<<<<<<<<<<<
 *         if type(cname) != bytes:
 *             cname = cname.encode()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cparams, __pyx_n_s_cname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cname = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":418
 *         shuffle = cparams.shuffle
 *         cname = cparams.cname
 *         if type(cname) != bytes:             # <<<<<<<<<<<<<<
 *             cname = cname.encode()
 *         if blosc_set_compressor(cname) < 0:
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":419
 *         cname = cparams.cname
 *         if type(cname) != bytes:
 *             cname = cname.encode()             # <<<<<<<<<<<<<<
 *         if blosc_set_compressor(cname) < 0:
 *             raise ValueError(
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cname, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __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":418
 *         shuffle = cparams.shuffle
 *         cname = cparams.cname
 *         if type(cname) != bytes:             # <<<<<<<<<<<<<<
 *             cname = cname.encode()
 *         if blosc_set_compressor(cname) < 0:
 */
  }

  /* "bcolz/carray_ext.pyx":420
 *         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_t_6 = __Pyx_PyObject_AsString(__pyx_v_cname); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((blosc_set_compressor(__pyx_t_6) < 0) != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":422
 *         if blosc_set_compressor(cname) < 0:
 *             raise ValueError(
 *                 "Compressor '%s' is not available in this build" % cname)             # <<<<<<<<<<<<<<
 *         dest = <char *> malloc(nbytes + BLOSC_MAX_OVERHEAD)
 *         ret = blosc_compress(clevel, shuffle, itemsize, nbytes,
 */
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Compressor_s_is_not_available_in, __pyx_v_cname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);

    /* "bcolz/carray_ext.pyx":421
 *             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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":420
 *         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":423
 *             raise ValueError(
 *                 "Compressor '%s' is not available in this build" % cname)
 *         dest = <char *> malloc(nbytes + BLOSC_MAX_OVERHEAD)             # <<<<<<<<<<<<<<
 *         ret = blosc_compress(clevel, shuffle, itemsize, nbytes,
 *                              data, dest, nbytes + BLOSC_MAX_OVERHEAD)
 */
  __pyx_v_dest = ((char *)malloc((__pyx_v_nbytes + BLOSC_MAX_OVERHEAD)));

  /* "bcolz/carray_ext.pyx":424
 *                 "Compressor '%s' is not available in this build" % cname)
 *         dest = <char *> malloc(nbytes + BLOSC_MAX_OVERHEAD)
 *         ret = blosc_compress(clevel, shuffle, itemsize, nbytes,             # <<<<<<<<<<<<<<
 *                              data, dest, nbytes + BLOSC_MAX_OVERHEAD)
 *         if ret <= 0:
 */
  __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":426
 *         ret = blosc_compress(clevel, shuffle, itemsize, nbytes,
 *                              data, dest, nbytes + BLOSC_MAX_OVERHEAD)
 *         if ret <= 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 "fatal error during Blosc compression: %d" % ret)
 */
  __pyx_t_3 = ((__pyx_v_ret <= 0) != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":428
 *         if ret <= 0:
 *             raise RuntimeError(
 *                 "fatal error during Blosc compression: %d" % ret)             # <<<<<<<<<<<<<<
 *         # Copy the compressed buffer into a Bytes buffer
 *         cbytes = ret;
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_fatal_error_during_Blosc_compres, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":427
 *                              data, dest, nbytes + BLOSC_MAX_OVERHEAD)
 *         if ret <= 0:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 "fatal error during Blosc compression: %d" % ret)
 *         # Copy the compressed buffer into a Bytes buffer
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":426
 *         ret = blosc_compress(clevel, shuffle, itemsize, nbytes,
 *                              data, dest, nbytes + BLOSC_MAX_OVERHEAD)
 *         if ret <= 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 "fatal error during Blosc compression: %d" % ret)
 */
  }

  /* "bcolz/carray_ext.pyx":430
 *                 "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_v_cbytes = __pyx_v_ret;

  /* "bcolz/carray_ext.pyx":431
 *         # 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_t_4 = PyBytes_FromStringAndSize(__pyx_v_dest, __pyx_v_cbytes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __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":433
 *         self.dobject = PyBytes_FromStringAndSize(dest, cbytes)
 *         # Get blocksize info for the instance
 *         blosc_cbuffer_sizes(dest, &nbytes_, &cbytes, &blocksize)             # <<<<<<<<<<<<<<
 *         assert nbytes_ == nbytes
 *         free(dest)
 */
  blosc_cbuffer_sizes(__pyx_v_dest, (&__pyx_v_nbytes_), (&__pyx_v_cbytes), (&__pyx_v_blocksize));

  /* "bcolz/carray_ext.pyx":434
 *         # Get blocksize info for the instance
 *         blosc_cbuffer_sizes(dest, &nbytes_, &cbytes, &blocksize)
 *         assert nbytes_ == nbytes             # <<<<<<<<<<<<<<
 *         free(dest)
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_nbytes_ == __pyx_v_nbytes) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

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

  /* "bcolz/carray_ext.pyx":437
 *         free(dest)
 * 
 *         return (cbytes, blocksize)             # <<<<<<<<<<<<<<
 * 
 *     def getdata(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_cbytes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_blocksize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __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":408
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":439
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getdata", 0);

  /* "bcolz/carray_ext.pyx":443
 *         cdef object string
 * 
 *         assert (not self.isconstant,             # <<<<<<<<<<<<<<
 *                 "This function can only be used for persistency")
 *         return self.dobject
 */
  #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_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

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

  /* "bcolz/carray_ext.pyx":439
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":447
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getudata", 0);

  /* "bcolz/carray_ext.pyx":453
 *         cdef char *dest
 * 
 *         result_str = PyBytes_FromStringAndSize(NULL, self.nbytes)             # <<<<<<<<<<<<<<
 *         src = PyBytes_AS_STRING(self.dobject)
 *         dest = PyBytes_AS_STRING(result_str)
 */
  __pyx_t_1 = PyBytes_FromStringAndSize(NULL, __pyx_v_self->nbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result_str = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":454
 * 
 *         result_str = PyBytes_FromStringAndSize(NULL, self.nbytes)
 *         src = PyBytes_AS_STRING(self.dobject)             # <<<<<<<<<<<<<<
 *         dest = PyBytes_AS_STRING(result_str)
 * 
 */
  __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":455
 *         result_str = PyBytes_FromStringAndSize(NULL, self.nbytes)
 *         src = PyBytes_AS_STRING(self.dobject)
 *         dest = PyBytes_AS_STRING(result_str)             # <<<<<<<<<<<<<<
 * 
 *         ret = blosc_decompress(src, dest, self.nbytes)
 */
  __pyx_v_dest = PyBytes_AS_STRING(__pyx_v_result_str);

  /* "bcolz/carray_ext.pyx":457
 *         dest = PyBytes_AS_STRING(result_str)
 * 
 *         ret = blosc_decompress(src, dest, self.nbytes)             # <<<<<<<<<<<<<<
 *         if ret < 0:
 *             raise RuntimeError(
 */
  __pyx_v_ret = blosc_decompress(__pyx_v_src, __pyx_v_dest, __pyx_v_self->nbytes);

  /* "bcolz/carray_ext.pyx":458
 * 
 *         ret = blosc_decompress(src, dest, self.nbytes)
 *         if ret < 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 "fatal error during Blosc decompression: %d" % ret)
 */
  __pyx_t_2 = ((__pyx_v_ret < 0) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":460
 *         if ret < 0:
 *             raise RuntimeError(
 *                 "fatal error during Blosc decompression: %d" % ret)             # <<<<<<<<<<<<<<
 *         return result_str
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_fatal_error_during_Blosc_decompr, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":459
 *         ret = blosc_decompress(src, dest, self.nbytes)
 *         if ret < 0:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 "fatal error during Blosc decompression: %d" % ret)
 *         return result_str
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __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_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

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

  /* "bcolz/carray_ext.pyx":447
 *         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_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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":463
 *         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_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_getitem", 0);

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

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

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

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

  /* "bcolz/carray_ext.pyx":474
 *         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_t_1 = (__pyx_v_self->isconstant != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":476
 *         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_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_blen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":477
 *             # 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
 */
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_buffer, __pyx_v_self->constant) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_strides, __pyx_tuple__5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":476
 *         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_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_ndarray), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":477
 *             # 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_constants = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

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

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

    /* "bcolz/carray_ext.pyx":474
 *         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":482
 * 
 *         # Fill dest with uncompressed data
 *         data = PyBytes_AS_STRING(self.dobject)             # <<<<<<<<<<<<<<
 *         if bsize == self.nbytes:
 *             ret = blosc_decompress(data, dest, bsize)
 */
  __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":483
 *         # Fill dest with uncompressed data
 *         data = PyBytes_AS_STRING(self.dobject)
 *         if bsize == self.nbytes:             # <<<<<<<<<<<<<<
 *             ret = blosc_decompress(data, dest, bsize)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_bsize == __pyx_v_self->nbytes) != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":484
 *         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_v_ret = blosc_decompress(__pyx_v_data, __pyx_v_dest, __pyx_v_bsize);

    /* "bcolz/carray_ext.pyx":483
 *         # 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":486
 *             ret = blosc_decompress(data, dest, bsize)
 *         else:
 *             ret = blosc_getitem(data, nstart, nitems, dest)             # <<<<<<<<<<<<<<
 *         if ret < 0:
 *             raise RuntimeError(
 */
  /*else*/ {
    __pyx_v_ret = blosc_getitem(__pyx_v_data, __pyx_v_nstart, __pyx_v_nitems, __pyx_v_dest);
  }
  __pyx_L4:;

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

    /* "bcolz/carray_ext.pyx":489
 *         if ret < 0:
 *             raise RuntimeError(
 *                 "fatal error during Blosc decompression: %d" % ret)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, object key):
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":488
 *             ret = blosc_getitem(data, nstart, nitems, dest)
 *         if ret < 0:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 "fatal error during Blosc decompression: %d" % ret)
 * 
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

  /* "bcolz/carray_ext.pyx":463
 *         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_RefNannyFinishContext();
}

/* "bcolz/carray_ext.pyx":491
 *                 "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_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 *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "bcolz/carray_ext.pyx":496
 *         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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __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":498
 *         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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_tuple__6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_array = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":499
 *             # 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_t_6 = __Pyx_PyInt_As_int(__pyx_v_key); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __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":500
 *             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_XDECREF(__pyx_r);
    __pyx_t_5 = PyArray_GETITEM(__pyx_v_array, __pyx_v_array->data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":496
 *         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":501
 *             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_t_3 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":502
 *             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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __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":501
 *             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":503
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __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":505
 *         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_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->nbytes / __pyx_v_self->itemsize)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_clen = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":506
 *             # 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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __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":507
 *             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_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_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __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":508
 *             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_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_idx2, __pyx_n_s_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":510
 *             if idx2.flags.contiguous:
 *                 # The slice represents a contiguous slice.  Get start and stop.
 *                 start, stop = idx2.flatten()[[0, -1]]             # <<<<<<<<<<<<<<
 *                 step = 1
 *             else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_idx2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __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":511
 *                 # 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_INCREF(__pyx_int_1);
      __pyx_v_step = __pyx_int_1;

      /* "bcolz/carray_ext.pyx":508
 *             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":513
 *                 step = 1
 *             else:
 *                 (start, stop, step) = key[0].start, key[0].stop, key[0].step             # <<<<<<<<<<<<<<
 *         else:
 *             raise IndexError("key not suitable:", key)
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __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":503
 *         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":515
 *                 (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
 */
  /*else*/ {
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":518
 * 
 *         # 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_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->nbytes / __pyx_v_self->atomsize)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __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":519
 *         # 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_t_5 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __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":522
 * 
 *         # Build a numpy container
 *         array = np.empty(shape=(stop - start,), dtype=self.dtype)             # <<<<<<<<<<<<<<
 *         # Read actual data
 *         self._getitem(start, stop, array.data)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_array = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "bcolz/carray_ext.pyx":524
 *         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_t_7 = __Pyx_PyInt_As_int(__pyx_v_start); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_stop); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __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":527
 * 
 *         # Return the value depending on the step
 *         if step > 1:             # <<<<<<<<<<<<<<
 *             return array[::step]
 *         return array
 */
  __pyx_t_9 = PyObject_RichCompare(__pyx_v_step, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":528
 *         # Return the value depending on the step
 *         if step > 1:
 *             return array[::step]             # <<<<<<<<<<<<<<
 *         return array
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = PySlice_New(Py_None, Py_None, __pyx_v_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __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":527
 * 
 *         # Return the value depending on the step
 *         if step > 1:             # <<<<<<<<<<<<<<
 *             return array[::step]
 *         return array
 */
  }

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

  /* "bcolz/carray_ext.pyx":491
 *                 "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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":531
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "bcolz/carray_ext.pyx":533
 *     def __setitem__(self, object key, object value):
 *         """__setitem__(self, key, value) -> None."""
 *         raise NotImplementedError()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplementedError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":531
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":535
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "bcolz/carray_ext.pyx":537
 *     def __str__(self):
 *         """Represent the chunk as an string."""
 *         return str(self[:])             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":535
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":539
 *         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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "bcolz/carray_ext.pyx":541
 *     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))
 */
  if (unlikely(((double)__pyx_v_self->cbytes) == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_cratio = (__pyx_v_self->nbytes / ((double)__pyx_v_self->cbytes));

  /* "bcolz/carray_ext.pyx":543
 *         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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_cratio); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __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":542
 *         """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_t_6 = __Pyx_PyString_Format(__pyx_kp_s_chunk_s_nbytes_d_cbytes_d_ratio, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __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":544
 *         fullrepr = "chunk(%s)  nbytes: %d; cbytes: %d; ratio: %.2f\n%r" % \
 *                    (self.dtype, self.nbytes, self.cbytes, cratio, str(self))
 *         return fullrepr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fullrepr);
  __pyx_r = __pyx_v_fullrepr;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":539
 *         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_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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->atomsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->blocksize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":547
 * 
 * 
 * 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__8;
  PyObject *__pyx_r = NULL;
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_bloscpack_header", 0);
  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":590
 * 
 *     """
 *     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_t_2 = PyObject_RichCompare(__pyx_int_0, __pyx_v_nchunks, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __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":593
 *         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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_MAX_CHUNKS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __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":592
 *     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_t_6 = __Pyx_PyString_Format(__pyx_kp_s_nchunks_must_be_in_the_range_0, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":591
 *     """
 *     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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":590
 * 
 *     """
 *     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":594
 *             "'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_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_MAGIC); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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__9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "bcolz/carray_ext.pyx":595
 *             (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_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __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":594
 *             "'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_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __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":547
 * 
 * 
 * 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_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_13decode_byte(PyObject *__pyx_self, PyObject *__pyx_v_byte); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_12decode_byte[] = "decode_byte(byte)";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_13decode_byte = {"decode_byte", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_13decode_byte, METH_O, __pyx_doc_5bcolz_10carray_ext_12decode_byte};
static PyObject *__pyx_pw_5bcolz_10carray_ext_13decode_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_12decode_byte(__pyx_self, ((PyObject *)__pyx_v_byte));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_12decode_byte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_byte) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode_byte", 0);

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

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

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

/* "bcolz/carray_ext.pyx":601
 *         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_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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_byte", 0);

  /* "bcolz/carray_ext.pyx":602
 * else:
 *     def decode_byte(byte):
 *         return int(byte.encode('hex'), 16)             # <<<<<<<<<<<<<<
 * def decode_uint32(fourbyte):
 *     return struct.unpack('<I', fourbyte)[0]
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_byte, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __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":601
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":603
 *     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_17decode_uint32(PyObject *__pyx_self, PyObject *__pyx_v_fourbyte); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_16decode_uint32[] = "decode_uint32(fourbyte)";
static PyMethodDef __pyx_mdef_5bcolz_10carray_ext_17decode_uint32 = {"decode_uint32", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_17decode_uint32, METH_O, __pyx_doc_5bcolz_10carray_ext_16decode_uint32};
static PyObject *__pyx_pw_5bcolz_10carray_ext_17decode_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_16decode_uint32(__pyx_self, ((PyObject *)__pyx_v_fourbyte));

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

static PyObject *__pyx_pf_5bcolz_10carray_ext_16decode_uint32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fourbyte) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_uint32", 0);

  /* "bcolz/carray_ext.pyx":604
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):
 *     return struct.unpack('<I', fourbyte)[0]             # <<<<<<<<<<<<<<
 * 
 * cdef decode_blosc_header(buffer_):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __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":603
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":606
 *     return struct.unpack('<I', fourbyte)[0]
 * 
 * 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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_blosc_header", 0);

  /* "bcolz/carray_ext.pyx":638
 * 
 *     """
 *     return {'version': decode_byte(buffer_[0]),             # <<<<<<<<<<<<<<
 *             'versionlz': decode_byte(buffer_[1]),
 *             'flags': decode_byte(buffer_[2]),
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_byte); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":639
 *     """
 *     return {'version': decode_byte(buffer_[0]),
 *             'versionlz': decode_byte(buffer_[1]),             # <<<<<<<<<<<<<<
 *             'flags': decode_byte(buffer_[2]),
 *             'typesize': decode_byte(buffer_[3]),
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_byte); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":640
 *     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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_byte); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":641
 *             '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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_byte); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":642
 *             '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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_uint32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_buffer_, 4, 8, NULL, NULL, &__pyx_slice__11, 1, 1, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":643
 *             'typesize': decode_byte(buffer_[3]),
 *             'nbytes': decode_uint32(buffer_[4:8]),
 *             'blocksize': decode_uint32(buffer_[8:12]),             # <<<<<<<<<<<<<<
 *             'ctbytes': decode_uint32(buffer_[12:16])}
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_uint32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_buffer_, 8, 12, NULL, NULL, &__pyx_slice__12, 1, 1, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":644
 *             'nbytes': decode_uint32(buffer_[4:8]),
 *             'blocksize': decode_uint32(buffer_[8:12]),
 *             'ctbytes': decode_uint32(buffer_[12:16])}             # <<<<<<<<<<<<<<
 * 
 * cdef class chunks(object):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_decode_uint32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_buffer_, 12, 16, NULL, NULL, &__pyx_slice__13, 1, 1, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __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":606
 *     return struct.unpack('<I', fourbyte)[0]
 * 
 * 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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":650
 *     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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

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

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

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

/* "bcolz/carray_ext.pyx":652
 *         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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "bcolz/carray_ext.pyx":653
 *             return self._mode
 *         def __set__(self, value):
 *             self._mode = value             # <<<<<<<<<<<<<<
 * 
 *     property rootdir:
 */
  __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":652
 *         def __get__(self):
 *             return self._mode
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._mode = value
 * 
 */

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

/* "bcolz/carray_ext.pyx":657
 *     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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

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

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

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

/* "bcolz/carray_ext.pyx":659
 *         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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "bcolz/carray_ext.pyx":660
 *             return self._rootdir
 *         def __set__(self, value):
 *             self._rootdir = value             # <<<<<<<<<<<<<<
 * 
 *     property datadir:
 */
  __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":659
 *         def __get__(self):
 *             return self._rootdir
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self._rootdir = value
 * 
 */

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

/* "bcolz/carray_ext.pyx":664
 *     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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":665
 *         """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_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DATA_DIR); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __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":664
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":667
 *             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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_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_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "bcolz/carray_ext.pyx":678
 *         cdef int itemsize, atomsize
 * 
 *         self._rootdir = rootdir             # <<<<<<<<<<<<<<
 *         self.nchunks = 0
 *         self.nchunk_cached = -1  # no chunk cached initially
 */
  __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":679
 * 
 *         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_v_self->nchunks = 0;

  /* "bcolz/carray_ext.pyx":680
 *         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_v_self->nchunk_cached = -1;

  /* "bcolz/carray_ext.pyx":681
 *         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
 */
  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_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __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":682
 *         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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_atomsize = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":683
 *         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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_itemsize = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":687
 *         # 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_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_char); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_10) {

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

    /* "bcolz/carray_ext.pyx":687
 *         # 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":691
 * 
 *         # 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_t_11 = __Pyx_PyObject_IsTrue(__pyx_v__new); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __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":692
 *         # 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_t_13 = PyObject_Length(((PyObject *)__pyx_v_lastchunkarr)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->nchunks = (__pyx_v_self->len / __pyx_t_13);

    /* "bcolz/carray_ext.pyx":693
 *         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_t_13 = PyObject_Length(((PyObject *)__pyx_v_lastchunkarr)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_chunksize = (__pyx_t_13 * __pyx_v_atomsize);

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

    /* "bcolz/carray_ext.pyx":695
 *             chunksize = len(lastchunkarr) * atomsize
 *             lastchunk = lastchunkarr.data
 *             leftover = (self.len % len(lastchunkarr)) * atomsize             # <<<<<<<<<<<<<<
 *             if leftover:
 *                 # Fill lastchunk with data on disk
 */
    __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_lastchunkarr)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (unlikely(__pyx_t_13 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __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":696
 *             lastchunk = lastchunkarr.data
 *             leftover = (self.len % len(lastchunkarr)) * atomsize
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 # Fill lastchunk with data on disk
 *                 scomp = self.read_chunk(self.nchunks)
 */
    __pyx_t_10 = (__pyx_v_leftover != 0);
    if (__pyx_t_10) {

      /* "bcolz/carray_ext.pyx":698
 *             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_t_4 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->nchunks); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __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":699
 *                 # 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_v_compressed = PyBytes_AS_STRING(__pyx_v_scomp);

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

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

        /* "bcolz/carray_ext.pyx":704
 *                     raise RuntimeError(
 *                         "error decompressing the last chunk (error code: "
 *                         "%d)" % ret)             # <<<<<<<<<<<<<<
 * 
 *     cdef _chunk_file_name(self, nchunk):
 */
        __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ret); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "bcolz/carray_ext.pyx":702
 *                 ret = blosc_decompress(compressed, lastchunk, chunksize)
 *                 if ret < 0:
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         "error decompressing the last chunk (error code: "
 *                         "%d)" % ret)
 */
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "bcolz/carray_ext.pyx":701
 *                 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":696
 *             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":691
 * 
 *         # 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":667
 *             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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":706
 *                         "%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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_chunk_file_name", 0);

  /* "bcolz/carray_ext.pyx":708
 *     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_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_EXTENSION); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __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":706
 *                         "%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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":710
 *         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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_chunk", 0);

  /* "bcolz/carray_ext.pyx":712
 *     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_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_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_schunkfile = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":713
 *         """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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __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":714
 *         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_t_1 = __Pyx_PyString_Format(__pyx_kp_s_chunkfile_s_not_found, __pyx_v_schunkfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":713
 *         """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":715
 *         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)
 */
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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_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":716
 *             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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __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":717
 *         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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __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":718
 *             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_t_4 = __pyx_f_5bcolz_10carray_ext_decode_blosc_header(__pyx_v_blosc_header_raw); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_v_blosc_header = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":719
 *             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_t_4 = PyObject_GetItem(__pyx_v_blosc_header, __pyx_n_s_ctbytes); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L8_error;};
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_v_ctbytes = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":720
 *             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_t_4 = PyObject_GetItem(__pyx_v_blosc_header, __pyx_n_s_nbytes); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L8_error;};
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_v_nbytes = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":723
 *             # 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_11 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __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":724
 *             # position
 *             schunk.seek(-BLOSC_HEADER_LENGTH, 1)
 *             scomp = schunk.read(ctbytes)             # <<<<<<<<<<<<<<
 *         return scomp
 * 
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __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":715
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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_ErrRestore(__pyx_t_4, __pyx_t_2, __pyx_t_11);
            __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_11 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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_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_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__14, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __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":725
 *             schunk.seek(-BLOSC_HEADER_LENGTH, 1)
 *             scomp = schunk.read(ctbytes)
 *         return scomp             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_scomp)) { __Pyx_RaiseUnboundLocalError("scomp"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __Pyx_INCREF(__pyx_v_scomp);
  __pyx_r = __pyx_v_scomp;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":710
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":727
 *         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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "bcolz/carray_ext.pyx":728
 * 
 *     def __iter__(self):
 *        self._iter_count = 0             # <<<<<<<<<<<<<<
 *        return self
 * 
 */
  __pyx_v_self->_iter_count = 0;

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

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

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

/* "bcolz/carray_ext.pyx":731
 *        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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

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

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

    /* "bcolz/carray_ext.pyx":735
 *         if self._iter_count < self.nchunks:
 *             i = self._iter_count
 *             self._iter_count += 1             # <<<<<<<<<<<<<<
 *             return self.__getitem__(i)
 *         else:
 */
    __pyx_v_self->_iter_count = (__pyx_v_self->_iter_count + 1);

    /* "bcolz/carray_ext.pyx":736
 *             i = self._iter_count
 *             self._iter_count += 1
 *             return self.__getitem__(i)             # <<<<<<<<<<<<<<
 *         else:
 *             raise StopIteration()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __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":733
 *     def __next__(self):
 *         cdef int i
 *         if self._iter_count < self.nchunks:             # <<<<<<<<<<<<<<
 *             i = self._iter_count
 *             self._iter_count += 1
 */
  }

  /* "bcolz/carray_ext.pyx":738
 *             return self.__getitem__(i)
 *         else:
 *             raise StopIteration()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, nchunk):
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "bcolz/carray_ext.pyx":731
 *        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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":740
 *             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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "bcolz/carray_ext.pyx":744
 *         cdef void *compressed
 * 
 *         if nchunk == self.nchunk_cached:             # <<<<<<<<<<<<<<
 *             # Hit!
 *             return self.chunk_cached
 */
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->nchunk_cached); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":746
 *         if nchunk == self.nchunk_cached:
 *             # Hit!
 *             return self.chunk_cached             # <<<<<<<<<<<<<<
 *         else:
 *             scomp = self.read_chunk(nchunk)
 */
    __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":744
 *         cdef void *compressed
 * 
 *         if nchunk == self.nchunk_cached:             # <<<<<<<<<<<<<<
 *             # Hit!
 *             return self.chunk_cached
 */
  }

  /* "bcolz/carray_ext.pyx":748
 *             return self.chunk_cached
 *         else:
 *             scomp = self.read_chunk(nchunk)             # <<<<<<<<<<<<<<
 *             # Data chunk should be compressed already
 *             chunk_ = chunk(scomp, self.dtype, self.cparams,
 */
  /*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_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_scomp = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":750
 *             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_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __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":751
 *             # Data chunk should be compressed already
 *             chunk_ = chunk(scomp, self.dtype, self.cparams,
 *                            _memory=False, _compr=True)             # <<<<<<<<<<<<<<
 *             # Fill cache
 *             self.nchunk_cached = nchunk
 */
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_memory, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_compr, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":750
 *             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_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __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":753
 *                            _memory=False, _compr=True)
 *             # Fill cache
 *             self.nchunk_cached = nchunk             # <<<<<<<<<<<<<<
 *             self.chunk_cached = chunk_
 *         return chunk_
 */
    __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_nchunk); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_self->nchunk_cached = __pyx_t_5;

    /* "bcolz/carray_ext.pyx":754
 *             # Fill cache
 *             self.nchunk_cached = nchunk
 *             self.chunk_cached = chunk_             # <<<<<<<<<<<<<<
 *         return chunk_
 * 
 */
    __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":755
 *             self.nchunk_cached = nchunk
 *             self.chunk_cached = chunk_
 *         return chunk_             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, nchunk, chunk_):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_chunk_));
  __pyx_r = ((PyObject *)__pyx_v_chunk_);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":740
 *             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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":757
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "bcolz/carray_ext.pyx":758
 * 
 *     def __setitem__(self, nchunk, chunk_):
 *         self._save(nchunk, chunk_)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":757
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":760
 *         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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "bcolz/carray_ext.pyx":761
 * 
 *     def __len__(self):
 *         return self.nchunks             # <<<<<<<<<<<<<<
 * 
 *     def free_cachemem(self):
 */
  __pyx_r = __pyx_v_self->nchunks;
  goto __pyx_L0;

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

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

/* "bcolz/carray_ext.pyx":763
 *         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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_cachemem", 0);

  /* "bcolz/carray_ext.pyx":764
 * 
 *     def free_cachemem(self):
 *         self.nchunk_cached = -1             # <<<<<<<<<<<<<<
 *         self.chunk_cached = None
 * 
 */
  __pyx_v_self->nchunk_cached = -1;

  /* "bcolz/carray_ext.pyx":765
 *     def free_cachemem(self):
 *         self.nchunk_cached = -1
 *         self.chunk_cached = None             # <<<<<<<<<<<<<<
 * 
 *     def append(self, chunk_):
 */
  __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":763
 *         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);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":767
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("append", 0);

  /* "bcolz/carray_ext.pyx":769
 *     def append(self, chunk_):
 *         """Append an new chunk to the carray."""
 *         self._save(self.nchunks, chunk_)             # <<<<<<<<<<<<<<
 *         self.nchunks += 1
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->nchunks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

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

  /* "bcolz/carray_ext.pyx":767
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":772
 *         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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_save", 0);

  /* "bcolz/carray_ext.pyx":775
 *         """Save the `chunk_` as chunk #`nchunk`. """
 * 
 *         if self.mode == "r":             # <<<<<<<<<<<<<<
 *             raise IOError(
 *                 "cannot modify data because mode is '%s'" % self.mode)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":777
 *         if self.mode == "r":
 *             raise IOError(
 *                 "cannot modify data because mode is '%s'" % self.mode)             # <<<<<<<<<<<<<<
 * 
 *         schunkfile = self._chunk_file_name(nchunk)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":776
 * 
 *         if self.mode == "r":
 *             raise IOError(             # <<<<<<<<<<<<<<
 *                 "cannot modify data because mode is '%s'" % self.mode)
 * 
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":775
 *         """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":779
 *                 "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_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_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_schunkfile = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":780
 * 
 *         schunkfile = self._chunk_file_name(nchunk)
 *         bloscpack_header = create_bloscpack_header(1)             # <<<<<<<<<<<<<<
 *         with open(schunkfile, 'wb') as schunk:
 *             schunk.write(bloscpack_header)
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_bloscpack_header = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":781
 *         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())
 */
  /*with:*/ {
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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_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":782
 *         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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_6);
          } else {
            __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __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":783
 *         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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_schunk, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __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":781
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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_ErrRestore(__pyx_t_6, __pyx_t_1, __pyx_t_11);
            __pyx_t_6 = 0; __pyx_t_1 = 0; __pyx_t_11 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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_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_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__15, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __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":785
 *             schunk.write(chunk_.getdata())
 *         # Mark the cache as dirty if needed
 *         if nchunk == self.nchunk_cached:             # <<<<<<<<<<<<<<
 *             self.nchunk_cached = -1
 * 
 */
  __pyx_t_11 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->nchunk_cached); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_13) {

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

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

  /* "bcolz/carray_ext.pyx":772
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":788
 *             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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flush", 0);

  /* "bcolz/carray_ext.pyx":790
 *     def flush(self, chunk_):
 *         """Flush the leftover chunk."""
 *         self._save(self.nchunks, chunk_)             # <<<<<<<<<<<<<<
 * 
 *     def pop(self):
 */
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->nchunks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":788
 *             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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":792
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pop", 0);

  /* "bcolz/carray_ext.pyx":794
 *     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_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->nchunks - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nchunk = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":795
 *         """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_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __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":796
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_schunkfile = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":797
 *         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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __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":798
 *         schunkfile = self._chunk_file_name(nchunk)
 *         if not os.path.exists(schunkfile):
 *             raise IOError("chunk filename %s does exist" % schunkfile)             # <<<<<<<<<<<<<<
 *         os.remove(schunkfile)
 * 
 */
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_chunk_filename_s_does_exist, __pyx_v_schunkfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":797
 *         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":799
 *         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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __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":803
 *         # 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_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_nchunk, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __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":804
 *         # behind (i.e. the lastchunk)
 *         schunkfile = self._chunk_file_name(nchunk + 1)
 *         if os.path.exists(schunkfile):             # <<<<<<<<<<<<<<
 *             os.remove(schunkfile)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "bcolz/carray_ext.pyx":805
 *         schunkfile = self._chunk_file_name(nchunk + 1)
 *         if os.path.exists(schunkfile):
 *             os.remove(schunkfile)             # <<<<<<<<<<<<<<
 * 
 *         self.nchunks -= 1
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_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_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":804
 *         # behind (i.e. the lastchunk)
 *         schunkfile = self._chunk_file_name(nchunk + 1)
 *         if os.path.exists(schunkfile):             # <<<<<<<<<<<<<<
 *             os.remove(schunkfile)
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":807
 *             os.remove(schunkfile)
 * 
 *         self.nchunks -= 1             # <<<<<<<<<<<<<<
 *         return chunk_
 * 
 */
  __pyx_v_self->nchunks = (__pyx_v_self->nchunks - 1);

  /* "bcolz/carray_ext.pyx":808
 * 
 *         self.nchunks -= 1
 *         return chunk_             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_chunk_);
  __pyx_r = __pyx_v_chunk_;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":792
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":867
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":869
 *         def __get__(self):
 *             # Pointer to the leftovers chunk
 *             return self.lastchunkarr.ctypes.data             # <<<<<<<<<<<<<<
 * 
 *     property leftover_array:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->lastchunkarr, __pyx_n_s_ctypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __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":867
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":873
 *     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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":874
 *         """Array containing the leftovers chunk (uncompressed chunk)"""
 *         def __get__(self):
 *             return self.lastchunkarr             # <<<<<<<<<<<<<<
 * 
 *     property leftover_bytes:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->lastchunkarr);
  __pyx_r = __pyx_v_self->lastchunkarr;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":873
 *     property leftover_array:
 *         """Array containing the leftovers chunk (uncompressed chunk)"""
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.lastchunkarr
 * 
 */

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

/* "bcolz/carray_ext.pyx":878
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":879
 *         """Number of bytes in the leftover_array"""
 *         def __get__(self):
 *             return self.leftover             # <<<<<<<<<<<<<<
 * 
 *     property leftover_elements:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->leftover); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":878
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":883
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":884
 *         """Number of elements in the leftover_array"""
 *         def __get__(self):
 *             return cython.cdiv(self.leftover, self.atomsize)             # <<<<<<<<<<<<<<
 * 
 *     property nchunks:
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":883
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":888
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":890
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":888
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":894
 *     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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":895
 *         """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_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":896
 *         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_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->_chunksize / __pyx_v_self->atomsize)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_chunklen = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":897
 *             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_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "bcolz/carray_ext.pyx":898
 *             chunklen = cython.cdiv(self._chunksize, self.atomsize)
 *             return [(i * chunklen, (i + 1) * chunklen) for i in
 *                     xrange(nchunks)]             # <<<<<<<<<<<<<<
 * 
 *     property attrs:
 */
  __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_nchunks); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __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":897
 *             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_t_2 = PyNumber_Multiply(__pyx_v_i, __pyx_v_chunklen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __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":894
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":909
 * 
 *         """
 *         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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":910
 *         """
 *         def __get__(self):
 *             return self._attrs             # <<<<<<<<<<<<<<
 * 
 *     property cbytes:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_attrs);
  __pyx_r = __pyx_v_self->_attrs;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":909
 * 
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._attrs
 * 
 */

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

/* "bcolz/carray_ext.pyx":914
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":915
 *         "The compressed size of this object (in bytes)."
 *         def __get__(self):
 *             return self._cbytes             # <<<<<<<<<<<<<<
 * 
 *     property chunklen:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_cbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":914
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":919
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":920
 *         "The chunklen of this object (in rows)."
 *         def __get__(self):
 *             return self._chunklen             # <<<<<<<<<<<<<<
 * 
 *     property cparams:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_chunklen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":919
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":924
 *     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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":925
 *         "The compression parameters for this object."
 *         def __get__(self):
 *             return self._cparams             # <<<<<<<<<<<<<<
 * 
 *     property dflt:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_cparams);
  __pyx_r = __pyx_v_self->_cparams;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":924
 *     property cparams:
 *         "The compression parameters for this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._cparams
 * 
 */

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

/* "bcolz/carray_ext.pyx":929
 *     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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":930
 *         "The default value of this object."
 *         def __get__(self):
 *             return self._dflt             # <<<<<<<<<<<<<<
 * 
 *     property dtype:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_dflt);
  __pyx_r = __pyx_v_self->_dflt;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":929
 *     property dflt:
 *         "The default value of this object."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._dflt
 * 
 */

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

/* "bcolz/carray_ext.pyx":934
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":935
 *         "The dtype of this object."
 *         def __get__(self):
 *             return self._dtype.base             # <<<<<<<<<<<<<<
 * 
 *     property len:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":934
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":939
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":940
 *         "The length (leading dimension) of this object."
 *         def __get__(self):
 *             if self._dtype.char == 'O':             # <<<<<<<<<<<<<<
 *                 return len(self.chunks)
 *             else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":941
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":940
 *         "The length (leading dimension) of this object."
 *         def __get__(self):
 *             if self._dtype.char == 'O':             # <<<<<<<<<<<<<<
 *                 return len(self.chunks)
 *             else:
 */
  }

  /* "bcolz/carray_ext.pyx":944
 *             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:
 */
  /*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_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "bcolz/carray_ext.pyx":939
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":948
 *     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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

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

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

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

/* "bcolz/carray_ext.pyx":950
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "bcolz/carray_ext.pyx":951
 *             return self._mode
 *         def __set__(self, value):
 *             self._mode = value             # <<<<<<<<<<<<<<
 *             if hasattr(self.chunks, 'mode'):
 *                 self.chunks.mode = value
 */
  __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":952
 *         def __set__(self, value):
 *             self._mode = value
 *             if hasattr(self.chunks, 'mode'):             # <<<<<<<<<<<<<<
 *                 self.chunks.mode = value
 * 
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __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":953
 *             self._mode = value
 *             if hasattr(self.chunks, 'mode'):
 *                 self.chunks.mode = value             # <<<<<<<<<<<<<<
 * 
 *     property nbytes:
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->chunks, __pyx_n_s_mode, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":952
 *         def __set__(self, value):
 *             self._mode = value
 *             if hasattr(self.chunks, 'mode'):             # <<<<<<<<<<<<<<
 *                 self.chunks.mode = value
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":950
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":957
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":958
 *         "The original (uncompressed) size of this object (in bytes)."
 *         def __get__(self):
 *             return self._nbytes             # <<<<<<<<<<<<<<
 * 
 *     property nleftover:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_nbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":957
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":962
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":963
 *         "The number of leftover elements."
 *         def __get__(self):
 *             return cython.cdiv(self.leftover, self.atomsize)             # <<<<<<<<<<<<<<
 * 
 *     property ndim:
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":962
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":967
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":968
 *         "The number of dimensions of this object."
 *         def __get__(self):
 *             return len(self.shape)             # <<<<<<<<<<<<<<
 * 
 *     property safe:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __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 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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":972
 *     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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":973
 *         "Whether or not to perform type/shape checks on every operation."
 *         def __get__(self):
 *             return self._safe             # <<<<<<<<<<<<<<
 * 
 *     property shape:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_safe);
  __pyx_r = __pyx_v_self->_safe;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":972
 *     property safe:
 *         "Whether or not to perform type/shape checks on every operation."
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._safe
 * 
 */

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

/* "bcolz/carray_ext.pyx":977
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":980
 *             # 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_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __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":977
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":984
 *     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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "bcolz/carray_ext.pyx":985
 *         "The size of this object."
 *         def __get__(self):
 *             return np.prod(self.shape)             # <<<<<<<<<<<<<<
 * 
 *     property rootdir:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __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":984
 *     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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":989
 *     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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

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

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

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

/* "bcolz/carray_ext.pyx":991
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "bcolz/carray_ext.pyx":992
 *             return self._rootdir
 *         def __set__(self, value):
 *             if not self.rootdir:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "cannot modify the rootdir value of an in-memory carray")
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rootdir); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __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":993
 *         def __set__(self, value):
 *             if not self.rootdir:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "cannot modify the rootdir value of an in-memory carray")
 *             self._rootdir = value
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":992
 *             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":995
 *                 raise ValueError(
 *                     "cannot modify the rootdir value of an in-memory carray")
 *             self._rootdir = value             # <<<<<<<<<<<<<<
 *             self.chunks.rootdir = value
 * 
 */
  __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":996
 *                     "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,
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->chunks, __pyx_n_s_rootdir, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":991
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":998
 *             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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_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":999
 * 
 *     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":1000
 *     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":1001
 *                   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_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __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":998
 *             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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "bcolz/carray_ext.pyx":1003
 *                   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_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":1004
 * 
 *         self._rootdir = rootdir
 *         if mode not in ('r', 'w', 'a'):             # <<<<<<<<<<<<<<
 *             raise ValueError("mode should be 'r', 'w' or 'a'")
 *         self._mode = mode
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __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":1005
 *         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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1004
 * 
 *         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":1006
 *         if mode not in ('r', 'w', 'a'):
 *             raise ValueError("mode should be 'r', 'w' or 'a'")
 *         self._mode = mode             # <<<<<<<<<<<<<<
 *         self._safe = safe
 * 
 */
  __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":1007
 *             raise ValueError("mode should be 'r', 'w' or 'a'")
 *         self._mode = mode
 *         self._safe = safe             # <<<<<<<<<<<<<<
 * 
 *         if array is not None:
 */
  __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":1009
 *         self._safe = safe
 * 
 *         if array is not None:             # <<<<<<<<<<<<<<
 *             self._create_carray(array, cparams, dtype, dflt,
 *                                expectedlen, chunklen, rootdir, mode)
 */
  __pyx_t_3 = (__pyx_v_array != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1010
 * 
 *         if array is not None:
 *             self._create_carray(array, cparams, dtype, dflt,             # <<<<<<<<<<<<<<
 *                                expectedlen, chunklen, rootdir, mode)
 *             _new = True
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_carray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);

    /* "bcolz/carray_ext.pyx":1011
 *         if array is not None:
 *             self._create_carray(array, cparams, dtype, dflt,
 *                                expectedlen, chunklen, rootdir, mode)             # <<<<<<<<<<<<<<
 *             _new = True
 *         elif rootdir is not None:
 */
    __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_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __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":1012
 *             self._create_carray(array, cparams, dtype, dflt,
 *                                expectedlen, chunklen, rootdir, mode)
 *             _new = True             # <<<<<<<<<<<<<<
 *         elif rootdir is not None:
 *             meta_info = self._read_meta()
 */
    __pyx_v__new = 1;

    /* "bcolz/carray_ext.pyx":1009
 *         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":1013
 *                                expectedlen, chunklen, rootdir, mode)
 *             _new = True
 *         elif rootdir is not None:             # <<<<<<<<<<<<<<
 *             meta_info = self._read_meta()
 *             self._open_carray(*meta_info)
 */
  __pyx_t_2 = (__pyx_v_rootdir != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1014
 *             _new = True
 *         elif rootdir is not None:
 *             meta_info = self._read_meta()             # <<<<<<<<<<<<<<
 *             self._open_carray(*meta_info)
 *             _new = False
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read_meta); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __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":1015
 *         elif rootdir is not None:
 *             meta_info = self._read_meta()
 *             self._open_carray(*meta_info)             # <<<<<<<<<<<<<<
 *             _new = False
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open_carray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PySequence_Tuple(__pyx_v_meta_info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __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":1016
 *             meta_info = self._read_meta()
 *             self._open_carray(*meta_info)
 *             _new = False             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError(
 */
    __pyx_v__new = 0;

    /* "bcolz/carray_ext.pyx":1013
 *                                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":1018
 *             _new = False
 *         else:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "You need at least to pass an array or/and a rootdir")
 * 
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L7:;

  /* "bcolz/carray_ext.pyx":1022
 * 
 *         # 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_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_attrs); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v__new); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_new, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_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":1025
 * 
 *         # Cache a len-1 array for accelerating self[int] case
 *         self.arr1 = np.empty(shape=(1,), dtype=self._dtype)             # <<<<<<<<<<<<<<
 * 
 *         # Sentinels
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_tuple__19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_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":1028
 * 
 *         # Sentinels
 *         self.sss_mode = False             # <<<<<<<<<<<<<<
 *         self.wheretrue_mode = False
 *         self.where_mode = False
 */
  __pyx_v_self->sss_mode = 0;

  /* "bcolz/carray_ext.pyx":1029
 *         # Sentinels
 *         self.sss_mode = False
 *         self.wheretrue_mode = False             # <<<<<<<<<<<<<<
 *         self.where_mode = False
 *         self.idxcache = -1  # cache not initialized
 */
  __pyx_v_self->wheretrue_mode = 0;

  /* "bcolz/carray_ext.pyx":1030
 *         self.sss_mode = False
 *         self.wheretrue_mode = False
 *         self.where_mode = False             # <<<<<<<<<<<<<<
 *         self.idxcache = -1  # cache not initialized
 * 
 */
  __pyx_v_self->where_mode = 0;

  /* "bcolz/carray_ext.pyx":1031
 *         self.wheretrue_mode = False
 *         self.where_mode = False
 *         self.idxcache = -1  # cache not initialized             # <<<<<<<<<<<<<<
 * 
 *     cdef _adapt_dtype(self, dtype_, shape):
 */
  __pyx_v_self->idxcache = -1;

  /* "bcolz/carray_ext.pyx":998
 *             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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1033
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_adapt_dtype", 0);
  __Pyx_INCREF(__pyx_v_dtype_);

  /* "bcolz/carray_ext.pyx":1037
 *         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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype_, __pyx_n_s_hasobject); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1038
 *         """
 *         if dtype_.hasobject:
 *             if dtype_ != np.object_:             # <<<<<<<<<<<<<<
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")
 *         else:
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1039
 *         if dtype_.hasobject:
 *             if dtype_ != np.object_:
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")             # <<<<<<<<<<<<<<
 *         else:
 *             dtype_ = np.dtype((dtype_, shape[1:]))
 */
      __pyx_t_1 = PyObject_Repr(__pyx_v_dtype_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1038
 *         """
 *         if dtype_.hasobject:
 *             if dtype_ != np.object_:             # <<<<<<<<<<<<<<
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")
 *         else:
 */
    }

    /* "bcolz/carray_ext.pyx":1037
 *         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":1041
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")
 *         else:
 *             dtype_ = np.dtype((dtype_, shape[1:]))             # <<<<<<<<<<<<<<
 * 
 *         return dtype_
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_shape, 1, 0, NULL, NULL, &__pyx_slice__20, 1, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __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":1043
 *             dtype_ = np.dtype((dtype_, shape[1:]))
 * 
 *         return dtype_             # <<<<<<<<<<<<<<
 * 
 *     def _create_carray(self, array, cparams, dtype, dflt,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_dtype_);
  __pyx_r = __pyx_v_dtype_;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1033
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1045
 *         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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_carray") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __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_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;
  double __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char *__pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_create_carray", 0);
  __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":1060
 * 
 *         # Check defaults for cparams
 *         if cparams is None:             # <<<<<<<<<<<<<<
 *             cparams = bcolz.cparams()
 * 
 */
  __pyx_t_1 = (__pyx_v_cparams == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1061
 *         # Check defaults for cparams
 *         if cparams is None:
 *             cparams = bcolz.cparams()             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(cparams, bcolz.cparams):
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_bcolz); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __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":1060
 * 
 *         # Check defaults for cparams
 *         if cparams is None:             # <<<<<<<<<<<<<<
 *             cparams = bcolz.cparams()
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1063
 *             cparams = bcolz.cparams()
 * 
 *         if not isinstance(cparams, bcolz.cparams):             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "`cparams` param must be an instance of `cparams` class")
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_bcolz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __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":1064
 * 
 *         if not isinstance(cparams, bcolz.cparams):
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "`cparams` param must be an instance of `cparams` class")
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1063
 *             cparams = bcolz.cparams()
 * 
 *         if not isinstance(cparams, bcolz.cparams):             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "`cparams` param must be an instance of `cparams` class")
 */
  }

  /* "bcolz/carray_ext.pyx":1068
 * 
 *         # Convert input to an appropriate type
 *         if type(dtype) is str:             # <<<<<<<<<<<<<<
 *             dtype = np.dtype(dtype)
 * 
 */
  __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":1069
 *         # 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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __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":1068
 * 
 *         # Convert input to an appropriate type
 *         if type(dtype) is str:             # <<<<<<<<<<<<<<
 *             dtype = np.dtype(dtype)
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1076
 *         # 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_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":1077
 *         # (especially when dtypes and compression params match)
 *         if isinstance(array, carray):
 *             array = array[:]             # <<<<<<<<<<<<<<
 * 
 *         array_ = utils.to_ndarray(array, dtype)
 */
    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_array, 0, 0, NULL, NULL, &__pyx_slice__22, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __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":1076
 *         # 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":1079
 *             array = array[:]
 * 
 *         array_ = utils.to_ndarray(array, dtype)             # <<<<<<<<<<<<<<
 * 
 *         # if no base dtype is provided, use the dtype from the array.
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __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":1082
 * 
 *         # if no base dtype is provided, use the dtype from the array.
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             dtype = array_.dtype.base
 * 
 */
  __pyx_t_1 = (__pyx_v_dtype == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1083
 *         # 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_array_, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __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":1082
 * 
 *         # if no base dtype is provided, use the dtype from the array.
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             dtype = array_.dtype.base
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1093
 *         # 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_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_array_, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __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":1096
 * 
 *         # Check that atom size is less than 2 GB
 *         if dtype.itemsize >= 2 ** 31:             # <<<<<<<<<<<<<<
 *             raise ValueError("atomic size is too large (>= 2 GB)")
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1097
 *         # 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_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1096
 * 
 *         # 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":1100
 * 
 *         # Check that atom size is larger than 0
 *         if dtype.itemsize == 0:             # <<<<<<<<<<<<<<
 *             raise TypeError("atomic size cannot be zero")
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1101
 *         # 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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1100
 * 
 *         # Check that atom size is larger than 0
 *         if dtype.itemsize == 0:             # <<<<<<<<<<<<<<
 *             raise TypeError("atomic size cannot be zero")
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1103
 *             raise TypeError("atomic size cannot be zero")
 * 
 *         self.atomsize = atomsize = dtype.itemsize             # <<<<<<<<<<<<<<
 *         self.itemsize = itemsize = dtype.base.itemsize
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __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":1104
 * 
 *         self.atomsize = atomsize = dtype.itemsize
 *         self.itemsize = itemsize = dtype.base.itemsize             # <<<<<<<<<<<<<<
 * 
 *         # Check defaults for dflt
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __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":1107
 * 
 *         # Check defaults for dflt
 *         _dflt = np.zeros((), dtype=dtype)             # <<<<<<<<<<<<<<
 *         if dflt is not None:
 *             if dtype.shape == ():
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_v_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__25, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __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":1108
 *         # Check defaults for dflt
 *         _dflt = np.zeros((), dtype=dtype)
 *         if dflt is not None:             # <<<<<<<<<<<<<<
 *             if dtype.shape == ():
 *                 _dflt[()] = dflt
 */
  __pyx_t_2 = (__pyx_v_dflt != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":1109
 *         _dflt = np.zeros((), dtype=dtype)
 *         if dflt is not None:
 *             if dtype.shape == ():             # <<<<<<<<<<<<<<
 *                 _dflt[()] = dflt
 *             else:
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_7, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "bcolz/carray_ext.pyx":1110
 *         if dflt is not None:
 *             if dtype.shape == ():
 *                 _dflt[()] = dflt             # <<<<<<<<<<<<<<
 *             else:
 *                 _dflt[:] = dflt
 */
      if (unlikely(PyObject_SetItem(__pyx_v__dflt, __pyx_empty_tuple, __pyx_v_dflt) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1109
 *         _dflt = np.zeros((), dtype=dtype)
 *         if dflt is not None:
 *             if dtype.shape == ():             # <<<<<<<<<<<<<<
 *                 _dflt[()] = dflt
 *             else:
 */
      goto __pyx_L11;
    }

    /* "bcolz/carray_ext.pyx":1112
 *                 _dflt[()] = dflt
 *             else:
 *                 _dflt[:] = dflt             # <<<<<<<<<<<<<<
 *         self._dflt = _dflt
 * 
 */
    /*else*/ {
      if (__Pyx_PyObject_SetSlice(__pyx_v__dflt, __pyx_v_dflt, 0, 0, NULL, NULL, &__pyx_slice__26, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L11:;

    /* "bcolz/carray_ext.pyx":1108
 *         # Check defaults for dflt
 *         _dflt = np.zeros((), dtype=dtype)
 *         if dflt is not None:             # <<<<<<<<<<<<<<
 *             if dtype.shape == ():
 *                 _dflt[()] = dflt
 */
  }

  /* "bcolz/carray_ext.pyx":1113
 *             else:
 *                 _dflt[:] = dflt
 *         self._dflt = _dflt             # <<<<<<<<<<<<<<
 * 
 *         # Compute the chunklen/chunksize
 */
  __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":1116
 * 
 *         # Compute the chunklen/chunksize
 *         if expectedlen is None:             # <<<<<<<<<<<<<<
 *             # Try a guess
 *             try:
 */
  __pyx_t_1 = (__pyx_v_expectedlen == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1118
 *         if expectedlen is None:
 *             # Try a guess
 *             try:             # <<<<<<<<<<<<<<
 *                 expectedlen = len(array_)
 *             except TypeError:
 */
    {
      __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":1119
 *             # Try a guess
 *             try:
 *                 expectedlen = len(array_)             # <<<<<<<<<<<<<<
 *             except TypeError:
 *                 raise NotImplementedError(
 */
        __pyx_t_6 = PyObject_Length(__pyx_v_array_); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF_SET(__pyx_v_expectedlen, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "bcolz/carray_ext.pyx":1118
 *         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_L20_try_end;
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "bcolz/carray_ext.pyx":1120
 *             try:
 *                 expectedlen = len(array_)
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     "creating carrays from scalar objects is not supported")
 */
      __pyx_t_8 = 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_4, &__pyx_t_7, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_3);

        /* "bcolz/carray_ext.pyx":1121
 *                 expectedlen = len(array_)
 *             except TypeError:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "creating carrays from scalar objects is not supported")
 *         try:
 */
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L15_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_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
      }
      goto __pyx_L15_except_error;
      __pyx_L15_except_error:;

      /* "bcolz/carray_ext.pyx":1118
 *         if expectedlen is None:
 *             # Try a guess
 *             try:             # <<<<<<<<<<<<<<
 *                 expectedlen = len(array_)
 *             except TypeError:
 */
      __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_L20_try_end:;
    }

    /* "bcolz/carray_ext.pyx":1116
 * 
 *         # Compute the chunklen/chunksize
 *         if expectedlen is None:             # <<<<<<<<<<<<<<
 *             # Try a guess
 *             try:
 */
  }

  /* "bcolz/carray_ext.pyx":1123
 *                 raise NotImplementedError(
 *                     "creating carrays from scalar objects is not supported")
 *         try:             # <<<<<<<<<<<<<<
 *             self.expectedlen = expectedlen
 *         except OverflowError:
 */
  {
    __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":1124
 *                     "creating carrays from scalar objects is not supported")
 *         try:
 *             self.expectedlen = expectedlen             # <<<<<<<<<<<<<<
 *         except OverflowError:
 *             raise OverflowError(
 */
      __pyx_t_12 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_expectedlen); if (unlikely((__pyx_t_12 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __pyx_v_self->expectedlen = __pyx_t_12;

      /* "bcolz/carray_ext.pyx":1123
 *                 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_L30_try_end;
    __pyx_L23_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1125
 *         try:
 *             self.expectedlen = expectedlen
 *         except OverflowError:             # <<<<<<<<<<<<<<
 *             raise OverflowError(
 *                 "The size cannot be larger than 2**31 on 32-bit platforms")
 */
    __pyx_t_8 = 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_7, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_4);

      /* "bcolz/carray_ext.pyx":1126
 *             self.expectedlen = expectedlen
 *         except OverflowError:
 *             raise OverflowError(             # <<<<<<<<<<<<<<
 *                 "The size cannot be larger than 2**31 on 32-bit platforms")
 *         if chunklen is None:
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_OverflowError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L25_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_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
    }
    goto __pyx_L25_except_error;
    __pyx_L25_except_error:;

    /* "bcolz/carray_ext.pyx":1123
 *                 raise NotImplementedError(
 *                     "creating carrays from scalar objects is not supported")
 *         try:             # <<<<<<<<<<<<<<
 *             self.expectedlen = expectedlen
 *         except OverflowError:
 */
    __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_L30_try_end:;
  }

  /* "bcolz/carray_ext.pyx":1128
 *             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_t_2 = (__pyx_v_chunklen == Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":1130
 *         if chunklen is None:
 *             # Try a guess
 *             chunksize = utils.calc_chunksize(             # <<<<<<<<<<<<<<
 *                 (expectedlen * atomsize) / float(_MB))
 *             # Chunksize must be a multiple of atomsize
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_calc_chunksize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "bcolz/carray_ext.pyx":1131
 *             # 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_t_7 = __Pyx_PyInt_From_int(__pyx_v_atomsize); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PyNumber_Multiply(__pyx_v_expectedlen, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_MB); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_13 = __Pyx_PyObject_AsDouble(__pyx_t_7); if (unlikely(__pyx_t_13 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyFloat_FromDouble(__pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_14 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(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);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __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_14);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_14);
      __pyx_t_14 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __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;

    /* "bcolz/carray_ext.pyx":1130
 *         if chunklen is None:
 *             # Try a guess
 *             chunksize = utils.calc_chunksize(             # <<<<<<<<<<<<<<
 *                 (expectedlen * atomsize) / float(_MB))
 *             # Chunksize must be a multiple of atomsize
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_chunksize = __pyx_t_8;

    /* "bcolz/carray_ext.pyx":1133
 *                 (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_v_chunksize = ((__pyx_v_chunksize / __pyx_v_atomsize) * __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":1135
 *             chunksize = cython.cdiv(chunksize, atomsize) * atomsize
 *             # Protection against large itemsizes
 *             if chunksize < atomsize:             # <<<<<<<<<<<<<<
 *                 chunksize = atomsize
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_chunksize < __pyx_v_atomsize) != 0);
    if (__pyx_t_1) {

      /* "bcolz/carray_ext.pyx":1136
 *             # Protection against large itemsizes
 *             if chunksize < atomsize:
 *                 chunksize = atomsize             # <<<<<<<<<<<<<<
 *         else:
 *             if not isinstance(chunklen, int) or chunklen < 1:
 */
      __pyx_v_chunksize = __pyx_v_atomsize;

      /* "bcolz/carray_ext.pyx":1135
 *             chunksize = cython.cdiv(chunksize, atomsize) * atomsize
 *             # Protection against large itemsizes
 *             if chunksize < atomsize:             # <<<<<<<<<<<<<<
 *                 chunksize = atomsize
 *         else:
 */
    }

    /* "bcolz/carray_ext.pyx":1128
 *             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_L33;
  }

  /* "bcolz/carray_ext.pyx":1138
 *                 chunksize = atomsize
 *         else:
 *             if not isinstance(chunklen, int) or chunklen < 1:             # <<<<<<<<<<<<<<
 *                 raise ValueError("chunklen must be a positive integer")
 *             chunksize = chunklen * atomsize
 */
  /*else*/ {
    __pyx_t_2 = PyInt_Check(__pyx_v_chunklen); 
    __pyx_t_15 = ((!(__pyx_t_2 != 0)) != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_1 = __pyx_t_15;
      goto __pyx_L36_bool_binop_done;
    }
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_chunklen, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __pyx_t_15;
    __pyx_L36_bool_binop_done:;
    if (__pyx_t_1) {

      /* "bcolz/carray_ext.pyx":1139
 *         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_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1138
 *                 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":1140
 *             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_t_4 = __Pyx_PyInt_From_int(__pyx_v_atomsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Multiply(__pyx_v_chunklen, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_chunksize = __pyx_t_8;
  }
  __pyx_L33:;

  /* "bcolz/carray_ext.pyx":1141
 *                 raise ValueError("chunklen must be a positive integer")
 *             chunksize = chunklen * atomsize
 *         chunklen = cython.cdiv(chunksize, atomsize)             # <<<<<<<<<<<<<<
 *         self._chunksize = chunksize
 *         self._chunklen = chunklen
 */
  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_chunksize / __pyx_v_atomsize)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __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":1142
 *             chunksize = chunklen * atomsize
 *         chunklen = cython.cdiv(chunksize, atomsize)
 *         self._chunksize = chunksize             # <<<<<<<<<<<<<<
 *         self._chunklen = chunklen
 * 
 */
  __pyx_v_self->_chunksize = __pyx_v_chunksize;

  /* "bcolz/carray_ext.pyx":1143
 *         chunklen = cython.cdiv(chunksize, atomsize)
 *         self._chunksize = chunksize
 *         self._chunklen = chunklen             # <<<<<<<<<<<<<<
 * 
 *         # Book memory for last chunk (uncompressed)
 */
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_chunklen); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_chunklen = __pyx_t_8;

  /* "bcolz/carray_ext.pyx":1147
 *         # 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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_v_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __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_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lastchunkarr = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":1148
 *         # Use np.zeros here because they compress better
 *         lastchunkarr = np.zeros(dtype=dtype, shape=(chunklen,))
 *         self.lastchunk = lastchunkarr.data             # <<<<<<<<<<<<<<
 *         self.lastchunkarr = lastchunkarr
 * 
 */
  __pyx_t_16 = __pyx_v_lastchunkarr->data;
  __pyx_v_self->lastchunk = __pyx_t_16;

  /* "bcolz/carray_ext.pyx":1149
 *         lastchunkarr = np.zeros(dtype=dtype, shape=(chunklen,))
 *         self.lastchunk = lastchunkarr.data
 *         self.lastchunkarr = lastchunkarr             # <<<<<<<<<<<<<<
 * 
 *         # Create layout for data and metadata
 */
  __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":1152
 * 
 *         # Create layout for data and metadata
 *         self._cparams = cparams             # <<<<<<<<<<<<<<
 *         self.chunks = []
 *         if rootdir is not None:
 */
  __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":1153
 *         # Create layout for data and metadata
 *         self._cparams = cparams
 *         self.chunks = []             # <<<<<<<<<<<<<<
 *         if rootdir is not None:
 *             self._mkdirs(rootdir, mode)
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __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":1154
 *         self._cparams = cparams
 *         self.chunks = []
 *         if rootdir is not None:             # <<<<<<<<<<<<<<
 *             self._mkdirs(rootdir, mode)
 *             metainfo = (
 */
  __pyx_t_1 = (__pyx_v_rootdir != Py_None);
  __pyx_t_15 = (__pyx_t_1 != 0);
  if (__pyx_t_15) {

    /* "bcolz/carray_ext.pyx":1155
 *         self.chunks = []
 *         if rootdir is not None:
 *             self._mkdirs(rootdir, mode)             # <<<<<<<<<<<<<<
 *             metainfo = (
 *             dtype, cparams, self.shape[0], lastchunkarr, self._mode)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mkdirs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __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_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_6 = 1;
      }
    }
    __pyx_t_14 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_rootdir);
    __Pyx_GIVEREF(__pyx_v_rootdir);
    PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_6, __pyx_v_rootdir);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_6, __pyx_v_mode);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1157
 *             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_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __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":1158
 *             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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_metainfo, __pyx_v_metainfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunks), __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GIVEREF(__pyx_t_14);
    __Pyx_GOTREF(__pyx_v_self->chunks);
    __Pyx_DECREF(__pyx_v_self->chunks);
    __pyx_v_self->chunks = __pyx_t_14;
    __pyx_t_14 = 0;

    /* "bcolz/carray_ext.pyx":1160
 *             self.chunks = chunks(self._rootdir, metainfo=metainfo, _new=True)
 *             # We can write the metainfo already
 *             self._write_meta()             # <<<<<<<<<<<<<<
 * 
 *         # Finally, fill the chunks
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write_meta); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __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_14 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_14 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "bcolz/carray_ext.pyx":1154
 *         self._cparams = cparams
 *         self.chunks = []
 *         if rootdir is not None:             # <<<<<<<<<<<<<<
 *             self._mkdirs(rootdir, mode)
 *             metainfo = (
 */
  }

  /* "bcolz/carray_ext.pyx":1164
 *         # Finally, fill the chunks
 *         # Object dtype requires special storage
 *         if array_.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *             for obj in array_:
 *                 self._store_obj(obj)
 */
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_array_, __pyx_n_s_dtype); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_char); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_15 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_O, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_15) {

    /* "bcolz/carray_ext.pyx":1165
 *         # Object dtype requires special storage
 *         if array_.dtype.char == 'O':
 *             for obj in array_:             # <<<<<<<<<<<<<<
 *                 self._store_obj(obj)
 *         else:
 */
    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_17 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_array_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_17)) {
        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_14 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_14); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_14); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_14 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          #endif
        }
      } else {
        __pyx_t_14 = __pyx_t_17(__pyx_t_3);
        if (unlikely(!__pyx_t_14)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_14);
      }
      __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_14);
      __pyx_t_14 = 0;

      /* "bcolz/carray_ext.pyx":1166
 *         if array_.dtype.char == 'O':
 *             for obj in array_:
 *                 self._store_obj(obj)             # <<<<<<<<<<<<<<
 *         else:
 *             self._fill_chunks(array_)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_store_obj); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __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_14 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_obj); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_obj);
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "bcolz/carray_ext.pyx":1165
 *         # Object dtype requires special storage
 *         if array_.dtype.char == 'O':
 *             for obj in array_:             # <<<<<<<<<<<<<<
 *                 self._store_obj(obj)
 *         else:
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1164
 *         # Finally, fill the chunks
 *         # Object dtype requires special storage
 *         if array_.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *             for obj in array_:
 *                 self._store_obj(obj)
 */
    goto __pyx_L39;
  }

  /* "bcolz/carray_ext.pyx":1168
 *                 self._store_obj(obj)
 *         else:
 *             self._fill_chunks(array_)             # <<<<<<<<<<<<<<
 * 
 *         # and flush the data pending...
 */
  /*else*/ {
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fill_chunks); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_array_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __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+1, __pyx_v_array_);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L39:;

  /* "bcolz/carray_ext.pyx":1171
 * 
 *         # and flush the data pending...
 *         self.flush()             # <<<<<<<<<<<<<<
 * 
 *     def _open_carray(self, shape, cparams, dtype, dflt,
 */
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flush); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_14);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_14, function);
    }
  }
  if (__pyx_t_7) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1045
 *         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_14);
  __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1173
 *         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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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":1174
 * 
 *     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_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __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":1173
 *         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_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 *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_open_carray", 0);
  __Pyx_INCREF(__pyx_v_dtype);

  /* "bcolz/carray_ext.pyx":1180
 *         cdef npy_intp calen
 * 
 *         if len(shape) == 1:             # <<<<<<<<<<<<<<
 *             self._dtype = dtype
 *         else:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((__pyx_t_1 == 1) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1181
 * 
 *         if len(shape) == 1:
 *             self._dtype = dtype             # <<<<<<<<<<<<<<
 *         else:
 *             # Multidimensional array.  The atom will have array_.shape[1:]
 */
    __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":1180
 *         cdef npy_intp calen
 * 
 *         if len(shape) == 1:             # <<<<<<<<<<<<<<
 *             self._dtype = dtype
 *         else:
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":1190
 *             # from `self.shape`.  `self.dtype` will always be scalar (NumPy
 *             # convention).
 *             self._dtype = dtype = np.dtype((dtype.base, shape[1:]))             # <<<<<<<<<<<<<<
 * 
 *         self._cparams = cparams
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_shape, 1, 0, NULL, NULL, &__pyx_slice__30, 1, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __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":1192
 *             self._dtype = dtype = np.dtype((dtype.base, shape[1:]))
 * 
 *         self._cparams = cparams             # <<<<<<<<<<<<<<
 *         self.atomsize = dtype.itemsize
 *         self.itemsize = dtype.base.itemsize
 */
  __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":1193
 * 
 *         self._cparams = cparams
 *         self.atomsize = dtype.itemsize             # <<<<<<<<<<<<<<
 *         self.itemsize = dtype.base.itemsize
 *         self._chunklen = chunklen
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_self->atomsize = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":1194
 *         self._cparams = cparams
 *         self.atomsize = dtype.itemsize
 *         self.itemsize = dtype.base.itemsize             # <<<<<<<<<<<<<<
 *         self._chunklen = chunklen
 *         self._chunksize = chunklen * self.atomsize
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_self->itemsize = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":1195
 *         self.atomsize = dtype.itemsize
 *         self.itemsize = dtype.base.itemsize
 *         self._chunklen = chunklen             # <<<<<<<<<<<<<<
 *         self._chunksize = chunklen * self.atomsize
 *         self._dflt = dflt
 */
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_chunklen); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_chunklen = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":1196
 *         self.itemsize = dtype.base.itemsize
 *         self._chunklen = chunklen
 *         self._chunksize = chunklen * self.atomsize             # <<<<<<<<<<<<<<
 *         self._dflt = dflt
 *         self.expectedlen = expectedlen
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->atomsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_self->_chunksize = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":1197
 *         self._chunklen = chunklen
 *         self._chunksize = chunklen * self.atomsize
 *         self._dflt = dflt             # <<<<<<<<<<<<<<
 *         self.expectedlen = expectedlen
 * 
 */
  __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":1198
 *         self._chunksize = chunklen * self.atomsize
 *         self._dflt = dflt
 *         self.expectedlen = expectedlen             # <<<<<<<<<<<<<<
 * 
 *         # Book memory for last chunk (uncompressed)
 */
  __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_expectedlen); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->expectedlen = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1202
 *         # 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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lastchunkarr = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1203
 *         # Use np.zeros here because they compress better
 *         lastchunkarr = np.zeros(dtype=dtype, shape=(chunklen,))
 *         self.lastchunk = lastchunkarr.data             # <<<<<<<<<<<<<<
 *         self.lastchunkarr = lastchunkarr
 * 
 */
  __pyx_t_8 = __pyx_v_lastchunkarr->data;
  __pyx_v_self->lastchunk = __pyx_t_8;

  /* "bcolz/carray_ext.pyx":1204
 *         lastchunkarr = np.zeros(dtype=dtype, shape=(chunklen,))
 *         self.lastchunk = lastchunkarr.data
 *         self.lastchunkarr = lastchunkarr             # <<<<<<<<<<<<<<
 * 
 *         if xchunks is None:
 */
  __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":1206
 *         self.lastchunkarr = lastchunkarr
 * 
 *         if xchunks is None:             # <<<<<<<<<<<<<<
 *             # No chunks container, so read meta info from disk
 *             # Check rootdir hierarchy
 */
  __pyx_t_2 = (__pyx_v_xchunks == Py_None);
  __pyx_t_9 = (__pyx_t_2 != 0);
  if (__pyx_t_9) {

    /* "bcolz/carray_ext.pyx":1209
 *             # 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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __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":1210
 *             # 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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1209
 *             # 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":1211
 *             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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __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":1212
 *                 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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __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":1213
 *             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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1212
 *                 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":1214
 *             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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_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":1215
 *                 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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __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":1216
 *             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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1215
 *                 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":1219
 * 
 *             # Finally, open data directory
 *             metainfo = (dtype, cparams, shape[0], lastchunkarr, self._mode)             # <<<<<<<<<<<<<<
 *             self.chunks = chunks(self._rootdir, metainfo=metainfo, _new=False)
 *         else:
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __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":1220
 *             # 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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_metainfo, __pyx_v_metainfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __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":1206
 *         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":1222
 *             self.chunks = chunks(self._rootdir, metainfo=metainfo, _new=False)
 *         else:
 *             self.chunks, lastchunkarr[:] = xchunks             # <<<<<<<<<<<<<<
 * 
 *         # Update some counters
 */
  /*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_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __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__34, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "bcolz/carray_ext.pyx":1225
 * 
 *         # Update some counters
 *         calen = shape[0]  # the length ot the carray             # <<<<<<<<<<<<<<
 *         self.leftover = cython.cmod(calen, chunklen) * self.atomsize
 *         self._cbytes = cbytes
 */
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_calen = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1226
 *         # 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_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_calen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_self->leftover = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":1227
 *         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_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_cbytes); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->_cbytes = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1228
 *         self.leftover = cython.cmod(calen, chunklen) * self.atomsize
 *         self._cbytes = cbytes
 *         self._nbytes = calen * self.atomsize             # <<<<<<<<<<<<<<
 * 
 *         if self._mode == "w":
 */
  __pyx_v_self->_nbytes = (__pyx_v_calen * __pyx_v_self->atomsize);

  /* "bcolz/carray_ext.pyx":1230
 *         self._nbytes = calen * self.atomsize
 * 
 *         if self._mode == "w":             # <<<<<<<<<<<<<<
 *             # Remove all entries when mode is 'w'
 *             self.resize(0)
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1232
 *         if self._mode == "w":
 *             # Remove all entries when mode is 'w'
 *             self.resize(0)             # <<<<<<<<<<<<<<
 * 
 *     def _fill_chunks(self, object array_):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __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":1230
 *         self._nbytes = calen * self.atomsize
 * 
 *         if self._mode == "w":             # <<<<<<<<<<<<<<
 *             # Remove all entries when mode is 'w'
 *             self.resize(0)
 */
  }

  /* "bcolz/carray_ext.pyx":1173
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1234
 *             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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_fill_chunks", 0);

  /* "bcolz/carray_ext.pyx":1243
 * 
 *         # The number of bytes in incoming array
 *         nbytes = self.itemsize * array_.size             # <<<<<<<<<<<<<<
 *         self._nbytes = nbytes
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_nbytes = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":1244
 *         # The number of bytes in incoming array
 *         nbytes = self.itemsize * array_.size
 *         self._nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         # Compress data in chunks
 */
  __pyx_v_self->_nbytes = __pyx_v_nbytes;

  /* "bcolz/carray_ext.pyx":1247
 * 
 *         # Compress data in chunks
 *         cbytes = 0             # <<<<<<<<<<<<<<
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(nbytes, self._chunksize)
 */
  __pyx_v_cbytes = 0;

  /* "bcolz/carray_ext.pyx":1248
 *         # Compress data in chunks
 *         cbytes = 0
 *         chunklen = self._chunklen             # <<<<<<<<<<<<<<
 *         nchunks = <npy_intp> cython.cdiv(nbytes, self._chunksize)
 *         for i from 0 <= i < nchunks:
 */
  __pyx_t_5 = __pyx_v_self->_chunklen;
  __pyx_v_chunklen = __pyx_t_5;

  /* "bcolz/carray_ext.pyx":1249
 *         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_v_nchunks = ((npy_intp)(__pyx_v_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":1250
 *         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_t_4 = __pyx_v_nchunks;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "bcolz/carray_ext.pyx":1251
 *         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],
 */
    #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_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_6)) {

        /* "bcolz/carray_ext.pyx":1252
 *         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_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __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":1251
 *         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_t_2 = __Pyx_PyString_Format(__pyx_kp_s_i_nchunks_d_d, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
    }
    #endif

    /* "bcolz/carray_ext.pyx":1253
 *             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_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_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "bcolz/carray_ext.pyx":1254
 *             i, nchunks)
 *             chunk_ = chunk(array_[i * chunklen:(i + 1) * chunklen],
 *                            self._dtype, self._cparams,             # <<<<<<<<<<<<<<
 *                            _memory=self._rootdir is None)
 *             self.chunks.append(chunk_)
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __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":1255
 *             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_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_memory, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1253
 *             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_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __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":1256
 *                            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_t_7 = __Pyx_PyObject_Append(__pyx_v_self->chunks, ((PyObject *)__pyx_v_chunk_)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1257
 *                            _memory=self._rootdir is None)
 *             self.chunks.append(chunk_)
 *             cbytes += chunk_.cbytes             # <<<<<<<<<<<<<<
 *         self.leftover = leftover = cython.cmod(nbytes, self._chunksize)
 *         if leftover:
 */
    __pyx_v_cbytes = (__pyx_v_cbytes + __pyx_v_chunk_->cbytes);
  }

  /* "bcolz/carray_ext.pyx":1258
 *             self.chunks.append(chunk_)
 *             cbytes += chunk_.cbytes
 *         self.leftover = leftover = cython.cmod(nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         if leftover:
 *             remainder = array_[nchunks * chunklen:]
 */
  __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":1259
 *             cbytes += chunk_.cbytes
 *         self.leftover = leftover = cython.cmod(nbytes, self._chunksize)
 *         if leftover:             # <<<<<<<<<<<<<<
 *             remainder = array_[nchunks * chunklen:]
 *             memcpy(self.lastchunk, remainder.data, leftover)
 */
  __pyx_t_6 = (__pyx_v_leftover != 0);
  if (__pyx_t_6) {

    /* "bcolz/carray_ext.pyx":1260
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_remainder = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1261
 *         if leftover:
 *             remainder = array_[nchunks * chunklen:]
 *             memcpy(self.lastchunk, remainder.data, leftover)             # <<<<<<<<<<<<<<
 *         cbytes += self._chunksize  # count the space in last chunk
 *         self._cbytes = cbytes
 */
    memcpy(__pyx_v_self->lastchunk, __pyx_v_remainder->data, __pyx_v_leftover);

    /* "bcolz/carray_ext.pyx":1259
 *             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":1262
 *             remainder = array_[nchunks * chunklen:]
 *             memcpy(self.lastchunk, remainder.data, leftover)
 *         cbytes += self._chunksize  # count the space in last chunk             # <<<<<<<<<<<<<<
 *         self._cbytes = cbytes
 * 
 */
  __pyx_v_cbytes = (__pyx_v_cbytes + __pyx_v_self->_chunksize);

  /* "bcolz/carray_ext.pyx":1263
 *             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_v_self->_cbytes = __pyx_v_cbytes;

  /* "bcolz/carray_ext.pyx":1234
 *             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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1265
 *         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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_mkdirs") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_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_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_mkdirs", 0);

  /* "bcolz/carray_ext.pyx":1267
 *     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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1268
 *         """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_t_5 = (__Pyx_PyString_Equals(__pyx_v_self->_mode, __pyx_n_s_w, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":1271
 *                 raise IOError(
 *                     "specified rootdir path '%s' already exists "
 *                     "and creation mode is '%s'" % (rootdir, mode))             # <<<<<<<<<<<<<<
 *             if os.path.isdir(rootdir):
 *                 shutil.rmtree(rootdir)
 */
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":1269
 *         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_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1268
 *         """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":1272
 *                     "specified rootdir path '%s' already exists "
 *                     "and creation mode is '%s'" % (rootdir, mode))
 *             if os.path.isdir(rootdir):             # <<<<<<<<<<<<<<
 *                 shutil.rmtree(rootdir)
 *             else:
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":1273
 *                     "and creation mode is '%s'" % (rootdir, mode))
 *             if os.path.isdir(rootdir):
 *                 shutil.rmtree(rootdir)             # <<<<<<<<<<<<<<
 *             else:
 *                 os.remove(rootdir)
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_shutil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __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":1272
 *                     "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":1275
 *                 shutil.rmtree(rootdir)
 *             else:
 *                 os.remove(rootdir)             # <<<<<<<<<<<<<<
 *         os.mkdir(rootdir)
 *         self.datadir = os.path.join(rootdir, DATA_DIR)
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L5:;

    /* "bcolz/carray_ext.pyx":1267
 *     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":1276
 *             else:
 *                 os.remove(rootdir)
 *         os.mkdir(rootdir)             # <<<<<<<<<<<<<<
 *         self.datadir = os.path.join(rootdir, DATA_DIR)
 *         os.mkdir(self.datadir)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __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":1277
 *                 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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __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":1278
 *         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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __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":1279
 *         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_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __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":1280
 *         os.mkdir(self.datadir)
 *         self.metadir = os.path.join(rootdir, META_DIR)
 *         os.mkdir(self.metadir)             # <<<<<<<<<<<<<<
 * 
 *     def _write_meta(self):
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __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":1265
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1282
 *         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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_write_meta", 0);

  /* "bcolz/carray_ext.pyx":1284
 *     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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __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":1285
 *         """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,
 */
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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_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":1286
 *         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_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dflt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __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":1287
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __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":1288
 *             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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "bcolz/carray_ext.pyx":1287
 *         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_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __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":1288
 *             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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "bcolz/carray_ext.pyx":1287
 *         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_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __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":1290
 *                                    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_INCREF(__pyx_int_0);
            __Pyx_DECREF_SET(__pyx_v_dflt_list, __pyx_int_0);

            /* "bcolz/carray_ext.pyx":1287
 *         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":1292
 *                 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_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __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__36, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (__pyx_t_12) {

            /* "bcolz/carray_ext.pyx":1293
 *             # 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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_bytes_to_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
              __Pyx_GOTREF(__pyx_t_6);
            } else {
              __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __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":1292
 *                 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":1294
 *             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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_storagefh, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "bcolz/carray_ext.pyx":1297
 *                 # 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_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":1299
 *                 "dtype": self.dtype.__str__(),
 *                 "cparams": {
 *                     "clevel": self.cparams.clevel,             # <<<<<<<<<<<<<<
 *                     "shuffle": self.cparams.shuffle,
 *                 },
 */
          __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "bcolz/carray_ext.pyx":1300
 *                 "cparams": {
 *                     "clevel": self.cparams.clevel,
 *                     "shuffle": self.cparams.shuffle,             # <<<<<<<<<<<<<<
 *                 },
 *                 "chunklen": self._chunklen,
 */
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":1302
 *                     "shuffle": self.cparams.shuffle,
 *                 },
 *                 "chunklen": self._chunklen,             # <<<<<<<<<<<<<<
 *                 "expectedlen": self.expectedlen,
 *                 "dflt": dflt_list,
 */
          __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->_chunklen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_4);
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chunklen, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":1303
 *                 },
 *                 "chunklen": self._chunklen,
 *                 "expectedlen": self.expectedlen,             # <<<<<<<<<<<<<<
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))
 */
          __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->expectedlen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_4);
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_expectedlen, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "bcolz/carray_ext.pyx":1304
 *                 "chunklen": self._chunklen,
 *                 "expectedlen": self.expectedlen,
 *                 "dflt": dflt_list,             # <<<<<<<<<<<<<<
 *             }, ensure_ascii=True).encode('ascii'))
 *             storagefh.write(b"\n")
 */
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dflt, __pyx_v_dflt_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L7_error;}

          /* "bcolz/carray_ext.pyx":1294
 *             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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __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":1305
 *                 "expectedlen": self.expectedlen,
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))             # <<<<<<<<<<<<<<
 *             storagefh.write(b"\n")
 * 
 */
          __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_3);
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ensure_ascii, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L7_error;}

          /* "bcolz/carray_ext.pyx":1294
 *             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_t_14 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __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":1305
 *                 "expectedlen": self.expectedlen,
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))             # <<<<<<<<<<<<<<
 *             storagefh.write(b"\n")
 * 
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __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__37, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __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":1306
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))
 *             storagefh.write(b"\n")             # <<<<<<<<<<<<<<
 * 
 *     def _read_meta(self):
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_storagefh, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __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":1285
 *         """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_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_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_4);
            __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_4 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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_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_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__40, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __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":1282
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1308
 *             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_expectedlen = NULL;
  PyObject *__pyx_v_dflt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_meta", 0);

  /* "bcolz/carray_ext.pyx":1312
 * 
 *         # 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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __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":1313
 *         # 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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __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":1314
 *         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']
 */
  /*with:*/ {
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_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":1315
 *         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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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__41, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __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":1314
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_ErrRestore(__pyx_t_4, __pyx_t_1, __pyx_t_3);
            __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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_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_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__42, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __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":1316
 *         with open(shapef, 'rb') as shapefh:
 *             sizes = json.loads(shapefh.read().decode('ascii'))
 *         shape = sizes['shape']             # <<<<<<<<<<<<<<
 *         if type(shape) == list:
 *             shape = tuple(shape)
 */
  if (unlikely(!__pyx_v_sizes)) { __Pyx_RaiseUnboundLocalError("sizes"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_3 = PyObject_GetItem(__pyx_v_sizes, __pyx_n_s_shape); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_shape = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1317
 *             sizes = json.loads(shapefh.read().decode('ascii'))
 *         shape = sizes['shape']
 *         if type(shape) == list:             # <<<<<<<<<<<<<<
 *             shape = tuple(shape)
 *         nbytes = sizes["nbytes"]
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_13) {

    /* "bcolz/carray_ext.pyx":1318
 *         shape = sizes['shape']
 *         if type(shape) == list:
 *             shape = tuple(shape)             # <<<<<<<<<<<<<<
 *         nbytes = sizes["nbytes"]
 *         cbytes = sizes["cbytes"]
 */
    __pyx_t_3 = PySequence_Tuple(__pyx_v_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __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":1317
 *             sizes = json.loads(shapefh.read().decode('ascii'))
 *         shape = sizes['shape']
 *         if type(shape) == list:             # <<<<<<<<<<<<<<
 *             shape = tuple(shape)
 *         nbytes = sizes["nbytes"]
 */
  }

  /* "bcolz/carray_ext.pyx":1319
 *         if type(shape) == list:
 *             shape = tuple(shape)
 *         nbytes = sizes["nbytes"]             # <<<<<<<<<<<<<<
 *         cbytes = sizes["cbytes"]
 * 
 */
  if (unlikely(!__pyx_v_sizes)) { __Pyx_RaiseUnboundLocalError("sizes"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_3 = PyObject_GetItem(__pyx_v_sizes, __pyx_n_s_nbytes); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_nbytes = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1320
 *             shape = tuple(shape)
 *         nbytes = sizes["nbytes"]
 *         cbytes = sizes["cbytes"]             # <<<<<<<<<<<<<<
 * 
 *         # Then the rest of metadata
 */
  if (unlikely(!__pyx_v_sizes)) { __Pyx_RaiseUnboundLocalError("sizes"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_3 = PyObject_GetItem(__pyx_v_sizes, __pyx_n_s_cbytes); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_cbytes = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":1323
 * 
 *         # 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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __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":1324
 *         # 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"])
 */
  /*with:*/ {
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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_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":1325
 *         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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __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__43, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __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":1324
 *         # 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_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_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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_ErrRestore(__pyx_t_6, __pyx_t_3, __pyx_t_2);
            __pyx_t_6 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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_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_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__44, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __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":1326
 *         with open(storagef, 'rb') as storagefh:
 *             data = json.loads(storagefh.read().decode('ascii'))
 *         dtype_ = np.dtype(data["dtype"])             # <<<<<<<<<<<<<<
 *         chunklen = data["chunklen"]
 *         cparams = bcolz.cparams(
 */
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __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":1327
 *             data = json.loads(storagefh.read().decode('ascii'))
 *         dtype_ = np.dtype(data["dtype"])
 *         chunklen = data["chunklen"]             # <<<<<<<<<<<<<<
 *         cparams = bcolz.cparams(
 *             clevel=data["cparams"]["clevel"],
 */
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_chunklen); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_chunklen = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1328
 *         dtype_ = np.dtype(data["dtype"])
 *         chunklen = data["chunklen"]
 *         cparams = bcolz.cparams(             # <<<<<<<<<<<<<<
 *             clevel=data["cparams"]["clevel"],
 *             shuffle=data["cparams"]["shuffle"])
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_bcolz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1329
 *         chunklen = data["chunklen"]
 *         cparams = bcolz.cparams(
 *             clevel=data["cparams"]["clevel"],             # <<<<<<<<<<<<<<
 *             shuffle=data["cparams"]["shuffle"])
 *         expectedlen = data["expectedlen"]
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_cparams); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1330
 *         cparams = bcolz.cparams(
 *             clevel=data["cparams"]["clevel"],
 *             shuffle=data["cparams"]["shuffle"])             # <<<<<<<<<<<<<<
 *         expectedlen = data["expectedlen"]
 *         dflt = data["dflt"]
 */
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_cparams); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1328
 *         dtype_ = np.dtype(data["dtype"])
 *         chunklen = data["chunklen"]
 *         cparams = bcolz.cparams(             # <<<<<<<<<<<<<<
 *             clevel=data["cparams"]["clevel"],
 *             shuffle=data["cparams"]["shuffle"])
 */
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __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_v_cparams = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1331
 *             clevel=data["cparams"]["clevel"],
 *             shuffle=data["cparams"]["shuffle"])
 *         expectedlen = data["expectedlen"]             # <<<<<<<<<<<<<<
 *         dflt = data["dflt"]
 *         return (shape, cparams, dtype_, dflt, expectedlen, cbytes, chunklen)
 */
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_expectedlen); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_expectedlen = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1332
 *             shuffle=data["cparams"]["shuffle"])
 *         expectedlen = data["expectedlen"]
 *         dflt = data["dflt"]             # <<<<<<<<<<<<<<
 *         return (shape, cparams, dtype_, dflt, expectedlen, cbytes, chunklen)
 * 
 */
  if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_dflt); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_dflt = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1333
 *         expectedlen = data["expectedlen"]
 *         dflt = data["dflt"]
 *         return (shape, cparams, dtype_, dflt, expectedlen, cbytes, chunklen)             # <<<<<<<<<<<<<<
 * 
 *     def _store_obj(self, object arrobj):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __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":1308
 *             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_expectedlen);
  __Pyx_XDECREF(__pyx_v_dflt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1335
 *         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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_store_obj", 0);

  /* "bcolz/carray_ext.pyx":1337
 *     def _store_obj(self, object arrobj):
 *         cdef chunk chunk_
 *         import pickle             # <<<<<<<<<<<<<<
 * 
 *         pick_obj = pickle.dumps(arrobj, pickle.HIGHEST_PROTOCOL)
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pickle, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pickle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1339
 *         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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pickle, __pyx_n_s_dumps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __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":1340
 * 
 *         pick_obj = pickle.dumps(arrobj, pickle.HIGHEST_PROTOCOL)
 *         chunk_ = chunk(pick_obj, np.dtype('O'), self._cparams,             # <<<<<<<<<<<<<<
 *                        _memory=self._rootdir is None)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __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":1341
 *         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_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_memory, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1340
 * 
 *         pick_obj = pickle.dumps(arrobj, pickle.HIGHEST_PROTOCOL)
 *         chunk_ = chunk(pick_obj, np.dtype('O'), self._cparams,             # <<<<<<<<<<<<<<
 *                        _memory=self._rootdir is None)
 * 
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __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":1343
 *                        _memory=self._rootdir is None)
 * 
 *         self.chunks.append(chunk_)             # <<<<<<<<<<<<<<
 *         # Update some counters
 *         nbytes, cbytes = chunk_.nbytes, chunk_.cbytes
 */
  __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_self->chunks, ((PyObject *)__pyx_v_chunk_)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":1345
 *         self.chunks.append(chunk_)
 *         # Update some counters
 *         nbytes, cbytes = chunk_.nbytes, chunk_.cbytes             # <<<<<<<<<<<<<<
 *         self._cbytes += cbytes
 *         self._nbytes += nbytes
 */
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_chunk_->nbytes); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __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":1346
 *         # Update some counters
 *         nbytes, cbytes = chunk_.nbytes, chunk_.cbytes
 *         self._cbytes += cbytes             # <<<<<<<<<<<<<<
 *         self._nbytes += nbytes
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_cbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_self->_cbytes = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":1347
 *         nbytes, cbytes = chunk_.nbytes, chunk_.cbytes
 *         self._cbytes += cbytes
 *         self._nbytes += nbytes             # <<<<<<<<<<<<<<
 * 
 *     def append(self, object array):
 */
  __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_nbytes); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_nbytes = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":1335
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1349
 *         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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("append", 0);

  /* "bcolz/carray_ext.pyx":1366
 *         cdef chunk chunk_
 * 
 *         if self.safe:             # <<<<<<<<<<<<<<
 *             if self.mode == "r":
 *                 raise IOError(
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_safe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1367
 * 
 *         if self.safe:
 *             if self.mode == "r":             # <<<<<<<<<<<<<<
 *                 raise IOError(
 *                     "cannot modify data because mode is '%s'" % self.mode)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1369
 *             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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":1368
 *         if self.safe:
 *             if self.mode == "r":
 *                 raise IOError(             # <<<<<<<<<<<<<<
 *                     "cannot modify data because mode is '%s'" % self.mode)
 * 
 */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1367
 * 
 *         if self.safe:
 *             if self.mode == "r":             # <<<<<<<<<<<<<<
 *                 raise IOError(
 *                     "cannot modify data because mode is '%s'" % self.mode)
 */
    }

    /* "bcolz/carray_ext.pyx":1371
 *                     "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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_safe, __pyx_v_self->_safe) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_arrcpy = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1372
 * 
 *             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_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arrcpy), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1373
 *             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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1372
 * 
 *             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":1376
 * 
 *             # Object dtype requires special storage
 *             if arrcpy.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *                 for j in range(len(arrcpy)):
 *                     self._store_obj(arrcpy[j])
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arrcpy), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1377
 *             # Object dtype requires special storage
 *             if arrcpy.dtype.char == 'O':
 *                 for j in range(len(arrcpy)):             # <<<<<<<<<<<<<<
 *                     self._store_obj(arrcpy[j])
 *                 return
 */
      __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_arrcpy)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __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":1378
 *             if arrcpy.dtype.char == 'O':
 *                 for j in range(len(arrcpy)):
 *                     self._store_obj(arrcpy[j])             # <<<<<<<<<<<<<<
 *                 return
 * 
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_store_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __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":1379
 *                 for j in range(len(arrcpy)):
 *                     self._store_obj(arrcpy[j])
 *                 return             # <<<<<<<<<<<<<<
 * 
 *             # Appending a single row should be supported
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":1376
 * 
 *             # 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":1382
 * 
 *             # 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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1383
 *             # 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_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arrcpy), __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __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__47, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF_SET(__pyx_v_arrcpy, ((PyArrayObject *)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":1382
 * 
 *             # 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":1384
 *             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_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __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__48, 1, 0, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1385
 *                 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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1384
 *             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":1366
 *         cdef chunk chunk_
 * 
 *         if self.safe:             # <<<<<<<<<<<<<<
 *             if self.mode == "r":
 *                 raise IOError(
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":1388
 *                     "array trailing dimensions do not match with self")
 *         else:
 *             arrcpy = array             # <<<<<<<<<<<<<<
 * 
 *         atomsize = self.atomsize
 */
  /*else*/ {
    if (!(likely(((__pyx_v_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __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":1390
 *             arrcpy = array
 * 
 *         atomsize = self.atomsize             # <<<<<<<<<<<<<<
 *         itemsize = self.itemsize
 *         chunksize = self._chunksize
 */
  __pyx_t_10 = __pyx_v_self->atomsize;
  __pyx_v_atomsize = __pyx_t_10;

  /* "bcolz/carray_ext.pyx":1391
 * 
 *         atomsize = self.atomsize
 *         itemsize = self.itemsize             # <<<<<<<<<<<<<<
 *         chunksize = self._chunksize
 *         chunks = self.chunks
 */
  __pyx_t_10 = __pyx_v_self->itemsize;
  __pyx_v_itemsize = __pyx_t_10;

  /* "bcolz/carray_ext.pyx":1392
 *         atomsize = self.atomsize
 *         itemsize = self.itemsize
 *         chunksize = self._chunksize             # <<<<<<<<<<<<<<
 *         chunks = self.chunks
 *         leftover = self.leftover
 */
  __pyx_t_10 = __pyx_v_self->_chunksize;
  __pyx_v_chunksize = __pyx_t_10;

  /* "bcolz/carray_ext.pyx":1393
 *         itemsize = self.itemsize
 *         chunksize = self._chunksize
 *         chunks = self.chunks             # <<<<<<<<<<<<<<
 *         leftover = self.leftover
 *         bsize = arrcpy.size * itemsize
 */
  __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":1394
 *         chunksize = self._chunksize
 *         chunks = self.chunks
 *         leftover = self.leftover             # <<<<<<<<<<<<<<
 *         bsize = arrcpy.size * itemsize
 *         cbytes = 0
 */
  __pyx_t_10 = __pyx_v_self->leftover;
  __pyx_v_leftover = __pyx_t_10;

  /* "bcolz/carray_ext.pyx":1395
 *         chunks = self.chunks
 *         leftover = self.leftover
 *         bsize = arrcpy.size * itemsize             # <<<<<<<<<<<<<<
 *         cbytes = 0
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arrcpy), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_v_bsize = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1396
 *         leftover = self.leftover
 *         bsize = arrcpy.size * itemsize
 *         cbytes = 0             # <<<<<<<<<<<<<<
 * 
 *         # Check if array fits in existing buffer
 */
  __pyx_v_cbytes = 0;

  /* "bcolz/carray_ext.pyx":1399
 * 
 *         # 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_t_2 = (((__pyx_v_bsize + __pyx_v_leftover) < __pyx_v_chunksize) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1401
 *         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_t_2 = (((__pyx_v_arrcpy->strides[0]) > 0) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1402
 *             # 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)
 */
      memcpy((__pyx_v_self->lastchunk + __pyx_v_leftover), __pyx_v_arrcpy->data, __pyx_v_bsize);

      /* "bcolz/carray_ext.pyx":1401
 *         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":1404
 *                 memcpy(self.lastchunk + leftover, arrcpy.data, bsize)
 *             else:
 *                 start = cython.cdiv(leftover, atomsize)             # <<<<<<<<<<<<<<
 *                 stop = cython.cdiv((leftover + bsize), atomsize)
 *                 self.lastchunkarr[start:stop] = arrcpy
 */
    /*else*/ {
      __pyx_v_start = (__pyx_v_leftover / __pyx_v_atomsize);

      /* "bcolz/carray_ext.pyx":1405
 *             else:
 *                 start = cython.cdiv(leftover, atomsize)
 *                 stop = cython.cdiv((leftover + bsize), atomsize)             # <<<<<<<<<<<<<<
 *                 self.lastchunkarr[start:stop] = arrcpy
 *             leftover += bsize
 */
      __pyx_v_stop = ((__pyx_v_leftover + __pyx_v_bsize) / __pyx_v_atomsize);

      /* "bcolz/carray_ext.pyx":1406
 *                 start = cython.cdiv(leftover, atomsize)
 *                 stop = cython.cdiv((leftover + bsize), atomsize)
 *                 self.lastchunkarr[start:stop] = arrcpy             # <<<<<<<<<<<<<<
 *             leftover += bsize
 *         else:
 */
      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_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L12:;

    /* "bcolz/carray_ext.pyx":1407
 *                 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_v_leftover = (__pyx_v_leftover + __pyx_v_bsize);

    /* "bcolz/carray_ext.pyx":1399
 * 
 *         # 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":1412
 * 
 *             # First, fill the last buffer completely (if needed)
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 nbytesfirst = chunksize - leftover
 *                 if arrcpy.strides[0] > 0:
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_leftover != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1413
 *             # 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_v_nbytesfirst = (__pyx_v_chunksize - __pyx_v_leftover);

      /* "bcolz/carray_ext.pyx":1414
 *             if leftover:
 *                 nbytesfirst = chunksize - leftover
 *                 if arrcpy.strides[0] > 0:             # <<<<<<<<<<<<<<
 *                     memcpy(self.lastchunk + leftover, arrcpy.data, nbytesfirst)
 *                 else:
 */
      __pyx_t_2 = (((__pyx_v_arrcpy->strides[0]) > 0) != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":1415
 *                 nbytesfirst = chunksize - leftover
 *                 if arrcpy.strides[0] > 0:
 *                     memcpy(self.lastchunk + leftover, arrcpy.data, nbytesfirst)             # <<<<<<<<<<<<<<
 *                 else:
 *                     start = cython.cdiv(leftover, atomsize)
 */
        memcpy((__pyx_v_self->lastchunk + __pyx_v_leftover), __pyx_v_arrcpy->data, __pyx_v_nbytesfirst);

        /* "bcolz/carray_ext.pyx":1414
 *             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":1417
 *                     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]
 */
      /*else*/ {
        __pyx_v_start = (__pyx_v_leftover / __pyx_v_atomsize);

        /* "bcolz/carray_ext.pyx":1418
 *                 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_v_stop = ((__pyx_v_leftover + __pyx_v_nbytesfirst) / __pyx_v_atomsize);

        /* "bcolz/carray_ext.pyx":1419
 *                     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_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_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_L14:;

      /* "bcolz/carray_ext.pyx":1421
 *                     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_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __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":1422
 *                 # 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_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":1421
 *                     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_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __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":1423
 *                 chunk_ = chunk(self.lastchunkarr, self._dtype, self._cparams,
 *                                _memory=self._rootdir is None)
 *                 chunks.append(chunk_)             # <<<<<<<<<<<<<<
 *                 cbytes = chunk_.cbytes
 *             else:
 */
      __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_chunks, ((PyObject *)__pyx_v_chunk_)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1424
 *                                _memory=self._rootdir is None)
 *                 chunks.append(chunk_)
 *                 cbytes = chunk_.cbytes             # <<<<<<<<<<<<<<
 *             else:
 *                 nbytesfirst = 0
 */
      __pyx_t_10 = __pyx_v_chunk_->cbytes;
      __pyx_v_cbytes = __pyx_t_10;

      /* "bcolz/carray_ext.pyx":1412
 * 
 *             # 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":1426
 *                 cbytes = chunk_.cbytes
 *             else:
 *                 nbytesfirst = 0             # <<<<<<<<<<<<<<
 * 
 *             # Then fill other possible chunks
 */
    /*else*/ {
      __pyx_v_nbytesfirst = 0;
    }
    __pyx_L13:;

    /* "bcolz/carray_ext.pyx":1429
 * 
 *             # Then fill other possible chunks
 *             nbytes = bsize - nbytesfirst             # <<<<<<<<<<<<<<
 *             nchunks = <npy_intp> cython.cdiv(nbytes, chunksize)
 *             chunklen = self._chunklen
 */
    __pyx_v_nbytes = (__pyx_v_bsize - __pyx_v_nbytesfirst);

    /* "bcolz/carray_ext.pyx":1430
 *             # 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_v_nchunks = ((npy_intp)(__pyx_v_nbytes / __pyx_v_chunksize));

    /* "bcolz/carray_ext.pyx":1431
 *             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_t_10 = __pyx_v_self->_chunklen;
    __pyx_v_chunklen = __pyx_t_10;

    /* "bcolz/carray_ext.pyx":1434
 *             # 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_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_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_remainder = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1435
 *             # copied
 *             remainder = arrcpy[cython.cdiv(nbytesfirst, atomsize):]
 *             for i from 0 <= i < nchunks:             # <<<<<<<<<<<<<<
 *                 chunk_ = chunk(
 *                     remainder[i * chunklen:(i + 1) * chunklen], self._dtype,
 */
    __pyx_t_7 = __pyx_v_nchunks;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "bcolz/carray_ext.pyx":1437
 *             for i from 0 <= i < nchunks:
 *                 chunk_ = chunk(
 *                     remainder[i * chunklen:(i + 1) * chunklen], self._dtype,             # <<<<<<<<<<<<<<
 *                     self._cparams,
 *                     _memory=self._rootdir is None)
 */
      __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_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);

      /* "bcolz/carray_ext.pyx":1436
 *             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_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __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":1439
 *                     remainder[i * chunklen:(i + 1) * chunklen], self._dtype,
 *                     self._cparams,
 *                     _memory=self._rootdir is None)             # <<<<<<<<<<<<<<
 *                 chunks.append(chunk_)
 *                 cbytes += chunk_.cbytes
 */
      __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_memory, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "bcolz/carray_ext.pyx":1436
 *             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_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __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":1440
 *                     self._cparams,
 *                     _memory=self._rootdir is None)
 *                 chunks.append(chunk_)             # <<<<<<<<<<<<<<
 *                 cbytes += chunk_.cbytes
 * 
 */
      __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_chunks, ((PyObject *)__pyx_v_chunk_)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1441
 *                     _memory=self._rootdir is None)
 *                 chunks.append(chunk_)
 *                 cbytes += chunk_.cbytes             # <<<<<<<<<<<<<<
 * 
 *             # Finally, deal with the leftover
 */
      __pyx_v_cbytes = (__pyx_v_cbytes + __pyx_v_chunk_->cbytes);
    }

    /* "bcolz/carray_ext.pyx":1444
 * 
 *             # Finally, deal with the leftover
 *             leftover = cython.cmod(nbytes, chunksize)             # <<<<<<<<<<<<<<
 *             if leftover:
 *                 remainder = remainder[nchunks * chunklen:]
 */
    __pyx_v_leftover = (__pyx_v_nbytes % __pyx_v_chunksize);

    /* "bcolz/carray_ext.pyx":1445
 *             # Finally, deal with the leftover
 *             leftover = cython.cmod(nbytes, chunksize)
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 remainder = remainder[nchunks * chunklen:]
 *                 if arrcpy.strides[0] > 0:
 */
    __pyx_t_2 = (__pyx_v_leftover != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1446
 *             leftover = cython.cmod(nbytes, chunksize)
 *             if leftover:
 *                 remainder = remainder[nchunks * chunklen:]             # <<<<<<<<<<<<<<
 *                 if arrcpy.strides[0] > 0:
 *                     memcpy(self.lastchunk, remainder.data, leftover)
 */
      __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_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF_SET(__pyx_v_remainder, ((PyArrayObject *)__pyx_t_9));
      __pyx_t_9 = 0;

      /* "bcolz/carray_ext.pyx":1447
 *             if leftover:
 *                 remainder = remainder[nchunks * chunklen:]
 *                 if arrcpy.strides[0] > 0:             # <<<<<<<<<<<<<<
 *                     memcpy(self.lastchunk, remainder.data, leftover)
 *                 else:
 */
      __pyx_t_2 = (((__pyx_v_arrcpy->strides[0]) > 0) != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":1448
 *                 remainder = remainder[nchunks * chunklen:]
 *                 if arrcpy.strides[0] > 0:
 *                     memcpy(self.lastchunk, remainder.data, leftover)             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.lastchunkarr[:len(remainder)] = remainder
 */
        memcpy(__pyx_v_self->lastchunk, __pyx_v_remainder->data, __pyx_v_leftover);

        /* "bcolz/carray_ext.pyx":1447
 *             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":1450
 *                     memcpy(self.lastchunk, remainder.data, leftover)
 *                 else:
 *                     self.lastchunkarr[:len(remainder)] = remainder             # <<<<<<<<<<<<<<
 * 
 *         # Update some counters
 */
      /*else*/ {
        __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_remainder)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L18:;

      /* "bcolz/carray_ext.pyx":1445
 *             # 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":1453
 * 
 *         # Update some counters
 *         self.leftover = leftover             # <<<<<<<<<<<<<<
 *         self._cbytes += cbytes
 *         self._nbytes += bsize
 */
  __pyx_v_self->leftover = __pyx_v_leftover;

  /* "bcolz/carray_ext.pyx":1454
 *         # Update some counters
 *         self.leftover = leftover
 *         self._cbytes += cbytes             # <<<<<<<<<<<<<<
 *         self._nbytes += bsize
 *         return
 */
  __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes + __pyx_v_cbytes);

  /* "bcolz/carray_ext.pyx":1455
 *         self.leftover = leftover
 *         self._cbytes += cbytes
 *         self._nbytes += bsize             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_v_self->_nbytes = (__pyx_v_self->_nbytes + __pyx_v_bsize);

  /* "bcolz/carray_ext.pyx":1456
 *         self._cbytes += cbytes
 *         self._nbytes += bsize
 *         return             # <<<<<<<<<<<<<<
 * 
 *     def trim(self, object nitems):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1349
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1458
 *         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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trim", 0);

  /* "bcolz/carray_ext.pyx":1473
 *         cdef chunk chunk_
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):             # <<<<<<<<<<<<<<
 *             raise TypeError("`nitems` must be an integer")
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_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_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __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":1474
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):
 *             raise TypeError("`nitems` must be an integer")             # <<<<<<<<<<<<<<
 * 
 *         # Check that we don't run out of space
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1473
 *         cdef chunk chunk_
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):             # <<<<<<<<<<<<<<
 *             raise TypeError("`nitems` must be an integer")
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1477
 * 
 *         # 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_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1478
 *         # 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_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1477
 * 
 *         # 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":1480
 *             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_t_2 = PyObject_RichCompare(__pyx_v_nitems, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1481
 *         # A negative number of items means that we want to grow the object
 *         if nitems <= 0:
 *             self.resize(self.len - nitems)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __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":1482
 *         if nitems <= 0:
 *             self.resize(self.len - nitems)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         atomsize = self.atomsize
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1480
 *             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":1484
 *             return
 * 
 *         atomsize = self.atomsize             # <<<<<<<<<<<<<<
 *         chunks = self.chunks
 *         leftover = self.leftover
 */
  __pyx_t_8 = __pyx_v_self->atomsize;
  __pyx_v_atomsize = __pyx_t_8;

  /* "bcolz/carray_ext.pyx":1485
 * 
 *         atomsize = self.atomsize
 *         chunks = self.chunks             # <<<<<<<<<<<<<<
 *         leftover = self.leftover
 *         bsize = nitems * atomsize
 */
  __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":1486
 *         atomsize = self.atomsize
 *         chunks = self.chunks
 *         leftover = self.leftover             # <<<<<<<<<<<<<<
 *         bsize = nitems * atomsize
 *         cbytes = 0
 */
  __pyx_t_8 = __pyx_v_self->leftover;
  __pyx_v_leftover = __pyx_t_8;

  /* "bcolz/carray_ext.pyx":1487
 *         chunks = self.chunks
 *         leftover = self.leftover
 *         bsize = nitems * atomsize             # <<<<<<<<<<<<<<
 *         cbytes = 0
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_atomsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_bsize = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":1488
 *         leftover = self.leftover
 *         bsize = nitems * atomsize
 *         cbytes = 0             # <<<<<<<<<<<<<<
 * 
 *         # Check if items belong to the last chunk
 */
  __pyx_v_cbytes = 0;

  /* "bcolz/carray_ext.pyx":1491
 * 
 *         # Check if items belong to the last chunk
 *         if (leftover - bsize) > 0:             # <<<<<<<<<<<<<<
 *             # Just update leftover counter
 *             leftover -= bsize
 */
  __pyx_t_5 = (((__pyx_v_leftover - __pyx_v_bsize) > 0) != 0);
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1493
 *         if (leftover - bsize) > 0:
 *             # Just update leftover counter
 *             leftover -= bsize             # <<<<<<<<<<<<<<
 *         else:
 *             # nitems larger than last chunk
 */
    __pyx_v_leftover = (__pyx_v_leftover - __pyx_v_bsize);

    /* "bcolz/carray_ext.pyx":1491
 * 
 *         # 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":1496
 *         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
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __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":1497
 *             # 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_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_leftover2 = __pyx_t_8;

    /* "bcolz/carray_ext.pyx":1498
 *             nchunk = cython.cdiv((self.len - nitems), self._chunklen)
 *             leftover2 = cython.cmod((self.len - nitems), self._chunklen)
 *             leftover = leftover2 * atomsize             # <<<<<<<<<<<<<<
 * 
 *             # Remove complete chunks
 */
    __pyx_v_leftover = (__pyx_v_leftover2 * __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":1501
 * 
 *             # Remove complete chunks
 *             nchunk2 = lnchunk = <npy_intp> cython.cdiv(             # <<<<<<<<<<<<<<
 *                 self._nbytes, self._chunksize)
 *             while nchunk2 > nchunk:
 */
    __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":1503
 *             nchunk2 = lnchunk = <npy_intp> cython.cdiv(
 *                 self._nbytes, self._chunksize)
 *             while nchunk2 > nchunk:             # <<<<<<<<<<<<<<
 *                 chunk_ = chunks.pop()
 *                 cbytes += chunk_.cbytes
 */
    while (1) {
      __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_nchunk2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!__pyx_t_5) break;

      /* "bcolz/carray_ext.pyx":1504
 *                 self._nbytes, self._chunksize)
 *             while nchunk2 > nchunk:
 *                 chunk_ = chunks.pop()             # <<<<<<<<<<<<<<
 *                 cbytes += chunk_.cbytes
 *                 nchunk2 -= 1
 */
      __pyx_t_7 = __Pyx_PyObject_Pop(__pyx_v_chunks); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __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":1505
 *             while nchunk2 > nchunk:
 *                 chunk_ = chunks.pop()
 *                 cbytes += chunk_.cbytes             # <<<<<<<<<<<<<<
 *                 nchunk2 -= 1
 * 
 */
      __pyx_v_cbytes = (__pyx_v_cbytes + __pyx_v_chunk_->cbytes);

      /* "bcolz/carray_ext.pyx":1506
 *                 chunk_ = chunks.pop()
 *                 cbytes += chunk_.cbytes
 *                 nchunk2 -= 1             # <<<<<<<<<<<<<<
 * 
 *             # Finally, deal with the leftover
 */
      __pyx_v_nchunk2 = (__pyx_v_nchunk2 - 1);
    }

    /* "bcolz/carray_ext.pyx":1509
 * 
 *             # Finally, deal with the leftover
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 self.lastchunkarr[:leftover2] = chunk_[:leftover2]
 *                 if self._rootdir:
 */
    __pyx_t_5 = (__pyx_v_leftover != 0);
    if (__pyx_t_5) {

      /* "bcolz/carray_ext.pyx":1510
 *             # Finally, deal with the leftover
 *             if leftover:
 *                 self.lastchunkarr[:leftover2] = chunk_[:leftover2]             # <<<<<<<<<<<<<<
 *                 if self._rootdir:
 *                     # Last chunk is removed automatically by the chunks.pop(
 */
      if (unlikely(!__pyx_v_chunk_)) { __Pyx_RaiseUnboundLocalError("chunk_"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "bcolz/carray_ext.pyx":1511
 *             if leftover:
 *                 self.lastchunkarr[:leftover2] = chunk_[:leftover2]
 *                 if self._rootdir:             # <<<<<<<<<<<<<<
 *                     # Last chunk is removed automatically by the chunks.pop(
 *                     # ) call, and
 */
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_rootdir); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_5) {

        /* "bcolz/carray_ext.pyx":1517
 *                     #  it is in
 *                     # this state on-disk)
 *                     cbytes += chunk_.nbytes             # <<<<<<<<<<<<<<
 * 
 *         # Update some counters
 */
        if (unlikely(!__pyx_v_chunk_)) { __Pyx_RaiseUnboundLocalError("chunk_"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        __pyx_v_cbytes = (__pyx_v_cbytes + __pyx_v_chunk_->nbytes);

        /* "bcolz/carray_ext.pyx":1511
 *             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":1509
 * 
 *             # Finally, deal with the leftover
 *             if leftover:             # <<<<<<<<<<<<<<
 *                 self.lastchunkarr[:leftover2] = chunk_[:leftover2]
 *                 if self._rootdir:
 */
    }
  }
  __pyx_L6:;

  /* "bcolz/carray_ext.pyx":1520
 * 
 *         # Update some counters
 *         self.leftover = leftover             # <<<<<<<<<<<<<<
 *         self._cbytes -= cbytes
 *         self._nbytes -= bsize
 */
  __pyx_v_self->leftover = __pyx_v_leftover;

  /* "bcolz/carray_ext.pyx":1521
 *         # Update some counters
 *         self.leftover = leftover
 *         self._cbytes -= cbytes             # <<<<<<<<<<<<<<
 *         self._nbytes -= bsize
 *         # Flush last chunk and update counters on-disk
 */
  __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes - __pyx_v_cbytes);

  /* "bcolz/carray_ext.pyx":1522
 *         self.leftover = leftover
 *         self._cbytes -= cbytes
 *         self._nbytes -= bsize             # <<<<<<<<<<<<<<
 *         # Flush last chunk and update counters on-disk
 *         self.flush()
 */
  __pyx_v_self->_nbytes = (__pyx_v_self->_nbytes - __pyx_v_bsize);

  /* "bcolz/carray_ext.pyx":1524
 *         self._nbytes -= bsize
 *         # Flush last chunk and update counters on-disk
 *         self.flush()             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, object nitems):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __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":1458
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1526
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("resize", 0);

  /* "bcolz/carray_ext.pyx":1540
 *         cdef object chunk
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):             # <<<<<<<<<<<<<<
 *             raise TypeError("`nitems` must be an integer")
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __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":1541
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):
 *             raise TypeError("`nitems` must be an integer")             # <<<<<<<<<<<<<<
 * 
 *         if nitems == self.len:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1540
 *         cdef object chunk
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):             # <<<<<<<<<<<<<<
 *             raise TypeError("`nitems` must be an integer")
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1543
 *             raise TypeError("`nitems` must be an integer")
 * 
 *         if nitems == self.len:             # <<<<<<<<<<<<<<
 *             return
 *         elif nitems < 0:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1544
 * 
 *         if nitems == self.len:
 *             return             # <<<<<<<<<<<<<<
 *         elif nitems < 0:
 *             raise ValueError("`nitems` cannot be negative")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1543
 *             raise TypeError("`nitems` must be an integer")
 * 
 *         if nitems == self.len:             # <<<<<<<<<<<<<<
 *             return
 *         elif nitems < 0:
 */
  }

  /* "bcolz/carray_ext.pyx":1545
 *         if nitems == self.len:
 *             return
 *         elif nitems < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("`nitems` cannot be negative")
 * 
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_nitems, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1546
 *             return
 *         elif nitems < 0:
 *             raise ValueError("`nitems` cannot be negative")             # <<<<<<<<<<<<<<
 * 
 *         if nitems > self.len:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1545
 *         if nitems == self.len:
 *             return
 *         elif nitems < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("`nitems` cannot be negative")
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1548
 *             raise ValueError("`nitems` cannot be negative")
 * 
 *         if nitems > self.len:             # <<<<<<<<<<<<<<
 *             # Create a 0-strided array and append it to self
 *             chunk = np.ndarray(nitems - self.len, dtype=self._dtype,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "bcolz/carray_ext.pyx":1550
 *         if nitems > self.len:
 *             # Create a 0-strided array and append it to self
 *             chunk = np.ndarray(nitems - self.len, dtype=self._dtype,             # <<<<<<<<<<<<<<
 *                                buffer=self._dflt, strides=(0,))
 *             self.append(chunk)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Subtract(__pyx_v_nitems, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1551
 *             # Create a 0-strided array and append it to self
 *             chunk = np.ndarray(nitems - self.len, dtype=self._dtype,
 *                                buffer=self._dflt, strides=(0,))             # <<<<<<<<<<<<<<
 *             self.append(chunk)
 *             self.flush()
 */
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_buffer, __pyx_v_self->_dflt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_strides, __pyx_tuple__54) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1550
 *         if nitems > self.len:
 *             # Create a 0-strided array and append it to self
 *             chunk = np.ndarray(nitems - self.len, dtype=self._dtype,             # <<<<<<<<<<<<<<
 *                                buffer=self._dflt, strides=(0,))
 *             self.append(chunk)
 */
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_ndarray), __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __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_v_chunk = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1552
 *             chunk = np.ndarray(nitems - self.len, dtype=self._dtype,
 *                                buffer=self._dflt, strides=(0,))
 *             self.append(chunk)             # <<<<<<<<<<<<<<
 *             self.flush()
 *         else:
 */
    __pyx_t_6 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self), __pyx_v_chunk); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1553
 *                                buffer=self._dflt, strides=(0,))
 *             self.append(chunk)
 *             self.flush()             # <<<<<<<<<<<<<<
 *         else:
 *             # Just trim the excess of items
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1548
 *             raise ValueError("`nitems` cannot be negative")
 * 
 *         if nitems > self.len:             # <<<<<<<<<<<<<<
 *             # Create a 0-strided array and append it to self
 *             chunk = np.ndarray(nitems - self.len, dtype=self._dtype,
 */
    goto __pyx_L5;
  }

  /* "bcolz/carray_ext.pyx":1556
 *         else:
 *             # Just trim the excess of items
 *             self.trim(self.len - nitems)             # <<<<<<<<<<<<<<
 * 
 *     def reshape(self, newshape):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_v_nitems); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_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_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_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __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_7);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L5:;

  /* "bcolz/carray_ext.pyx":1526
 *         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_7);
  __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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1558
 *             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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reshape", 0);
  __Pyx_INCREF(__pyx_v_newshape);

  /* "bcolz/carray_ext.pyx":1579
 * 
 *         # Enforce newshape as tuple
 *         if isinstance(newshape, _inttypes):             # <<<<<<<<<<<<<<
 *             newshape = (newshape,)
 *         newsize = np.prod(newshape)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __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":1580
 *         # Enforce newshape as tuple
 *         if isinstance(newshape, _inttypes):
 *             newshape = (newshape,)             # <<<<<<<<<<<<<<
 *         newsize = np.prod(newshape)
 * 
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __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":1579
 * 
 *         # Enforce newshape as tuple
 *         if isinstance(newshape, _inttypes):             # <<<<<<<<<<<<<<
 *             newshape = (newshape,)
 *         newsize = np.prod(newshape)
 */
  }

  /* "bcolz/carray_ext.pyx":1581
 *         if isinstance(newshape, _inttypes):
 *             newshape = (newshape,)
 *         newsize = np.prod(newshape)             # <<<<<<<<<<<<<<
 * 
 *         ishape = self.shape
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_newsize = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1583
 *         newsize = np.prod(newshape)
 * 
 *         ishape = self.shape             # <<<<<<<<<<<<<<
 *         ilen = ishape[0]
 *         isize = np.prod(ishape)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ishape = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1584
 * 
 *         ishape = self.shape
 *         ilen = ishape[0]             # <<<<<<<<<<<<<<
 *         isize = np.prod(ishape)
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ishape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ilen = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1585
 *         ishape = self.shape
 *         ilen = ishape[0]
 *         isize = np.prod(ishape)             # <<<<<<<<<<<<<<
 * 
 *         # Check for -1 in newshape
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_isize = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1588
 * 
 *         # Check for -1 in newshape
 *         if -1 in newshape:             # <<<<<<<<<<<<<<
 *             if newshape.count(-1) > 1:
 *                 raise ValueError("only one shape dimension can be -1")
 */
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_int_neg_1, __pyx_v_newshape, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1589
 *         # 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newshape, __pyx_n_s_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1590
 *         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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1589
 *         # 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":1591
 *             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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newshape, __pyx_n_s_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __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":1592
 *                 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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_osize = __pyx_t_7;

    /* "bcolz/carray_ext.pyx":1593
 *             pos = newshape.index(-1)
 *             osize = np.prod(newshape[:pos] + newshape[pos + 1:])
 *             if isize == 0:             # <<<<<<<<<<<<<<
 *                 newshape = newshape[:pos] + (0,) + newshape[pos + 1:]
 *             else:
 */
    __pyx_t_2 = ((__pyx_v_isize == 0) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1594
 *             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_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_newshape, 0, 0, NULL, &__pyx_v_pos, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_tuple__58); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __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":1593
 *             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":1596
 *                 newshape = newshape[:pos] + (0,) + newshape[pos + 1:]
 *             else:
 *                 newshape = newshape[:pos] + (isize / osize,) + newshape[             # <<<<<<<<<<<<<<
 *                                                                pos + 1:]
 *             newsize = np.prod(newshape)
 */
    /*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_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __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":1597
 *             else:
 *                 newshape = newshape[:pos] + (isize / osize,) + newshape[
 *                                                                pos + 1:]             # <<<<<<<<<<<<<<
 *             newsize = np.prod(newshape)
 * 
 */
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_pos, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);

      /* "bcolz/carray_ext.pyx":1596
 *                 newshape = newshape[:pos] + (0,) + newshape[pos + 1:]
 *             else:
 *                 newshape = newshape[:pos] + (isize / osize,) + newshape[             # <<<<<<<<<<<<<<
 *                                                                pos + 1:]
 *             newsize = np.prod(newshape)
 */
      __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_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __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":1598
 *                 newshape = newshape[:pos] + (isize / osize,) + newshape[
 *                                                                pos + 1:]
 *             newsize = np.prod(newshape)             # <<<<<<<<<<<<<<
 * 
 *         # Check shape compatibility
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_newsize = __pyx_t_7;

    /* "bcolz/carray_ext.pyx":1588
 * 
 *         # 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":1601
 * 
 *         # Check shape compatibility
 *         if isize != newsize:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "`newshape` is not compatible with the current one")
 */
  __pyx_t_2 = ((__pyx_v_isize != __pyx_v_newsize) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1602
 *         # Check shape compatibility
 *         if isize != newsize:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "`newshape` is not compatible with the current one")
 *         # Create the output container
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1601
 * 
 *         # Check shape compatibility
 *         if isize != newsize:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "`newshape` is not compatible with the current one")
 */
  }

  /* "bcolz/carray_ext.pyx":1605
 *                 "`newshape` is not compatible with the current one")
 *         # Create the output container
 *         newdtype = np.dtype((self._dtype.base, newshape[1:]))             # <<<<<<<<<<<<<<
 *         newlen = newshape[0]
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_newshape, 1, 0, NULL, NULL, &__pyx_slice__60, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __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":1606
 *         # 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_t_5 = __Pyx_GetItemInt(__pyx_v_newshape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_newlen = __pyx_t_7;

  /* "bcolz/carray_ext.pyx":1610
 *         # 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_t_9 = PyObject_Length(__pyx_v_ishape); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1610; __pyx_clineno = __LINE__; goto __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":1611
 *         # 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_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __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":1612
 *         if len(ishape) > 1 and len(newshape) > 1:
 *             out = self.reshape(-1)
 *             return out.reshape(newshape)             # <<<<<<<<<<<<<<
 * 
 *         if self._rootdir:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __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":1610
 *         # 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":1614
 *             return out.reshape(newshape)
 * 
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             # If persistent, do the copy to a temporary dir
 *             absdir = os.path.dirname(self._rootdir)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_rootdir); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1616
 *         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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __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":1617
 *             # 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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tempfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_suffix, __pyx_n_s_temp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dir, __pyx_v_absdir) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __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":1614
 *             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":1619
 *             rootdir = tempfile.mkdtemp(suffix='__temp__', dir=absdir)
 *         else:
 *             rootdir = None             # <<<<<<<<<<<<<<
 * 
 *         # Create the final container and fill it
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_rootdir = Py_None;
  }
  __pyx_L11:;

  /* "bcolz/carray_ext.pyx":1622
 * 
 *         # Create the final container and fill it
 *         out = carray([], dtype=newdtype, cparams=self.cparams,             # <<<<<<<<<<<<<<
 *                        expectedlen=newlen,
 *                        rootdir=rootdir, mode='w')
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_v_newdtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cparams, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":1623
 *         # Create the final container and fill it
 *         out = carray([], dtype=newdtype, cparams=self.cparams,
 *                        expectedlen=newlen,             # <<<<<<<<<<<<<<
 *                        rootdir=rootdir, mode='w')
 *         if newlen < ilen:
 */
  __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_newlen); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_expectedlen, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":1624
 *         out = carray([], dtype=newdtype, cparams=self.cparams,
 *                        expectedlen=newlen,
 *                        rootdir=rootdir, mode='w')             # <<<<<<<<<<<<<<
 *         if newlen < ilen:
 *             rsize = isize / newlen
 */
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_rootdir, __pyx_v_rootdir) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mode, __pyx_n_s_w) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":1622
 * 
 *         # Create the final container and fill it
 *         out = carray([], dtype=newdtype, cparams=self.cparams,             # <<<<<<<<<<<<<<
 *                        expectedlen=newlen,
 *                        rootdir=rootdir, mode='w')
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __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":1625
 *                        expectedlen=newlen,
 *                        rootdir=rootdir, mode='w')
 *         if newlen < ilen:             # <<<<<<<<<<<<<<
 *             rsize = isize / newlen
 *             for i from 0 <= i < newlen:
 */
  __pyx_t_2 = ((__pyx_v_newlen < __pyx_v_ilen) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1626
 *                        rootdir=rootdir, mode='w')
 *         if newlen < ilen:
 *             rsize = isize / newlen             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < newlen:
 *                 out.append(
 */
    if (unlikely(__pyx_v_newlen == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_rsize = __Pyx_div_npy_intp(__pyx_v_isize, __pyx_v_newlen);

    /* "bcolz/carray_ext.pyx":1627
 *         if newlen < ilen:
 *             rsize = isize / newlen
 *             for i from 0 <= i < newlen:             # <<<<<<<<<<<<<<
 *                 out.append(
 *                     self[i * rsize:(i + 1) * rsize].reshape(newdtype.shape))
 */
    __pyx_t_7 = __pyx_v_newlen;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

      /* "bcolz/carray_ext.pyx":1629
 *             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_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_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __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":1628
 *             rsize = isize / newlen
 *             for i from 0 <= i < newlen:
 *                 out.append(             # <<<<<<<<<<<<<<
 *                     self[i * rsize:(i + 1) * rsize].reshape(newdtype.shape))
 *         else:
 */
      __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_out, __pyx_t_5); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }

    /* "bcolz/carray_ext.pyx":1625
 *                        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":1631
 *                     self[i * rsize:(i + 1) * rsize].reshape(newdtype.shape))
 *         else:
 *             for i from 0 <= i < ilen:             # <<<<<<<<<<<<<<
 *                 out.append(self[i].reshape(-1))
 *         out.flush()
 */
  /*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":1632
 *         else:
 *             for i from 0 <= i < ilen:
 *                 out.append(self[i].reshape(-1))             # <<<<<<<<<<<<<<
 *         out.flush()
 * 
 */
      __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __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__62, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __pyx_L12:;

  /* "bcolz/carray_ext.pyx":1633
 *             for i from 0 <= i < ilen:
 *                 out.append(self[i].reshape(-1))
 *         out.flush()             # <<<<<<<<<<<<<<
 * 
 *         # Finally, rename the temporary data directory to self._rootdir
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_flush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __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":1636
 * 
 *         # Finally, rename the temporary data directory to self._rootdir
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             shutil.rmtree(self._rootdir)
 *             os.rename(rootdir, self._rootdir)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_rootdir); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1637
 *         # 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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_shutil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1638
 *         if self._rootdir:
 *             shutil.rmtree(self._rootdir)
 *             os.rename(rootdir, self._rootdir)             # <<<<<<<<<<<<<<
 *             # Restore the rootdir and mode
 *             out.rootdir = self._rootdir
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __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":1640
 *             os.rename(rootdir, self._rootdir)
 *             # Restore the rootdir and mode
 *             out.rootdir = self._rootdir             # <<<<<<<<<<<<<<
 *             out.mode = self._mode
 * 
 */
    __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_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1641
 *             # Restore the rootdir and mode
 *             out.rootdir = self._rootdir
 *             out.mode = self._mode             # <<<<<<<<<<<<<<
 * 
 *         return out
 */
    __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_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "bcolz/carray_ext.pyx":1636
 * 
 *         # 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":1643
 *             out.mode = self._mode
 * 
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def copy(self, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1558
 *             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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1645
 *         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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "bcolz/carray_ext.pyx":1662
 * 
 *         # Get defaults for some parameters
 *         expectedlen = kwargs.pop('expectedlen', self.len)             # <<<<<<<<<<<<<<
 * 
 *         # Create a new, empty carray
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __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":1665
 * 
 *         # Create a new, empty carray
 *         ccopy = carray(np.empty(0, dtype=self._dtype),             # <<<<<<<<<<<<<<
 *                        expectedlen=expectedlen,
 *                        **kwargs)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__63, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __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":1666
 *         # Create a new, empty carray
 *         ccopy = carray(np.empty(0, dtype=self._dtype),
 *                        expectedlen=expectedlen,             # <<<<<<<<<<<<<<
 *                        **kwargs)
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_expectedlen, __pyx_v_expectedlen) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1667
 *         ccopy = carray(np.empty(0, dtype=self._dtype),
 *                        expectedlen=expectedlen,
 *                        **kwargs)             # <<<<<<<<<<<<<<
 * 
 *         # Now copy the carray chunk by chunk
 */
  if (__Pyx_MergeKeywords(__pyx_t_6, __pyx_v_kwargs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":1665
 * 
 *         # Create a new, empty carray
 *         ccopy = carray(np.empty(0, dtype=self._dtype),             # <<<<<<<<<<<<<<
 *                        expectedlen=expectedlen,
 *                        **kwargs)
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_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":1670
 * 
 *         # 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_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_chunklen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_chunklen = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":1671
 *         # 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_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __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":1672
 *         chunklen = self._chunklen
 *         for i from 0 <= i < self.len by chunklen:
 *             ccopy.append(self[i:i + chunklen])             # <<<<<<<<<<<<<<
 *         ccopy.flush()
 * 
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_i, __pyx_v_chunklen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "bcolz/carray_ext.pyx":1671
 *         # 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_t_6 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __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":1673
 *         for i from 0 <= i < self.len by chunklen:
 *             ccopy.append(self[i:i + chunklen])
 *         ccopy.flush()             # <<<<<<<<<<<<<<
 * 
 *         return ccopy
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ccopy), __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __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":1675
 *         ccopy.flush()
 * 
 *         return ccopy             # <<<<<<<<<<<<<<
 * 
 *     def view(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ccopy));
  __pyx_r = ((PyObject *)__pyx_v_ccopy);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1645
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1677
 *         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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("view", 0);

  /* "bcolz/carray_ext.pyx":1691
 *         """
 *         # 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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__64, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __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":1693
 *         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_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "bcolz/carray_ext.pyx":1694
 *         # 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_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->expectedlen); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);

  /* "bcolz/carray_ext.pyx":1693
 *         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_t_8 = PyTuple_New(7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __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":1695
 *         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_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cview), __pyx_n_s_open_carray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __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":1696
 *                      self.expectedlen, self.cbytes, self.chunklen)
 *         cview._open_carray(*meta_info, xchunks=(self.chunks, self.lastchunkarr))
 *         return cview             # <<<<<<<<<<<<<<
 * 
 *     def sum(self, dtype=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_cview));
  __pyx_r = ((PyObject *)__pyx_v_cview);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1677
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1698
 *         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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_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_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sum", 0);
  __Pyx_INCREF(__pyx_v_dtype);

  /* "bcolz/carray_ext.pyx":1720
 *         cdef object result
 * 
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             dtype = self._dtype.base
 *             # Check if we have less precision than required for ints
 */
  __pyx_t_1 = (__pyx_v_dtype == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1721
 * 
 *         if dtype is None:
 *             dtype = self._dtype.base             # <<<<<<<<<<<<<<
 *             # Check if we have less precision than required for ints
 *             # (mimick NumPy logic)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __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":1724
 *             # 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_IntType); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __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":1725
 *             # (mimick NumPy logic)
 *             if dtype.kind in ('b', 'i') and dtype.itemsize < IntType.itemsize:
 *                 dtype = IntType             # <<<<<<<<<<<<<<
 *         else:
 *             dtype = np.dtype(dtype)
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_IntType); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __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":1724
 *             # 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":1720
 *         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":1727
 *                 dtype = IntType
 *         else:
 *             dtype = np.dtype(dtype)             # <<<<<<<<<<<<<<
 *         if dtype.kind == 'S':
 *             raise TypeError("cannot perform reduce with flexible type")
 */
  /*else*/ {
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __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":1728
 *         else:
 *             dtype = np.dtype(dtype)
 *         if dtype.kind == 'S':             # <<<<<<<<<<<<<<
 *             raise TypeError("cannot perform reduce with flexible type")
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1729
 *             dtype = np.dtype(dtype)
 *         if dtype.kind == 'S':
 *             raise TypeError("cannot perform reduce with flexible type")             # <<<<<<<<<<<<<<
 * 
 *         # Get a container for the result
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1728
 *         else:
 *             dtype = np.dtype(dtype)
 *         if dtype.kind == 'S':             # <<<<<<<<<<<<<<
 *             raise TypeError("cannot perform reduce with flexible type")
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1732
 * 
 *         # Get a container for the result
 *         result = np.zeros(1, dtype=dtype)[0]             # <<<<<<<<<<<<<<
 * 
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_v_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__66, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __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":1734
 *         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_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":1735
 * 
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         for chunk_ in self.chunks:             # <<<<<<<<<<<<<<
 *             if chunk_.isconstant:
 *                 result += chunk_.constant * self._chunklen
 */
  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_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __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":1736
 *         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_t_2 = (__pyx_v_chunk_->isconstant != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1737
 *         for chunk_ in self.chunks:
 *             if chunk_.isconstant:
 *                 result += chunk_.constant * self._chunklen             # <<<<<<<<<<<<<<
 *             elif self._dtype.type == np.bool_:
 *                 result += chunk_.true_count
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->_chunklen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __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":1736
 *         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":1738
 *             if chunk_.isconstant:
 *                 result += chunk_.constant * self._chunklen
 *             elif self._dtype.type == np.bool_:             # <<<<<<<<<<<<<<
 *                 result += chunk_.true_count
 *             else:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":1739
 *                 result += chunk_.constant * self._chunklen
 *             elif self._dtype.type == np.bool_:
 *                 result += chunk_.true_count             # <<<<<<<<<<<<<<
 *             else:
 *                 result += chunk_[:].sum(dtype=dtype)
 */
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_chunk_->true_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __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":1738
 *             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":1741
 *                 result += chunk_.true_count
 *             else:
 *                 result += chunk_[:].sum(dtype=dtype)             # <<<<<<<<<<<<<<
 *         if self.leftover:
 *             leftover = self.len - nchunks * self._chunklen
 */
    /*else*/ {
      __pyx_t_9 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_chunk_), 0, 0, NULL, NULL, &__pyx_slice__67, 0, 0, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_v_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __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":1735
 * 
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         for chunk_ in self.chunks:             # <<<<<<<<<<<<<<
 *             if chunk_.isconstant:
 *                 result += chunk_.constant * self._chunklen
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "bcolz/carray_ext.pyx":1742
 *             else:
 *                 result += chunk_[:].sum(dtype=dtype)
 *         if self.leftover:             # <<<<<<<<<<<<<<
 *             leftover = self.len - nchunks * self._chunklen
 *             result += self.lastchunkarr[:leftover].sum(dtype=dtype)
 */
  __pyx_t_2 = (__pyx_v_self->leftover != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1743
 *                 result += chunk_[:].sum(dtype=dtype)
 *         if self.leftover:
 *             leftover = self.len - nchunks * self._chunklen             # <<<<<<<<<<<<<<
 *             result += self.lastchunkarr[:leftover].sum(dtype=dtype)
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1743; __pyx_clineno = __LINE__; goto __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":1744
 *         if self.leftover:
 *             leftover = self.len - nchunks * self._chunklen
 *             result += self.lastchunkarr[:leftover].sum(dtype=dtype)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __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_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_v_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __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":1742
 *             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":1746
 *             result += self.lastchunkarr[:leftover].sum(dtype=dtype)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1698
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1748
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "bcolz/carray_ext.pyx":1749
 * 
 *     def __len__(self):
 *         return self.len             # <<<<<<<<<<<<<<
 * 
 *     def __sizeof__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1748
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1751
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__sizeof__", 0);

  /* "bcolz/carray_ext.pyx":1752
 * 
 *     def __sizeof__(self):
 *         return self._cbytes             # <<<<<<<<<<<<<<
 * 
 *     cdef int getitem_cache(self, npy_intp pos, char *dest):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_cbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1751
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1754
 *         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_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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getitem_cache", 0);

  /* "bcolz/carray_ext.pyx":1774
 *         cdef chunk chunk_
 * 
 *         atomsize = self.atomsize             # <<<<<<<<<<<<<<
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         chunklen = self._chunklen
 */
  __pyx_t_1 = __pyx_v_self->atomsize;
  __pyx_v_atomsize = __pyx_t_1;

  /* "bcolz/carray_ext.pyx":1775
 * 
 *         atomsize = self.atomsize
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         chunklen = self._chunklen
 *         nchunk = <npy_intp> cython.cdiv(pos, chunklen)
 */
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":1776
 *         atomsize = self.atomsize
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         chunklen = self._chunklen             # <<<<<<<<<<<<<<
 *         nchunk = <npy_intp> cython.cdiv(pos, chunklen)
 * 
 */
  __pyx_t_1 = __pyx_v_self->_chunklen;
  __pyx_v_chunklen = __pyx_t_1;

  /* "bcolz/carray_ext.pyx":1777
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         chunklen = self._chunklen
 *         nchunk = <npy_intp> cython.cdiv(pos, chunklen)             # <<<<<<<<<<<<<<
 * 
 *         # Check whether pos is in the last chunk
 */
  __pyx_v_nchunk = ((npy_intp)(__pyx_v_pos / __pyx_v_chunklen));

  /* "bcolz/carray_ext.pyx":1780
 * 
 *         # 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_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":1781
 *         # 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
 */
    if (unlikely(__pyx_v_chunklen == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_posinbytes = (__Pyx_mod_npy_intp(__pyx_v_pos, __pyx_v_chunklen) * __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":1782
 *         if nchunk == nchunks and self.leftover:
 *             posinbytes = (pos % chunklen) * atomsize
 *             memcpy(dest, self.lastchunk + posinbytes, atomsize)             # <<<<<<<<<<<<<<
 *             return 1
 * 
 */
    memcpy(__pyx_v_dest, (__pyx_v_self->lastchunk + __pyx_v_posinbytes), __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":1783
 *             posinbytes = (pos % chunklen) * atomsize
 *             memcpy(dest, self.lastchunk + posinbytes, atomsize)
 *             return 1             # <<<<<<<<<<<<<<
 * 
 *         # Locate the *block* inside the chunk
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1780
 * 
 *         # 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":1786
 * 
 *         # Locate the *block* inside the chunk
 *         chunk_ = self.chunks[nchunk]             # <<<<<<<<<<<<<<
 *         blocksize = chunk_.blocksize
 *         blocklen = <npy_intp> cython.cdiv(blocksize, atomsize)
 */
  __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5bcolz_10carray_ext_chunk))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_chunk_ = ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "bcolz/carray_ext.pyx":1787
 *         # Locate the *block* inside the chunk
 *         chunk_ = self.chunks[nchunk]
 *         blocksize = chunk_.blocksize             # <<<<<<<<<<<<<<
 *         blocklen = <npy_intp> cython.cdiv(blocksize, atomsize)
 * 
 */
  __pyx_t_1 = __pyx_v_chunk_->blocksize;
  __pyx_v_blocksize = __pyx_t_1;

  /* "bcolz/carray_ext.pyx":1788
 *         chunk_ = self.chunks[nchunk]
 *         blocksize = chunk_.blocksize
 *         blocklen = <npy_intp> cython.cdiv(blocksize, atomsize)             # <<<<<<<<<<<<<<
 * 
 *         if (atomsize > blocksize):
 */
  __pyx_v_blocklen = ((npy_intp)(__pyx_v_blocksize / __pyx_v_atomsize));

  /* "bcolz/carray_ext.pyx":1790
 *         blocklen = <npy_intp> cython.cdiv(blocksize, atomsize)
 * 
 *         if (atomsize > blocksize):             # <<<<<<<<<<<<<<
 *             # This request cannot be resolved here
 *             return 0
 */
  __pyx_t_2 = ((__pyx_v_atomsize > __pyx_v_blocksize) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1792
 *         if (atomsize > blocksize):
 *             # This request cannot be resolved here
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *         # Check whether the cache block has to be initialized
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1790
 *         blocklen = <npy_intp> cython.cdiv(blocksize, atomsize)
 * 
 *         if (atomsize > blocksize):             # <<<<<<<<<<<<<<
 *             # This request cannot be resolved here
 *             return 0
 */
  }

  /* "bcolz/carray_ext.pyx":1795
 * 
 *         # 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_t_2 = ((__pyx_v_self->idxcache < 0) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1796
 *         # 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
 *             # We don't want this to contribute to cbytes counter!
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_blocklen); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __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":1797
 *         if self.idxcache < 0:
 *             self.blockcache = np.empty(shape=(blocklen,), dtype=self._dtype)
 *             self.datacache = self.blockcache.data             # <<<<<<<<<<<<<<
 *             # We don't want this to contribute to cbytes counter!
 *             # if self.idxcache == -1:
 */
    __pyx_t_8 = __pyx_v_self->blockcache->data;
    __pyx_v_self->datacache = __pyx_t_8;

    /* "bcolz/carray_ext.pyx":1795
 * 
 *         # 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":1804
 * 
 *         # Check if block is cached
 *         idxcache = <npy_intp> cython.cdiv(pos, blocklen) * blocklen             # <<<<<<<<<<<<<<
 *         if idxcache == self.idxcache:
 *             # Hit!
 */
  __pyx_v_idxcache = (((npy_intp)(__pyx_v_pos / __pyx_v_blocklen)) * __pyx_v_blocklen);

  /* "bcolz/carray_ext.pyx":1805
 *         # Check if block is cached
 *         idxcache = <npy_intp> cython.cdiv(pos, blocklen) * blocklen
 *         if idxcache == self.idxcache:             # <<<<<<<<<<<<<<
 *             # Hit!
 *             posinbytes = (pos % blocklen) * atomsize
 */
  __pyx_t_2 = ((__pyx_v_idxcache == __pyx_v_self->idxcache) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":1807
 *         if idxcache == self.idxcache:
 *             # Hit!
 *             posinbytes = (pos % blocklen) * atomsize             # <<<<<<<<<<<<<<
 *             memcpy(dest, self.datacache + posinbytes, atomsize)
 *             return 1
 */
    if (unlikely(__pyx_v_blocklen == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_posinbytes = (__Pyx_mod_npy_intp(__pyx_v_pos, __pyx_v_blocklen) * __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":1808
 *             # Hit!
 *             posinbytes = (pos % blocklen) * atomsize
 *             memcpy(dest, self.datacache + posinbytes, atomsize)             # <<<<<<<<<<<<<<
 *             return 1
 * 
 */
    memcpy(__pyx_v_dest, (__pyx_v_self->datacache + __pyx_v_posinbytes), __pyx_v_atomsize);

    /* "bcolz/carray_ext.pyx":1809
 *             posinbytes = (pos % blocklen) * atomsize
 *             memcpy(dest, self.datacache + posinbytes, atomsize)
 *             return 1             # <<<<<<<<<<<<<<
 * 
 *         # No luck. Read a complete block.
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1805
 *         # Check if block is cached
 *         idxcache = <npy_intp> cython.cdiv(pos, blocklen) * blocklen
 *         if idxcache == self.idxcache:             # <<<<<<<<<<<<<<
 *             # Hit!
 *             posinbytes = (pos % blocklen) * atomsize
 */
  }

  /* "bcolz/carray_ext.pyx":1812
 * 
 *         # No luck. Read a complete block.
 *         offset = idxcache % chunklen             # <<<<<<<<<<<<<<
 *         chunk_._getitem(offset, offset + blocklen, self.datacache)
 *         # Copy the interesting bits to dest
 */
  if (unlikely(__pyx_v_chunklen == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_offset = __Pyx_mod_npy_intp(__pyx_v_idxcache, __pyx_v_chunklen);

  /* "bcolz/carray_ext.pyx":1813
 *         # No luck. Read a complete block.
 *         offset = idxcache % chunklen
 *         chunk_._getitem(offset, offset + blocklen, self.datacache)             # <<<<<<<<<<<<<<
 *         # Copy the interesting bits to dest
 *         posinbytes = (pos % blocklen) * atomsize
 */
  ((struct __pyx_vtabstruct_5bcolz_10carray_ext_chunk *)__pyx_v_chunk_->__pyx_vtab)->_getitem(__pyx_v_chunk_, __pyx_v_offset, (__pyx_v_offset + __pyx_v_blocklen), __pyx_v_self->datacache);

  /* "bcolz/carray_ext.pyx":1815
 *         chunk_._getitem(offset, offset + blocklen, self.datacache)
 *         # Copy the interesting bits to dest
 *         posinbytes = (pos % blocklen) * atomsize             # <<<<<<<<<<<<<<
 *         memcpy(dest, self.datacache + posinbytes, atomsize)
 *         # Update the cache index
 */
  if (unlikely(__pyx_v_blocklen == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_posinbytes = (__Pyx_mod_npy_intp(__pyx_v_pos, __pyx_v_blocklen) * __pyx_v_atomsize);

  /* "bcolz/carray_ext.pyx":1816
 *         # Copy the interesting bits to dest
 *         posinbytes = (pos % blocklen) * atomsize
 *         memcpy(dest, self.datacache + posinbytes, atomsize)             # <<<<<<<<<<<<<<
 *         # Update the cache index
 *         self.idxcache = idxcache
 */
  memcpy(__pyx_v_dest, (__pyx_v_self->datacache + __pyx_v_posinbytes), __pyx_v_atomsize);

  /* "bcolz/carray_ext.pyx":1818
 *         memcpy(dest, self.datacache + posinbytes, atomsize)
 *         # Update the cache index
 *         self.idxcache = idxcache             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */
  __pyx_v_self->idxcache = __pyx_v_idxcache;

  /* "bcolz/carray_ext.pyx":1819
 *         # Update the cache index
 *         self.idxcache = idxcache
 *         return 1             # <<<<<<<<<<<<<<
 * 
 *     def free_cachemem(self):
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1754
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1821
 *         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_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("free_cachemem", 0);

  /* "bcolz/carray_ext.pyx":1823
 *     def free_cachemem(self):
 *         """Release in-memory cached chunk"""
 *         if type(self.chunks) is not list:             # <<<<<<<<<<<<<<
 *             self.chunks.free_cachemem()
 *         self.idxcache = -1
 */
  __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":1824
 *         """Release in-memory cached chunk"""
 *         if type(self.chunks) is not list:
 *             self.chunks.free_cachemem()             # <<<<<<<<<<<<<<
 *         self.idxcache = -1
 *         self.blockcache = None
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->chunks, __pyx_n_s_free_cachemem); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bcolz/carray_ext.pyx":1823
 *     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":1825
 *         if type(self.chunks) is not list:
 *             self.chunks.free_cachemem()
 *         self.idxcache = -1             # <<<<<<<<<<<<<<
 *         self.blockcache = None
 * 
 */
  __pyx_v_self->idxcache = -1;

  /* "bcolz/carray_ext.pyx":1826
 *             self.chunks.free_cachemem()
 *         self.idxcache = -1
 *         self.blockcache = None             # <<<<<<<<<<<<<<
 * 
 *     def _getitem_object(self, start, stop=None, step=None):
 */
  __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":1821
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1828
 *         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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_filename = __pyx_f[0]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_filename = __pyx_f[0]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_getitem_object", 0);

  /* "bcolz/carray_ext.pyx":1830
 *     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_t_1 = __Pyx_Import(__pyx_n_s_pickle, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pickle = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1832
 *         import pickle
 * 
 *         if stop is None and step is None:             # <<<<<<<<<<<<<<
 *             # Integer
 *             cchunk = self.chunks[start]
 */
  __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":1834
 *         if stop is None and step is None:
 *             # Integer
 *             cchunk = self.chunks[start]             # <<<<<<<<<<<<<<
 *             chunk = cchunk.getudata()
 *             return pickle.loads(chunk)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_self->chunks, __pyx_v_start); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_cchunk = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":1835
 *             # Integer
 *             cchunk = self.chunks[start]
 *             chunk = cchunk.getudata()             # <<<<<<<<<<<<<<
 *             return pickle.loads(chunk)
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cchunk, __pyx_n_s_getudata); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __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":1836
 *             cchunk = self.chunks[start]
 *             chunk = cchunk.getudata()
 *             return pickle.loads(chunk)             # <<<<<<<<<<<<<<
 * 
 *         # Range
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pickle, __pyx_n_s_loads); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __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":1832
 *         import pickle
 * 
 *         if stop is None and step is None:             # <<<<<<<<<<<<<<
 *             # Integer
 *             cchunk = self.chunks[start]
 */
  }

  /* "bcolz/carray_ext.pyx":1839
 * 
 *         # Range
 *         objs = [self._getitem_object(i) for i in xrange(start, stop, step)]             # <<<<<<<<<<<<<<
 *         return np.array(objs, dtype=self._dtype)
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __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":1840
 *         # 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_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __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":1828
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":1842
 *         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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_INCREF(__pyx_v_key);

  /* "bcolz/carray_ext.pyx":1874
 *         cdef chunk _chunk
 * 
 *         chunklen = self._chunklen             # <<<<<<<<<<<<<<
 * 
 *         # Check for integer
 */
  __pyx_t_1 = __pyx_v_self->_chunklen;
  __pyx_v_chunklen = __pyx_t_1;

  /* "bcolz/carray_ext.pyx":1877
 * 
 *         # Check for integer
 *         if isinstance(key, _inttypes):             # <<<<<<<<<<<<<<
 *             if key < 0:
 *                 # To support negative values
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __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":1878
 *         # Check for integer
 *         if isinstance(key, _inttypes):
 *             if key < 0:             # <<<<<<<<<<<<<<
 *                 # To support negative values
 *                 key += self.len
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1880
 *             if key < 0:
 *                 # To support negative values
 *                 key += self.len             # <<<<<<<<<<<<<<
 *             if key >= self.len:
 *                 raise IndexError("index out of range")
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __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":1878
 *         # Check for integer
 *         if isinstance(key, _inttypes):
 *             if key < 0:             # <<<<<<<<<<<<<<
 *                 # To support negative values
 *                 key += self.len
 */
    }

    /* "bcolz/carray_ext.pyx":1881
 *                 # To support negative values
 *                 key += self.len
 *             if key >= self.len:             # <<<<<<<<<<<<<<
 *                 raise IndexError("index out of range")
 *             arr1 = self.arr1
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1882
 *                 key += self.len
 *             if key >= self.len:
 *                 raise IndexError("index out of range")             # <<<<<<<<<<<<<<
 *             arr1 = self.arr1
 *             if self.dtype.char == 'O':
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1881
 *                 # To support negative values
 *                 key += self.len
 *             if key >= self.len:             # <<<<<<<<<<<<<<
 *                 raise IndexError("index out of range")
 *             arr1 = self.arr1
 */
    }

    /* "bcolz/carray_ext.pyx":1883
 *             if key >= self.len:
 *                 raise IndexError("index out of range")
 *             arr1 = self.arr1             # <<<<<<<<<<<<<<
 *             if self.dtype.char == 'O':
 *                 return self._getitem_object(key)
 */
    if (!(likely(((__pyx_v_self->arr1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self->arr1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __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":1884
 *                 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_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1885
 *             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_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __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":1884
 *                 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":1886
 *             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_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_key); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __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":1887
 *                 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_t_4 = ((__pyx_v_self->itemsize == __pyx_v_self->atomsize) != 0);
      if (__pyx_t_4) {

        /* "bcolz/carray_ext.pyx":1888
 *             if self.getitem_cache(key, arr1.data):
 *                 if self.itemsize == self.atomsize:
 *                     return PyArray_GETITEM(arr1, arr1.data)             # <<<<<<<<<<<<<<
 *                 else:
 *                     return arr1[0].copy()
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = PyArray_GETITEM(__pyx_v_arr1, __pyx_v_arr1->data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;

        /* "bcolz/carray_ext.pyx":1887
 *                 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":1890
 *                     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)])
 */
      /*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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __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":1886
 *             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":1892
 *                     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_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __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":1877
 * 
 *         # Check for integer
 *         if isinstance(key, _inttypes):             # <<<<<<<<<<<<<<
 *             if key < 0:
 *                 # To support negative values
 */
  }

  /* "bcolz/carray_ext.pyx":1894
 *             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_t_4 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1895
 *         # 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __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":1896
 *         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_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_step); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __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":1897
 *             (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_t_9 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1896
 *         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":1894
 *             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":1899
 *                 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_t_3 = PyTuple_Check(__pyx_v_key); 
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":1900
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:
 */
    __pyx_t_10 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = ((__pyx_t_10 == 0) != 0);
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1901
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")             # <<<<<<<<<<<<<<
 *             elif len(key) == 1:
 *                 return self[key[0]]
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1900
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:
 */
    }

    /* "bcolz/carray_ext.pyx":1902
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:             # <<<<<<<<<<<<<<
 *                 return self[key[0]]
 *             # An n-dimensional slice
 */
    __pyx_t_10 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = ((__pyx_t_10 == 1) != 0);
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1903
 *                 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_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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __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":1902
 *             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":1906
 *             # 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_t_2 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __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":1908
 *             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_t_9 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1909
 *             # 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_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__73, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyNumber_Add(__pyx_tuple__72, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __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":1908
 *             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":1911
 *                 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:
 */
    /*else*/ {
      __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__74, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = PyObject_GetItem(__pyx_v_arr, __pyx_t_2); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __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":1913
 *                 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_flags); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __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":1914
 *             # 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_copy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __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":1913
 *                 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":1915
 *             if not arr.flags.contiguous:
 *                 arr = arr.copy()
 *             return arr             # <<<<<<<<<<<<<<
 *         # List of integers (case of fancy indexing)
 *         elif isinstance(key, list):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1899
 *                 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":1917
 *             return arr
 *         # List of integers (case of fancy indexing)
 *         elif isinstance(key, list):             # <<<<<<<<<<<<<<
 *             # Try to convert to a integer array
 *             try:
 */
  __pyx_t_3 = PyList_Check(__pyx_v_key); 
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":1919
 *         elif isinstance(key, list):
 *             # Try to convert to a integer array
 *             try:             # <<<<<<<<<<<<<<
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 */
    {
      __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":1920
 *             # Try to convert to a integer array
 *             try:
 *                 key = np.array(key, dtype=np.int_)             # <<<<<<<<<<<<<<
 *             except:
 *                 raise IndexError(
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __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":1919
 *         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_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":1921
 *             try:
 *                 key = np.array(key, dtype=np.int_)
 *             except:             # <<<<<<<<<<<<<<
 *                 raise IndexError(
 *                     "key cannot be converted to an array of indices")
 */
      /*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_filename = __pyx_f[0]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_2);

        /* "bcolz/carray_ext.pyx":1922
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "key cannot be converted to an array of indices")
 *             return self[key]
 */
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
      }
      __pyx_L17_except_error:;

      /* "bcolz/carray_ext.pyx":1919
 *         elif isinstance(key, list):
 *             # Try to convert to a integer array
 *             try:             # <<<<<<<<<<<<<<
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 */
      __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":1924
 *                 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_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1917
 *             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":1926
 *             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_t_4 = PyObject_HasAttr(__pyx_v_key, __pyx_n_s_dtype); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1927
 *         # 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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":1929
 *             if key.dtype.type == np.bool_:
 *                 # A boolean array
 *                 if len(key) != self.len:             # <<<<<<<<<<<<<<
 *                     raise IndexError(
 *                         "boolean array length must match len(self)")
 */
      __pyx_t_10 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_3) {

        /* "bcolz/carray_ext.pyx":1930
 *                 # A boolean array
 *                 if len(key) != self.len:
 *                     raise IndexError(             # <<<<<<<<<<<<<<
 *                         "boolean array length must match len(self)")
 *                 if isinstance(key, carray):
 */
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "bcolz/carray_ext.pyx":1929
 *             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":1932
 *                     raise IndexError(
 *                         "boolean array length must match len(self)")
 *                 if isinstance(key, carray):             # <<<<<<<<<<<<<<
 *                     count = key.sum()
 *                 else:
 */
      __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":1933
 *                         "boolean array length must match len(self)")
 *                 if isinstance(key, carray):
 *                     count = key.sum()             # <<<<<<<<<<<<<<
 *                 else:
 *                     count = -1
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_sum); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __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":1932
 *                     raise IndexError(
 *                         "boolean array length must match len(self)")
 *                 if isinstance(key, carray):             # <<<<<<<<<<<<<<
 *                     count = key.sum()
 *                 else:
 */
        goto __pyx_L27;
      }

      /* "bcolz/carray_ext.pyx":1935
 *                     count = key.sum()
 *                 else:
 *                     count = -1             # <<<<<<<<<<<<<<
 *                 return np.fromiter(self.where(key), dtype=self._dtype,
 *                                    count=count)
 */
      /*else*/ {
        __Pyx_INCREF(__pyx_int_neg_1);
        __pyx_v_count = __pyx_int_neg_1;
      }
      __pyx_L27:;

      /* "bcolz/carray_ext.pyx":1936
 *                 else:
 *                     count = -1
 *                 return np.fromiter(self.where(key), dtype=self._dtype,             # <<<<<<<<<<<<<<
 *                                    count=count)
 *             elif np.issubsctype(key, np.int_):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_fromiter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1937
 *                     count = -1
 *                 return np.fromiter(self.where(key), dtype=self._dtype,
 *                                    count=count)             # <<<<<<<<<<<<<<
 *             elif np.issubsctype(key, np.int_):
 *                 # An integer array
 */
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_count, __pyx_v_count) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1936
 *                 else:
 *                     count = -1
 *                 return np.fromiter(self.where(key), dtype=self._dtype,             # <<<<<<<<<<<<<<
 *                                    count=count)
 *             elif np.issubsctype(key, np.int_):
 */
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __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":1927
 *         # 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":1938
 *                 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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_issubsctype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":1940
 *             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_XDECREF(__pyx_r);
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __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":1938
 *                 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":1942
 *                 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)
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "bcolz/carray_ext.pyx":1926
 *             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":1945
 *                     "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_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":1947
 *         elif type(key) is str:
 *             # Evaluate
 *             result = bcolz.eval(key)             # <<<<<<<<<<<<<<
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_bcolz); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __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":1948
 *             # Evaluate
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:             # <<<<<<<<<<<<<<
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_9, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":1949
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")             # <<<<<<<<<<<<<<
 *             if len(result) != self.len:
 *                 raise IndexError(
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1948
 *             # 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":1950
 *             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_t_10 = PyObject_Length(__pyx_v_result); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":1951
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "boolean expression outcome must match len(self)")
 *             # Call __getitem__ again
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":1950
 *             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":1954
 *                     "boolean expression outcome must match len(self)")
 *             # Call __getitem__ again
 *             return self[result]             # <<<<<<<<<<<<<<
 *         # All the rest not implemented
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_result); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1945
 *                     "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":1957
 *         # 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
 */
  /*else*/ {
    __pyx_t_9 = PyObject_Repr(__pyx_v_key); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":1962
 * 
 *         # Get the corrected values for start, stop, step
 *         (start, stop, step) = slice(start, stop, step).indices(self.len)             # <<<<<<<<<<<<<<
 * 
 *         # Build a numpy container
 */
  __pyx_t_9 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __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":1965
 * 
 *         # Build a numpy container
 *         blen = get_len_of_range(start, stop, step)             # <<<<<<<<<<<<<<
 *         arr = np.empty(shape=(blen,), dtype=self._dtype)
 *         if blen == 0:
 */
  __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_start); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_blen = __pyx_t_17;

  /* "bcolz/carray_ext.pyx":1966
 *         # 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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __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":1967
 *         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_t_3 = ((__pyx_v_blen == 0) != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1969
 *         if blen == 0:
 *             # If empty, return immediately
 *             return arr             # <<<<<<<<<<<<<<
 * 
 *         if self.dtype.char == 'O':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_arr);
    __pyx_r = __pyx_v_arr;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":1967
 *         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":1971
 *             return arr
 * 
 *         if self.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *             return self._getitem_object(start, stop, step)
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1972
 * 
 *         if self.dtype.char == 'O':
 *             return self._getitem_object(start, stop, step)             # <<<<<<<<<<<<<<
 * 
 *         # Fill it from data in chunks
 */
    __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_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __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":1971
 *             return arr
 * 
 *         if self.dtype.char == 'O':             # <<<<<<<<<<<<<<
 *             return self._getitem_object(start, stop, step)
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":1975
 * 
 *         # Fill it from data in chunks
 *         nwrow = 0             # <<<<<<<<<<<<<<
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 *         if self.leftover > 0:
 */
  __pyx_v_nwrow = 0;

  /* "bcolz/carray_ext.pyx":1976
 *         # Fill it from data in chunks
 *         nwrow = 0
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         if self.leftover > 0:
 *             nchunks += 1
 */
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":1977
 *         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_t_3 = ((__pyx_v_self->leftover > 0) != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":1978
 *         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_v_nchunks = (__pyx_v_nchunks + 1);

    /* "bcolz/carray_ext.pyx":1977
 *         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":1979
 *         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_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunklen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __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":1980
 *             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_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunklen); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __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":1981
 *         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_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":1982
 *         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_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":1984
 *         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_t_17 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_start); if (unlikely((__pyx_t_17 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1985
 *             # Compute start & stop for each block
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 *                                              step)             # <<<<<<<<<<<<<<
 *             if blen == 0:
 *                 continue
 */
    __pyx_t_18 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_step); if (unlikely((__pyx_t_18 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":1984
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __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":1986
 *             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_t_3 = ((__pyx_v_blen == 0) != 0);
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":1987
 *                                              step)
 *             if blen == 0:
 *                 continue             # <<<<<<<<<<<<<<
 *             # Get the data chunk and assign it to result array
 *             if nchunk == nchunks - 1 and self.leftover:
 */
      goto __pyx_L37_continue;

      /* "bcolz/carray_ext.pyx":1986
 *             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":1989
 *                 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_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":1990
 *             # 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_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "bcolz/carray_ext.pyx":1989
 *                 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":1992
 *                 arr[nwrow:nwrow + blen] = self.lastchunkarr[startb:stopb:step]
 *             else:
 *                 if step > 1:             # <<<<<<<<<<<<<<
 *                     arr[nwrow:nwrow + blen] = self.chunks[nchunk][
 *                                               startb:stopb:step]
 */
    /*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_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_3) {

        /* "bcolz/carray_ext.pyx":1993
 *             else:
 *                 if step > 1:
 *                     arr[nwrow:nwrow + blen] = self.chunks[nchunk][             # <<<<<<<<<<<<<<
 *                                               startb:stopb:step]
 *                 else:
 */
        __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_9);

        /* "bcolz/carray_ext.pyx":1994
 *                 if step > 1:
 *                     arr[nwrow:nwrow + blen] = self.chunks[nchunk][
 *                                               startb:stopb:step]             # <<<<<<<<<<<<<<
 *                 else:
 *                     # no step, can store directly
 */
        __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);

        /* "bcolz/carray_ext.pyx":1993
 *             else:
 *                 if step > 1:
 *                     arr[nwrow:nwrow + blen] = self.chunks[nchunk][             # <<<<<<<<<<<<<<
 *                                               startb:stopb:step]
 *                 else:
 */
        __pyx_t_6 = PySlice_New(__pyx_t_5, __pyx_t_2, __pyx_v_step); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "bcolz/carray_ext.pyx":1992
 *                 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":1997
 *                 else:
 *                     # no step, can store directly
 *                     dest = arr[nwrow:nwrow + blen]             # <<<<<<<<<<<<<<
 *                     _chunk = self.chunks[nchunk]
 *                     _chunk._getitem(startb, stopb, dest.data)
 */
      /*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_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "bcolz/carray_ext.pyx":1998
 *                     # no step, can store directly
 *                     dest = arr[nwrow:nwrow + blen]
 *                     _chunk = self.chunks[nchunk]             # <<<<<<<<<<<<<<
 *                     _chunk._getitem(startb, stopb, dest.data)
 *             nwrow += blen
 */
        __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5bcolz_10carray_ext_chunk))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __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":1999
 *                     dest = arr[nwrow:nwrow + blen]
 *                     _chunk = self.chunks[nchunk]
 *                     _chunk._getitem(startb, stopb, dest.data)             # <<<<<<<<<<<<<<
 *             nwrow += blen
 * 
 */
        ((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":2000
 *                     _chunk = self.chunks[nchunk]
 *                     _chunk._getitem(startb, stopb, dest.data)
 *             nwrow += blen             # <<<<<<<<<<<<<<
 * 
 *         return arr
 */
    __pyx_v_nwrow = (__pyx_v_nwrow + __pyx_v_blen);
    __pyx_L37_continue:;
  }

  /* "bcolz/carray_ext.pyx":2002
 *             nwrow += blen
 * 
 *         return arr             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, object key, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_arr);
  __pyx_r = __pyx_v_arr;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":1842
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2004
 *         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_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 *);
  npy_intp __pyx_t_14;
  npy_intp __pyx_t_15;
  npy_intp __pyx_t_16;
  int __pyx_t_17;
  npy_intp __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_INCREF(__pyx_v_key);
  __Pyx_INCREF(__pyx_v_value);

  /* "bcolz/carray_ext.pyx":2032
 *         cdef object cdata, arr
 * 
 *         if self.mode == "r":             # <<<<<<<<<<<<<<
 *             raise IOError(
 *                 "cannot modify data because mode is '%s'" % self.mode)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2034
 *         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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_cannot_modify_data_because_mode, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2033
 * 
 *         if self.mode == "r":
 *             raise IOError(             # <<<<<<<<<<<<<<
 *                 "cannot modify data because mode is '%s'" % self.mode)
 * 
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2032
 *         cdef object cdata, arr
 * 
 *         if self.mode == "r":             # <<<<<<<<<<<<<<
 *             raise IOError(
 *                 "cannot modify data because mode is '%s'" % self.mode)
 */
  }

  /* "bcolz/carray_ext.pyx":2037
 * 
 *         # 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_t_2 = ((__pyx_v_self->idxcache >= 0) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2039
 *         if self.idxcache >= 0:
 *             # -2 means that cbytes counter has not to be changed
 *             self.idxcache = -2             # <<<<<<<<<<<<<<
 * 
 *         # Check for integer
 */
    __pyx_v_self->idxcache = -2;

    /* "bcolz/carray_ext.pyx":2037
 * 
 *         # 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":2042
 * 
 *         # Check for integer
 *         if isinstance(key, _inttypes):             # <<<<<<<<<<<<<<
 *             if key < 0:
 *                 # To support negative values
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_inttypes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __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":2043
 *         # Check for integer
 *         if isinstance(key, _inttypes):
 *             if key < 0:             # <<<<<<<<<<<<<<
 *                 # To support negative values
 *                 key += self.len
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_key, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2045
 *             if key < 0:
 *                 # To support negative values
 *                 key += self.len             # <<<<<<<<<<<<<<
 *             if key >= self.len:
 *                 raise IndexError("index out of range")
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __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":2043
 *         # Check for integer
 *         if isinstance(key, _inttypes):
 *             if key < 0:             # <<<<<<<<<<<<<<
 *                 # To support negative values
 *                 key += self.len
 */
    }

    /* "bcolz/carray_ext.pyx":2046
 *                 # 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2047
 *                 key += self.len
 *             if key >= self.len:
 *                 raise IndexError("index out of range")             # <<<<<<<<<<<<<<
 *             (start, stop, step) = key, key + 1, 1
 *         # Slices
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":2046
 *                 # 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":2048
 *             if key >= self.len:
 *                 raise IndexError("index out of range")
 *             (start, stop, step) = key, key + 1, 1             # <<<<<<<<<<<<<<
 *         # Slices
 *         elif isinstance(key, slice):
 */
    __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_filename = __pyx_f[0]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __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":2042
 * 
 *         # Check for integer
 *         if isinstance(key, _inttypes):             # <<<<<<<<<<<<<<
 *             if key < 0:
 *                 # To support negative values
 */
    goto __pyx_L5;
  }

  /* "bcolz/carray_ext.pyx":2050
 *             (start, stop, step) = key, key + 1, 1
 *         # Slices
 *         elif isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step:
 */
  __pyx_t_4 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_4 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2051
 *         # Slices
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step             # <<<<<<<<<<<<<<
 *             if step:
 *                 if step <= 0:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __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":2052
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step:             # <<<<<<<<<<<<<<
 *                 if step <= 0:
 *                     raise NotImplementedError(
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_step); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2053
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step:
 *                 if step <= 0:             # <<<<<<<<<<<<<<
 *                     raise NotImplementedError(
 *                         "step in slice can only be positive")
 */
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_step, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2054
 *             if step:
 *                 if step <= 0:
 *                     raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                         "step in slice can only be positive")
 *         # Multidimensional keys
 */
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "bcolz/carray_ext.pyx":2053
 *             (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":2052
 *         elif isinstance(key, slice):
 *             (start, stop, step) = key.start, key.stop, key.step
 *             if step:             # <<<<<<<<<<<<<<
 *                 if step <= 0:
 *                     raise NotImplementedError(
 */
    }

    /* "bcolz/carray_ext.pyx":2050
 *             (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":2057
 *                         "step in slice can only be positive")
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):             # <<<<<<<<<<<<<<
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_key); 
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2058
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = ((__pyx_t_6 == 0) != 0);
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2059
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")             # <<<<<<<<<<<<<<
 *             elif len(key) == 1:
 *                 self[key[0]] = value
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":2058
 *         # Multidimensional keys
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:
 */
    }

    /* "bcolz/carray_ext.pyx":2060
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:             # <<<<<<<<<<<<<<
 *                 self[key[0]] = value
 *                 return
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = ((__pyx_t_6 == 1) != 0);
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2061
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:
 *                 self[key[0]] = value             # <<<<<<<<<<<<<<
 *                 return
 *             # An n-dimensional slice
 */
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":2062
 *             elif len(key) == 1:
 *                 self[key[0]] = value
 *                 return             # <<<<<<<<<<<<<<
 *             # An n-dimensional slice
 *             # First, retrieve elements in the leading dimension
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":2060
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")
 *             elif len(key) == 1:             # <<<<<<<<<<<<<<
 *                 self[key[0]] = value
 *                 return
 */
    }

    /* "bcolz/carray_ext.pyx":2065
 *             # 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_t_3 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __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":2067
 *             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_t_1 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2068
 *             # 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_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__85, 1, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyNumber_Add(__pyx_tuple__84, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2067
 *             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":2070
 *                 arr[(slice(None),) + key[1:]] = value
 *             else:
 *                 arr[key[1:]] = value             # <<<<<<<<<<<<<<
 *             # Finally, update this superset of values in self
 *             self[key[0]] = arr
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__86, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(PyObject_SetItem(__pyx_v_arr, __pyx_t_1, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L11:;

    /* "bcolz/carray_ext.pyx":2072
 *                 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_t_1 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_t_1, __pyx_v_arr) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2073
 *             # 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_r = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2057
 *                         "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":2075
 *             return
 *         # List of integers (case of fancy indexing)
 *         elif isinstance(key, list):             # <<<<<<<<<<<<<<
 *             # Try to convert to a integer array
 *             try:
 */
  __pyx_t_4 = PyList_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_4 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2077
 *         elif isinstance(key, list):
 *             # Try to convert to a integer array
 *             try:             # <<<<<<<<<<<<<<
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 */
    {
      __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":2078
 *             # Try to convert to a integer array
 *             try:
 *                 key = np.array(key, dtype=np.int_)             # <<<<<<<<<<<<<<
 *             except:
 *                 raise IndexError(
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __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":2077
 *         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_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":2079
 *             try:
 *                 key = np.array(key, dtype=np.int_)
 *             except:             # <<<<<<<<<<<<<<
 *                 raise IndexError(
 *                     "key cannot be converted to an array of indices")
 */
      /*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_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_1);

        /* "bcolz/carray_ext.pyx":2080
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "key cannot be converted to an array of indices")
 *             self[key] = value
 */
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
      }
      __pyx_L14_except_error:;

      /* "bcolz/carray_ext.pyx":2077
 *         elif isinstance(key, list):
 *             # Try to convert to a integer array
 *             try:             # <<<<<<<<<<<<<<
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 */
      __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":2082
 *                 raise IndexError(
 *                     "key cannot be converted to an array of indices")
 *             self[key] = value             # <<<<<<<<<<<<<<
 *             return
 *         # A boolean or integer array (case of fancy indexing)
 */
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_key, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2083
 *                     "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_r = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2075
 *             return
 *         # List of integers (case of fancy indexing)
 *         elif isinstance(key, list):             # <<<<<<<<<<<<<<
 *             # Try to convert to a integer array
 *             try:
 */
  }

  /* "bcolz/carray_ext.pyx":2085
 *             return
 *         # A boolean or integer array (case of fancy indexing)
 *         elif hasattr(key, "dtype"):             # <<<<<<<<<<<<<<
 *             if key.dtype.type == np.bool_:
 *                 # A boolean array
 */
  __pyx_t_2 = PyObject_HasAttr(__pyx_v_key, __pyx_n_s_dtype); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2086
 *         # 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2088
 *             if key.dtype.type == np.bool_:
 *                 # A boolean array
 *                 if len(key) != self.len:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         "boolean array length must match len(self)")
 */
      __pyx_t_6 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_4) {

        /* "bcolz/carray_ext.pyx":2089
 *                 # A boolean array
 *                 if len(key) != self.len:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         "boolean array length must match len(self)")
 *                 self.bool_update(key, value)
 */
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "bcolz/carray_ext.pyx":2088
 *             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":2091
 *                     raise ValueError(
 *                         "boolean array length must match len(self)")
 *                 self.bool_update(key, value)             # <<<<<<<<<<<<<<
 *                 return
 *             elif np.issubsctype(key, np.int_):
 */
      ((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":2092
 *                         "boolean array length must match len(self)")
 *                 self.bool_update(key, value)
 *                 return             # <<<<<<<<<<<<<<
 *             elif np.issubsctype(key, np.int_):
 *                 # An integer array
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":2086
 *         # 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":2093
 *                 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_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_4) {

      /* "bcolz/carray_ext.pyx":2095
 *             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_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_arrlen, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":2096
 *                 # 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):
 */
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_safe, __pyx_v_self->_safe) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":2095
 *             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_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __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":2098
 *                         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_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_filename = __pyx_f[0]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_12 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __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":2099
 *                 # XXX This could be optimised, but it works like this
 *                 for i, item in enumerate(key):
 *                     self[item] = value[i]             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
        __pyx_t_5 = PyObject_GetItem(__pyx_v_value, __pyx_v_i); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_item, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "bcolz/carray_ext.pyx":2098
 *                         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_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":2100
 *                 for i, item in enumerate(key):
 *                     self[item] = value[i]
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 raise IndexError(
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":2093
 *                 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":2102
 *                 return
 *             else:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "arrays used as indices must be of integer (or boolean) "
 *                     "type")
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "bcolz/carray_ext.pyx":2085
 *             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":2106
 *                     "type")
 *         # An boolean expression (case of fancy indexing)
 *         elif type(key) is str:             # <<<<<<<<<<<<<<
 *             # Evaluate
 *             result = bcolz.eval(key)
 */
  __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":2108
 *         elif type(key) is str:
 *             # Evaluate
 *             result = bcolz.eval(key)             # <<<<<<<<<<<<<<
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")
 */
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_bcolz); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __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":2109
 *             # Evaluate
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:             # <<<<<<<<<<<<<<
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2110
 *             result = bcolz.eval(key)
 *             if result.dtype.type != np.bool_:
 *                 raise IndexError("only boolean expressions supported")             # <<<<<<<<<<<<<<
 *             if len(result) != self.len:
 *                 raise IndexError(
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":2109
 *             # 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":2111
 *             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_t_6 = PyObject_Length(__pyx_v_result); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2112
 *                 raise IndexError("only boolean expressions supported")
 *             if len(result) != self.len:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "boolean expression outcome must match len(self)")
 *             # Call __setitem__ again
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":2111
 *             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":2115
 *                     "boolean expression outcome must match len(self)")
 *             # Call __setitem__ again
 *             self[result] = value             # <<<<<<<<<<<<<<
 *             return
 *         # All the rest not implemented
 */
    if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self), __pyx_v_result, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2116
 *             # Call __setitem__ again
 *             self[result] = value
 *             return             # <<<<<<<<<<<<<<
 *         # All the rest not implemented
 *         else:
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2106
 *                     "type")
 *         # An boolean expression (case of fancy indexing)
 *         elif type(key) is str:             # <<<<<<<<<<<<<<
 *             # Evaluate
 *             result = bcolz.eval(key)
 */
  }

  /* "bcolz/carray_ext.pyx":2119
 *         # All the rest not implemented
 *         else:
 *             raise NotImplementedError("key not supported: %s" % repr(key))             # <<<<<<<<<<<<<<
 * 
 *         # Get the corrected values for start, stop, step
 */
  /*else*/ {
    __pyx_t_5 = PyObject_Repr(__pyx_v_key); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "bcolz/carray_ext.pyx":2122
 * 
 *         # Get the corrected values for start, stop, step
 *         (start, stop, step) = slice(start, stop, step).indices(self.len)             # <<<<<<<<<<<<<<
 * 
 *         # Build a numpy object out of value
 */
  __pyx_t_5 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __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":2125
 * 
 *         # 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_t_14 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_start); if (unlikely((__pyx_t_14 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_stop); if (unlikely((__pyx_t_15 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_step); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_f_5bcolz_10carray_ext_get_len_of_range(__pyx_t_14, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_vlen = __pyx_t_16;

  /* "bcolz/carray_ext.pyx":2126
 *         # 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_t_2 = ((__pyx_v_vlen == 0) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2128
 *         if vlen == 0:
 *             # If range is empty, return immediately
 *             return             # <<<<<<<<<<<<<<
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,
 *                 safe=self._safe)
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2126
 *         # 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":2129
 *             # If range is empty, return immediately
 *             return
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,             # <<<<<<<<<<<<<<
 *                 safe=self._safe)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __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_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_vlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_arrlen, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":2130
 *             return
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,
 *                 safe=self._safe)             # <<<<<<<<<<<<<<
 * 
 *         # Fill it from data in chunks
 */
  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_safe, __pyx_v_self->_safe) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":2129
 *             # If range is empty, return immediately
 *             return
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,             # <<<<<<<<<<<<<<
 *                 safe=self._safe)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __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;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "bcolz/carray_ext.pyx":2133
 * 
 *         # Fill it from data in chunks
 *         nwrow = 0             # <<<<<<<<<<<<<<
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */
  __pyx_v_nwrow = 0;

  /* "bcolz/carray_ext.pyx":2134
 *         # 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_t_17 = __pyx_v_self->_chunklen;
  __pyx_v_chunklen = __pyx_t_17;

  /* "bcolz/carray_ext.pyx":2135
 *         nwrow = 0
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         if self.leftover > 0:
 *             nchunks += 1
 */
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":2136
 *         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_t_2 = ((__pyx_v_self->leftover > 0) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2137
 *         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_v_nchunks = (__pyx_v_nchunks + 1);

    /* "bcolz/carray_ext.pyx":2136
 *         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":2138
 *         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_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunklen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_v_start, __pyx_t_3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_11); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_v_first_chunk = ((npy_intp)__pyx_t_16);

  /* "bcolz/carray_ext.pyx":2139
 *             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_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_chunklen); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_stop, __pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_3); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_last_chunk = (((npy_intp)__pyx_t_16) + 1);

  /* "bcolz/carray_ext.pyx":2140
 *         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_t_16 = __pyx_v_nchunks;
  __pyx_t_15 = __pyx_v_last_chunk;
  if (((__pyx_t_16 < __pyx_t_15) != 0)) {
    __pyx_t_14 = __pyx_t_16;
  } else {
    __pyx_t_14 = __pyx_t_15;
  }
  __pyx_v_last_chunk = __pyx_t_14;

  /* "bcolz/carray_ext.pyx":2141
 *         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_t_14 = __pyx_v_last_chunk;
  for (__pyx_v_nchunk = __pyx_v_first_chunk; __pyx_v_nchunk < __pyx_t_14; __pyx_v_nchunk++) {

    /* "bcolz/carray_ext.pyx":2143
 *         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_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_start); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_stop); if (unlikely((__pyx_t_15 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2144
 *             # Compute start & stop for each block
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 *                                              step)             # <<<<<<<<<<<<<<
 *             if blen == 0:
 *                 continue
 */
    __pyx_t_18 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_step); if (unlikely((__pyx_t_18 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2143
 *         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_t_3 = __pyx_f_5bcolz_10carray_ext_clip_chunk(__pyx_v_nchunk, __pyx_v_chunklen, __pyx_t_16, __pyx_t_15, __pyx_t_18); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_11 = 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_11);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext;
      index = 0; __pyx_t_11 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_11)) goto __pyx_L34_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_11);
      index = 1; __pyx_t_1 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L34_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_L34_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L35_unpacking_done;
      __pyx_L34_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L35_unpacking_done:;
    }
    __pyx_t_18 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_11); if (unlikely((__pyx_t_18 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_15 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_15 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_startb = __pyx_t_18;
    __pyx_v_stopb = __pyx_t_15;
    __pyx_v_blen = __pyx_t_16;

    /* "bcolz/carray_ext.pyx":2145
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 *                                              step)
 *             if blen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Modify the data in chunk
 */
    __pyx_t_2 = ((__pyx_v_blen == 0) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2146
 *                                              step)
 *             if blen == 0:
 *                 continue             # <<<<<<<<<<<<<<
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:
 */
      goto __pyx_L32_continue;

      /* "bcolz/carray_ext.pyx":2145
 *             startb, stopb, blen = clip_chunk(nchunk, chunklen, start, stop,
 *                                              step)
 *             if blen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Modify the data in chunk
 */
    }

    /* "bcolz/carray_ext.pyx":2148
 *                 continue
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:             # <<<<<<<<<<<<<<
 *                 self.lastchunkarr[startb:stopb:step] = value[
 *                                                        nwrow:nwrow + blen]
 */
    __pyx_t_4 = ((__pyx_v_nchunk == (__pyx_v_nchunks - 1)) != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L38_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->leftover != 0);
    __pyx_t_2 = __pyx_t_4;
    __pyx_L38_bool_binop_done:;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2149
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:
 *                 self.lastchunkarr[startb:stopb:step] = value[             # <<<<<<<<<<<<<<
 *                                                        nwrow:nwrow + blen]
 *             else:
 */
      __pyx_t_3 = __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_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = PySlice_New(__pyx_t_5, __pyx_t_1, __pyx_v_step); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __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;
      if (unlikely(PyObject_SetItem(__pyx_v_self->lastchunkarr, __pyx_t_11, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":2148
 *                 continue
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:             # <<<<<<<<<<<<<<
 *                 self.lastchunkarr[startb:stopb:step] = value[
 *                                                        nwrow:nwrow + blen]
 */
      goto __pyx_L37;
    }

    /* "bcolz/carray_ext.pyx":2152
 *                                                        nwrow:nwrow + blen]
 *             else:
 *                 if stopb - startb < chunklen or step > 1:             # <<<<<<<<<<<<<<
 *                     # Get the data chunk
 *                     chunk_ = self.chunks[nchunk]
 */
    /*else*/ {
      __pyx_t_4 = (((__pyx_v_stopb - __pyx_v_startb) < __pyx_v_chunklen) != 0);
      if (!__pyx_t_4) {
      } else {
        __pyx_t_2 = __pyx_t_4;
        goto __pyx_L41_bool_binop_done;
      }
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_step, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = __pyx_t_4;
      __pyx_L41_bool_binop_done:;
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2154
 *                 if stopb - startb < chunklen or step > 1:
 *                     # Get the data chunk
 *                     chunk_ = self.chunks[nchunk]             # <<<<<<<<<<<<<<
 *                     self._cbytes -= chunk_.cbytes
 *                     # Get all the values there
 */
        __pyx_t_3 = __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_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __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":2155
 *                     # Get the data chunk
 *                     chunk_ = self.chunks[nchunk]
 *                     self._cbytes -= chunk_.cbytes             # <<<<<<<<<<<<<<
 *                     # Get all the values there
 *                     cdata = chunk_[:]
 */
        __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes - __pyx_v_chunk_->cbytes);

        /* "bcolz/carray_ext.pyx":2157
 *                     self._cbytes -= chunk_.cbytes
 *                     # Get all the values there
 *                     cdata = chunk_[:]             # <<<<<<<<<<<<<<
 *                     # Overwrite it with data from value
 *                     cdata[startb:stopb:step] = value[nwrow:nwrow + blen]
 */
        __pyx_t_3 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_chunk_), 0, 0, NULL, NULL, &__pyx_slice__92, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_cdata, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "bcolz/carray_ext.pyx":2159
 *                     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_t_3 = __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_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_11 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_startb); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_stopb); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PySlice_New(__pyx_t_11, __pyx_t_1, __pyx_v_step); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(PyObject_SetItem(__pyx_v_cdata, __pyx_t_5, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "bcolz/carray_ext.pyx":2152
 *                                                        nwrow:nwrow + blen]
 *             else:
 *                 if stopb - startb < chunklen or step > 1:             # <<<<<<<<<<<<<<
 *                     # Get the data chunk
 *                     chunk_ = self.chunks[nchunk]
 */
        goto __pyx_L40;
      }

      /* "bcolz/carray_ext.pyx":2163
 *                     # 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,
 */
      /*else*/ {
        __pyx_t_3 = __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_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_cdata, __pyx_t_3);
        __pyx_t_3 = 0;
      }
      __pyx_L40:;

      /* "bcolz/carray_ext.pyx":2165
 *                     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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_cdata);
      __Pyx_GIVEREF(__pyx_v_cdata);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cdata);
      __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);

      /* "bcolz/carray_ext.pyx":2166
 *                 # Replace the chunk
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,
 *                                _memory=self._rootdir is None)             # <<<<<<<<<<<<<<
 *                 self.chunks[nchunk] = chunk_
 *                 # Update cbytes counter
 */
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2165
 *                     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_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __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_XDECREF_SET(__pyx_v_chunk_, ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2167
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,
 *                                _memory=self._rootdir is None)
 *                 self.chunks[nchunk] = chunk_             # <<<<<<<<<<<<<<
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes
 */
      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_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":2169
 *                 self.chunks[nchunk] = chunk_
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes             # <<<<<<<<<<<<<<
 *             nwrow += blen
 * 
 */
      __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes + __pyx_v_chunk_->cbytes);
    }
    __pyx_L37:;

    /* "bcolz/carray_ext.pyx":2170
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes
 *             nwrow += blen             # <<<<<<<<<<<<<<
 * 
 *         # Safety check
 */
    __pyx_v_nwrow = (__pyx_v_nwrow + __pyx_v_blen);
    __pyx_L32_continue:;
  }

  /* "bcolz/carray_ext.pyx":2173
 * 
 *         # Safety check
 *         assert (nwrow == vlen)             # <<<<<<<<<<<<<<
 * 
 *     # This is a private function that is specific for `eval`
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_nwrow == __pyx_v_vlen) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "bcolz/carray_ext.pyx":2004
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2176
 * 
 *     # 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_43_getrange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_42_getrange[] = "carray._getrange(self, npy_intp start, npy_intp blen, ndarray out)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_43_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_getrange") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_42_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_42_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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  npy_intp __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_getrange", 0);

  /* "bcolz/carray_ext.pyx":2184
 * 
 *         # Check that we are inside limits
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)             # <<<<<<<<<<<<<<
 *         if (start + blen) > nrows:
 *             blen = nrows - start
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nrows = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2185
 *         # Check that we are inside limits
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         if (start + blen) > nrows:             # <<<<<<<<<<<<<<
 *             blen = nrows - start
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_start + __pyx_v_blen)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2186
 *         nrows = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         if (start + blen) > nrows:
 *             blen = nrows - start             # <<<<<<<<<<<<<<
 * 
 *         # Fill `out` from data in chunks
 */
    __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_blen = __pyx_t_4;

    /* "bcolz/carray_ext.pyx":2185
 *         # 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":2189
 * 
 *         # Fill `out` from data in chunks
 *         nwrow = 0             # <<<<<<<<<<<<<<
 *         stop = start + blen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */
  __pyx_v_nwrow = 0;

  /* "bcolz/carray_ext.pyx":2190
 *         # 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_v_stop = (__pyx_v_start + __pyx_v_blen);

  /* "bcolz/carray_ext.pyx":2191
 *         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_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":2192
 *         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_v_chunklen = (__pyx_v_self->_chunksize / __pyx_v_self->atomsize);

  /* "bcolz/carray_ext.pyx":2193
 *         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_v_schunk = ((npy_intp)(__pyx_v_start / __pyx_v_chunklen));

  /* "bcolz/carray_ext.pyx":2194
 *         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_v_echunk = ((npy_intp)((__pyx_v_start + __pyx_v_blen) / __pyx_v_chunklen));

  /* "bcolz/carray_ext.pyx":2195
 *         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_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":2197
 *         for nchunk from schunk <= nchunk <= echunk:
 *             # Compute start & stop for each block
 *             startb = start % chunklen             # <<<<<<<<<<<<<<
 *             stopb = chunklen
 *             if (start + startb) + chunklen > stop:
 */
    if (unlikely(__pyx_v_chunklen == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_startb = __Pyx_mod_npy_intp(__pyx_v_start, __pyx_v_chunklen);

    /* "bcolz/carray_ext.pyx":2198
 *             # 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_v_stopb = __pyx_v_chunklen;

    /* "bcolz/carray_ext.pyx":2199
 *             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_t_3 = ((((__pyx_v_start + __pyx_v_startb) + __pyx_v_chunklen) > __pyx_v_stop) != 0);
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":2202
 *                 # 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_v_stopb = ((__pyx_v_stop - __pyx_v_start) + __pyx_v_startb);

      /* "bcolz/carray_ext.pyx":2204
 *                 stopb = (stop - start) + startb
 *                 # stopb can never be larger than chunklen
 *                 if stopb > chunklen:             # <<<<<<<<<<<<<<
 *                     stopb = chunklen
 *             cblen = stopb - startb
 */
      __pyx_t_3 = ((__pyx_v_stopb > __pyx_v_chunklen) != 0);
      if (__pyx_t_3) {

        /* "bcolz/carray_ext.pyx":2205
 *                 # stopb can never be larger than chunklen
 *                 if stopb > chunklen:
 *                     stopb = chunklen             # <<<<<<<<<<<<<<
 *             cblen = stopb - startb
 *             if cblen == 0:
 */
        __pyx_v_stopb = __pyx_v_chunklen;

        /* "bcolz/carray_ext.pyx":2204
 *                 stopb = (stop - start) + startb
 *                 # stopb can never be larger than chunklen
 *                 if stopb > chunklen:             # <<<<<<<<<<<<<<
 *                     stopb = chunklen
 *             cblen = stopb - startb
 */
      }

      /* "bcolz/carray_ext.pyx":2199
 *             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":2206
 *                 if stopb > chunklen:
 *                     stopb = chunklen
 *             cblen = stopb - startb             # <<<<<<<<<<<<<<
 *             if cblen == 0:
 *                 continue
 */
    __pyx_v_cblen = (__pyx_v_stopb - __pyx_v_startb);

    /* "bcolz/carray_ext.pyx":2207
 *                     stopb = chunklen
 *             cblen = stopb - startb
 *             if cblen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Get the data chunk and assign it to result array
 */
    __pyx_t_3 = ((__pyx_v_cblen == 0) != 0);
    if (__pyx_t_3) {

      /* "bcolz/carray_ext.pyx":2208
 *             cblen = stopb - startb
 *             if cblen == 0:
 *                 continue             # <<<<<<<<<<<<<<
 *             # Get the data chunk and assign it to result array
 *             if nchunk == nchunks and self.leftover:
 */
      goto __pyx_L4_continue;

      /* "bcolz/carray_ext.pyx":2207
 *                     stopb = chunklen
 *             cblen = stopb - startb
 *             if cblen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Get the data chunk and assign it to result array
 */
    }

    /* "bcolz/carray_ext.pyx":2210
 *                 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_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":2211
 *             # 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_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_filename = __pyx_f[0]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2210
 *                 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":2213
 *                 out[nwrow:nwrow + cblen] = self.lastchunkarr[startb:stopb]
 *             else:
 *                 chunk_ = self.chunks[nchunk]             # <<<<<<<<<<<<<<
 *                 chunk_._getitem(startb, stopb,
 *                                 out.data + nwrow * self.atomsize)
 */
    /*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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __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":2214
 *             else:
 *                 chunk_ = self.chunks[nchunk]
 *                 chunk_._getitem(startb, stopb,             # <<<<<<<<<<<<<<
 *                                 out.data + nwrow * self.atomsize)
 *             nwrow += cblen
 */
      ((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":2216
 *                 chunk_._getitem(startb, stopb,
 *                                 out.data + nwrow * self.atomsize)
 *             nwrow += cblen             # <<<<<<<<<<<<<<
 *             start += cblen
 * 
 */
    __pyx_v_nwrow = (__pyx_v_nwrow + __pyx_v_cblen);

    /* "bcolz/carray_ext.pyx":2217
 *                                 out.data + nwrow * self.atomsize)
 *             nwrow += cblen
 *             start += cblen             # <<<<<<<<<<<<<<
 * 
 *     cdef void bool_update(self, boolarr, value):
 */
    __pyx_v_start = (__pyx_v_start + __pyx_v_cblen);
    __pyx_L4_continue:;
  }

  /* "bcolz/carray_ext.pyx":2176
 * 
 *     # 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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2219
 *             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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bool_update", 0);
  __Pyx_INCREF(__pyx_v_value);

  /* "bcolz/carray_ext.pyx":2229
 *         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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_boolarr, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2229; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2229; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2229; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_vlen = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":2230
 * 
 *         vlen = boolarr.sum()  # number of true values in bool array
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,             # <<<<<<<<<<<<<<
 *                 safe=self._safe)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arrlen, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "bcolz/carray_ext.pyx":2231
 *         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
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_safe, __pyx_v_self->_safe) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":2230
 * 
 *         vlen = boolarr.sum()  # number of true values in bool array
 *         value = utils.to_ndarray(value, self._dtype, arrlen=vlen,             # <<<<<<<<<<<<<<
 *                 safe=self._safe)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __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":2234
 * 
 *         # Fill it from data in chunks
 *         nwrow = 0             # <<<<<<<<<<<<<<
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */
  __pyx_v_nwrow = 0;

  /* "bcolz/carray_ext.pyx":2235
 *         # 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_t_6 = __pyx_v_self->_chunklen;
  __pyx_v_chunklen = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":2236
 *         nwrow = 0
 *         chunklen = self._chunklen
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)             # <<<<<<<<<<<<<<
 *         if self.leftover > 0:
 *             nchunks += 1
 */
  __pyx_v_nchunks = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->_chunksize));

  /* "bcolz/carray_ext.pyx":2237
 *         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_t_7 = ((__pyx_v_self->leftover > 0) != 0);
  if (__pyx_t_7) {

    /* "bcolz/carray_ext.pyx":2238
 *         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_v_nchunks = (__pyx_v_nchunks + 1);

    /* "bcolz/carray_ext.pyx":2237
 *         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":2239
 *         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_v_nrows = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->atomsize));

  /* "bcolz/carray_ext.pyx":2240
 *             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_t_4 = __pyx_v_nchunks;
  for (__pyx_v_nchunk = 0; __pyx_v_nchunk < __pyx_t_4; __pyx_v_nchunk++) {

    /* "bcolz/carray_ext.pyx":2242
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __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":2244
 *             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_v_n = (__pyx_v_nchunk * __pyx_v_chunklen);

    /* "bcolz/carray_ext.pyx":2245
 *             # Get boolean values for this chunk
 *             n = nchunk * chunklen
 *             boolb = boolarr[n + startb:n + stopb]             # <<<<<<<<<<<<<<
 *             blen = boolb.sum()
 *             if blen == 0:
 */
    __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_filename = __pyx_f[0]; __pyx_lineno = 2245; __pyx_clineno = __LINE__; goto __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":2246
 *             n = nchunk * chunklen
 *             boolb = boolarr[n + startb:n + stopb]
 *             blen = boolb.sum()             # <<<<<<<<<<<<<<
 *             if blen == 0:
 *                 continue
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_boolb, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_blen = __pyx_t_11;

    /* "bcolz/carray_ext.pyx":2247
 *             boolb = boolarr[n + startb:n + stopb]
 *             blen = boolb.sum()
 *             if blen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Modify the data in chunk
 */
    __pyx_t_7 = ((__pyx_v_blen == 0) != 0);
    if (__pyx_t_7) {

      /* "bcolz/carray_ext.pyx":2248
 *             blen = boolb.sum()
 *             if blen == 0:
 *                 continue             # <<<<<<<<<<<<<<
 *             # Modify the data in chunk
 *             if nchunk == nchunks - 1 and self.leftover:
 */
      goto __pyx_L4_continue;

      /* "bcolz/carray_ext.pyx":2247
 *             boolb = boolarr[n + startb:n + stopb]
 *             blen = boolb.sum()
 *             if blen == 0:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Modify the data in chunk
 */
    }

    /* "bcolz/carray_ext.pyx":2250
 *                 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_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":2252
 *             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_t_13 = PyObject_Length(__pyx_v_boolb); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2252; __pyx_clineno = __LINE__; goto __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":2253
 *                 # Update the valid part of the lastchunkarr
 *                 lastchunkarr = self.lastchunkarr[:len(boolb)]
 *                 lastchunkarr[boolb] = value[nwrow:nwrow + blen]             # <<<<<<<<<<<<<<
 *             else:
 *                 # Get the data chunk
 */
      __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_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyObject_SetItem(__pyx_v_lastchunkarr, __pyx_v_boolb, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":2250
 *                 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":2256
 *             else:
 *                 # Get the data chunk
 *                 chunk_ = self.chunks[nchunk]             # <<<<<<<<<<<<<<
 *                 self._cbytes -= chunk_.cbytes
 *                 # Get all the values there
 */
    /*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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __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":2257
 *                 # Get the data chunk
 *                 chunk_ = self.chunks[nchunk]
 *                 self._cbytes -= chunk_.cbytes             # <<<<<<<<<<<<<<
 *                 # Get all the values there
 *                 cdata = chunk_[:]
 */
      __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes - __pyx_v_chunk_->cbytes);

      /* "bcolz/carray_ext.pyx":2259
 *                 self._cbytes -= chunk_.cbytes
 *                 # Get all the values there
 *                 cdata = chunk_[:]             # <<<<<<<<<<<<<<
 *                 # Overwrite it with data from value
 *                 cdata[boolb] = value[nwrow:nwrow + blen]
 */
      __pyx_t_5 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_chunk_), 0, 0, NULL, NULL, &__pyx_slice__93, 0, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2259; __pyx_clineno = __LINE__; goto __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":2261
 *                 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_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_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyObject_SetItem(__pyx_v_cdata, __pyx_v_boolb, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "bcolz/carray_ext.pyx":2263
 *                 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_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2263; __pyx_clineno = __LINE__; goto __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":2264
 *                 # Replace the chunk
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,
 *                                _memory=self._rootdir is None)             # <<<<<<<<<<<<<<
 *                 self.chunks[nchunk] = chunk_
 *                 # Update cbytes counter
 */
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_memory, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "bcolz/carray_ext.pyx":2263
 *                 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_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2263; __pyx_clineno = __LINE__; goto __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":2265
 *                 chunk_ = chunk(cdata, self._dtype, self._cparams,
 *                                _memory=self._rootdir is None)
 *                 self.chunks[nchunk] = chunk_             # <<<<<<<<<<<<<<
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes
 */
      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_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "bcolz/carray_ext.pyx":2267
 *                 self.chunks[nchunk] = chunk_
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes             # <<<<<<<<<<<<<<
 *             nwrow += blen
 * 
 */
      __pyx_v_self->_cbytes = (__pyx_v_self->_cbytes + __pyx_v_chunk_->cbytes);
    }
    __pyx_L9:;

    /* "bcolz/carray_ext.pyx":2268
 *                 # Update cbytes counter
 *                 self._cbytes += chunk_.cbytes
 *             nwrow += blen             # <<<<<<<<<<<<<<
 * 
 *         # Safety check
 */
    __pyx_v_nwrow = (__pyx_v_nwrow + __pyx_v_blen);
    __pyx_L4_continue:;
  }

  /* "bcolz/carray_ext.pyx":2271
 * 
 *         # Safety check
 *         assert (nwrow == vlen)             # <<<<<<<<<<<<<<
 * 
 *     cdef reset_iter_sentinels(self):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_nwrow == __pyx_v_vlen) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif

  /* "bcolz/carray_ext.pyx":2219
 *             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_RefNannyFinishContext();
}

/* "bcolz/carray_ext.pyx":2273
 *         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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_intp __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset_iter_sentinels", 0);

  /* "bcolz/carray_ext.pyx":2275
 *     cdef reset_iter_sentinels(self):
 *         """Reset sentinels for iterator."""
 *         self.sss_mode = False             # <<<<<<<<<<<<<<
 *         self.wheretrue_mode = False
 *         self.where_mode = False
 */
  __pyx_v_self->sss_mode = 0;

  /* "bcolz/carray_ext.pyx":2276
 *         """Reset sentinels for iterator."""
 *         self.sss_mode = False
 *         self.wheretrue_mode = False             # <<<<<<<<<<<<<<
 *         self.where_mode = False
 *         self.where_arr = None
 */
  __pyx_v_self->wheretrue_mode = 0;

  /* "bcolz/carray_ext.pyx":2277
 *         self.sss_mode = False
 *         self.wheretrue_mode = False
 *         self.where_mode = False             # <<<<<<<<<<<<<<
 *         self.where_arr = None
 *         self.nhits = 0
 */
  __pyx_v_self->where_mode = 0;

  /* "bcolz/carray_ext.pyx":2278
 *         self.wheretrue_mode = False
 *         self.where_mode = False
 *         self.where_arr = None             # <<<<<<<<<<<<<<
 *         self.nhits = 0
 *         self.limit = _MAXINT
 */
  __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":2279
 *         self.where_mode = False
 *         self.where_arr = None
 *         self.nhits = 0             # <<<<<<<<<<<<<<
 *         self.limit = _MAXINT
 *         self.skip = 0
 */
  __pyx_v_self->nhits = 0;

  /* "bcolz/carray_ext.pyx":2280
 *         self.where_arr = None
 *         self.nhits = 0
 *         self.limit = _MAXINT             # <<<<<<<<<<<<<<
 *         self.skip = 0
 *         self.start = 0
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MAXINT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->limit = __pyx_t_2;

  /* "bcolz/carray_ext.pyx":2281
 *         self.nhits = 0
 *         self.limit = _MAXINT
 *         self.skip = 0             # <<<<<<<<<<<<<<
 *         self.start = 0
 *         self.stop = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 */
  __pyx_v_self->skip = 0;

  /* "bcolz/carray_ext.pyx":2282
 *         self.limit = _MAXINT
 *         self.skip = 0
 *         self.start = 0             # <<<<<<<<<<<<<<
 *         self.stop = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         self.step = 1
 */
  __pyx_v_self->start = 0;

  /* "bcolz/carray_ext.pyx":2283
 *         self.skip = 0
 *         self.start = 0
 *         self.stop = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)             # <<<<<<<<<<<<<<
 *         self.step = 1
 *         self.iter_exhausted = False
 */
  __pyx_v_self->stop = ((npy_intp)(__pyx_v_self->_nbytes / __pyx_v_self->atomsize));

  /* "bcolz/carray_ext.pyx":2284
 *         self.start = 0
 *         self.stop = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         self.step = 1             # <<<<<<<<<<<<<<
 *         self.iter_exhausted = False
 * 
 */
  __pyx_v_self->step = 1;

  /* "bcolz/carray_ext.pyx":2285
 *         self.stop = <npy_intp> cython.cdiv(self._nbytes, self.atomsize)
 *         self.step = 1
 *         self.iter_exhausted = False             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __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":2273
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2287
 *         self.iter_exhausted = False
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         if self.iter_exhausted:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_45__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_45__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_44__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_44__iter__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  npy_intp __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "bcolz/carray_ext.pyx":2289
 *     def __iter__(self):
 * 
 *         if self.iter_exhausted:             # <<<<<<<<<<<<<<
 *             # Iterator is exhausted, so return immediately
 *             return self
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->iter_exhausted); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "bcolz/carray_ext.pyx":2291
 *         if self.iter_exhausted:
 *             # Iterator is exhausted, so return immediately
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         if not (self.sss_mode or
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_r = ((PyObject *)__pyx_v_self);
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2289
 *     def __iter__(self):
 * 
 *         if self.iter_exhausted:             # <<<<<<<<<<<<<<
 *             # Iterator is exhausted, so return immediately
 *             return self
 */
  }

  /* "bcolz/carray_ext.pyx":2293
 *             return self
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  __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":2294
 * 
 *         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_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":2295
 *         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_t_2 = (__pyx_v_self->where_mode != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;

  /* "bcolz/carray_ext.pyx":2293
 *             return self
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2297
 *                 self.where_mode):
 *             # No mode.  Probably a direct iter() call.  Use sss_mode here.
 *             return self.iter()             # <<<<<<<<<<<<<<
 * 
 *         # Initialize some internal values
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_iter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __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":2293
 *             return self
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  }

  /* "bcolz/carray_ext.pyx":2300
 * 
 *         # Initialize some internal values
 *         self.startb = 0             # <<<<<<<<<<<<<<
 *         self.nrowsread = self.start
 *         self._nrow = self.start - self.step
 */
  __pyx_v_self->startb = 0;

  /* "bcolz/carray_ext.pyx":2301
 *         # Initialize some internal values
 *         self.startb = 0
 *         self.nrowsread = self.start             # <<<<<<<<<<<<<<
 *         self._nrow = self.start - self.step
 *         self._row = -1  # a sentinel
 */
  __pyx_t_6 = __pyx_v_self->start;
  __pyx_v_self->nrowsread = __pyx_t_6;

  /* "bcolz/carray_ext.pyx":2302
 *         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_v_self->_nrow = (__pyx_v_self->start - __pyx_v_self->step);

  /* "bcolz/carray_ext.pyx":2303
 *         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_v_self->_row = -1;

  /* "bcolz/carray_ext.pyx":2304
 *         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_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":2305
 *         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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->where_arr, __pyx_n_s_chunklen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2305; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_self->nrowsinbuf = __pyx_t_8;

    /* "bcolz/carray_ext.pyx":2304
 *         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":2307
 *             self.nrowsinbuf = self.where_arr.chunklen
 *         else:
 *             self.nrowsinbuf = self._chunklen             # <<<<<<<<<<<<<<
 * 
 *         return self
 */
  /*else*/ {
    __pyx_t_8 = __pyx_v_self->_chunklen;
    __pyx_v_self->nrowsinbuf = __pyx_t_8;
  }
  __pyx_L8:;

  /* "bcolz/carray_ext.pyx":2309
 *             self.nrowsinbuf = self._chunklen
 * 
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def iter(self, start=0, stop=None, step=1, limit=None, skip=0, _next=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2287
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2311
 *         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_47iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_46iter[] = "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_47iter(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_filename = __pyx_f[0]; __pyx_lineno = 2311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_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_filename = __pyx_f[0]; __pyx_lineno = 2311; __pyx_clineno = __LINE__; goto __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_46iter(((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_46iter(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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("iter", 0);

  /* "bcolz/carray_ext.pyx":2339
 *         """
 *         # Check limits
 *         if step <= 0:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("step param can only be positive")
 *         if _next:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_step, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2340
 *         # Check limits
 *         if step <= 0:
 *             raise NotImplementedError("step param can only be positive")             # <<<<<<<<<<<<<<
 *         if _next:
 *             cview = self
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2339
 *         """
 *         # Check limits
 *         if step <= 0:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("step param can only be positive")
 *         if _next:
 */
  }

  /* "bcolz/carray_ext.pyx":2341
 *         if step <= 0:
 *             raise NotImplementedError("step param can only be positive")
 *         if _next:             # <<<<<<<<<<<<<<
 *             cview = self
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__next); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2342
 *             raise NotImplementedError("step param can only be positive")
 *         if _next:
 *             cview = self             # <<<<<<<<<<<<<<
 *         else:
 *             cview = self.view()
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_v_cview = ((PyObject *)__pyx_v_self);

    /* "bcolz/carray_ext.pyx":2341
 *         if step <= 0:
 *             raise NotImplementedError("step param can only be positive")
 *         if _next:             # <<<<<<<<<<<<<<
 *             cview = self
 *         else:
 */
    goto __pyx_L4;
  }

  /* "bcolz/carray_ext.pyx":2344
 *             cview = self
 *         else:
 *             cview = self.view()             # <<<<<<<<<<<<<<
 *         return cview._init_iter(start, stop, step, limit, skip)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2344; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2344; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2344; __pyx_clineno = __LINE__; goto __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":2345
 *         else:
 *             cview = self.view()
 *         return cview._init_iter(start, stop, step, limit, skip)             # <<<<<<<<<<<<<<
 * 
 *     def _init_iter(self, start, stop, step, limit, skip):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cview, __pyx_n_s_init_iter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2345; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2345; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2345; __pyx_clineno = __LINE__; goto __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":2311
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2347
 *         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_49_init_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_48_init_iter[] = "carray._init_iter(self, start, stop, step, limit, skip)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_49_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_iter") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2347; __pyx_clineno = __LINE__; goto __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_48_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_48_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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_iter", 0);

  /* "bcolz/carray_ext.pyx":2348
 * 
 *     def _init_iter(self, start, stop, step, limit, skip):
 *         self.reset_iter_sentinels()             # <<<<<<<<<<<<<<
 *         self.sss_mode = True
 *         self.start, self.stop, self.step = \
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2349
 *     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_v_self->sss_mode = 1;

  /* "bcolz/carray_ext.pyx":2351
 *         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_t_2 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2351; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }

  /* "bcolz/carray_ext.pyx":2350
 *         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_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __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":2352
 *         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_t_10 = (__pyx_v_limit != Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {

    /* "bcolz/carray_ext.pyx":2353
 *             slice(start, stop, step).indices(self.len)
 *         if limit is not None:
 *             self.limit = limit + skip             # <<<<<<<<<<<<<<
 *         self.skip = skip
 *         return iter(self)
 */
    __pyx_t_1 = PyNumber_Add(__pyx_v_limit, __pyx_v_skip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2353; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_self->limit = __pyx_t_9;

    /* "bcolz/carray_ext.pyx":2352
 *         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":2354
 *         if limit is not None:
 *             self.limit = limit + skip
 *         self.skip = skip             # <<<<<<<<<<<<<<
 *         return iter(self)
 * 
 */
  __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_skip); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->skip = __pyx_t_9;

  /* "bcolz/carray_ext.pyx":2355
 *             self.limit = limit + skip
 *         self.skip = skip
 *         return iter(self)             # <<<<<<<<<<<<<<
 * 
 *     def wheretrue(self, limit=None, skip=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2347
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2357
 *         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_51wheretrue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_50wheretrue[] = "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_51wheretrue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_skip = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_filename = __pyx_f[0]; __pyx_lineno = 2357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_filename = __pyx_f[0]; __pyx_lineno = 2357; __pyx_clineno = __LINE__; goto __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_50wheretrue(((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_50wheretrue(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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wheretrue", 0);

  /* "bcolz/carray_ext.pyx":2380
 *         """
 *         # Check self
 *         if self._dtype.base.type != np.bool_:             # <<<<<<<<<<<<<<
 *             raise ValueError("`self` is not an array of booleans")
 *         if self.ndim > 1:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dtype, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2381
 *         # 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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2380
 *         """
 *         # 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":2382
 *         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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2382; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2383
 *             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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2382
 *         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":2384
 *         if self.ndim > 1:
 *             raise NotImplementedError("`self` is not unidimensional")
 *         cview = self.view()             # <<<<<<<<<<<<<<
 *         return cview._init_wheretrue(limit, skip)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2384; __pyx_clineno = __LINE__; goto __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":2385
 *             raise NotImplementedError("`self` is not unidimensional")
 *         cview = self.view()
 *         return cview._init_wheretrue(limit, skip)             # <<<<<<<<<<<<<<
 * 
 *     def _init_wheretrue(self, limit, skip):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cview, __pyx_n_s_init_wheretrue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2385; __pyx_clineno = __LINE__; goto __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":2357
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2387
 *         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_53_init_wheretrue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_52_init_wheretrue[] = "carray._init_wheretrue(self, limit, skip)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_53_init_wheretrue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_skip = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_wheretrue") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_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_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __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_52_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_52_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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  npy_intp __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_wheretrue", 0);

  /* "bcolz/carray_ext.pyx":2388
 * 
 *     def _init_wheretrue(self, limit, skip):
 *         self.reset_iter_sentinels()             # <<<<<<<<<<<<<<
 *         self.wheretrue_mode = True
 *         if limit is not None:
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 2388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2389
 *     def _init_wheretrue(self, limit, skip):
 *         self.reset_iter_sentinels()
 *         self.wheretrue_mode = True             # <<<<<<<<<<<<<<
 *         if limit is not None:
 *             self.limit = limit + skip
 */
  __pyx_v_self->wheretrue_mode = 1;

  /* "bcolz/carray_ext.pyx":2390
 *         self.reset_iter_sentinels()
 *         self.wheretrue_mode = True
 *         if limit is not None:             # <<<<<<<<<<<<<<
 *             self.limit = limit + skip
 *         self.skip = skip
 */
  __pyx_t_2 = (__pyx_v_limit != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2391
 *         self.wheretrue_mode = True
 *         if limit is not None:
 *             self.limit = limit + skip             # <<<<<<<<<<<<<<
 *         self.skip = skip
 *         return iter(self)
 */
    __pyx_t_1 = PyNumber_Add(__pyx_v_limit, __pyx_v_skip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_self->limit = __pyx_t_4;

    /* "bcolz/carray_ext.pyx":2390
 *         self.reset_iter_sentinels()
 *         self.wheretrue_mode = True
 *         if limit is not None:             # <<<<<<<<<<<<<<
 *             self.limit = limit + skip
 *         self.skip = skip
 */
  }

  /* "bcolz/carray_ext.pyx":2392
 *         if limit is not None:
 *             self.limit = limit + skip
 *         self.skip = skip             # <<<<<<<<<<<<<<
 *         return iter(self)
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_skip); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->skip = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":2393
 *             self.limit = limit + skip
 *         self.skip = skip
 *         return iter(self)             # <<<<<<<<<<<<<<
 * 
 *     def where(self, boolarr, limit=None, skip=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2387
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2395
 *         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_55where(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_54where[] = "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_55where(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        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_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __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_54where(((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_54where(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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("where", 0);

  /* "bcolz/carray_ext.pyx":2420
 *         """
 *         # Check input
 *         if self.ndim > 1:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("`self` is not unidimensional")
 *         if not hasattr(boolarr, "dtype"):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2420; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2421
 *         # 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_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2420
 *         """
 *         # Check input
 *         if self.ndim > 1:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("`self` is not unidimensional")
 *         if not hasattr(boolarr, "dtype"):
 */
  }

  /* "bcolz/carray_ext.pyx":2422
 *         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_t_3 = PyObject_HasAttr(__pyx_v_boolarr, __pyx_n_s_dtype); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2423
 *             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_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2422
 *         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":2424
 *         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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_boolarr, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2425
 *             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_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2424
 *         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":2426
 *         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_t_6 = PyObject_Length(__pyx_v_boolarr); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "bcolz/carray_ext.pyx":2427
 *             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_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":2426
 *         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":2429
 *             raise ValueError(
 *                 "`boolarr` must be of the same length than ``self``")
 *         cview = self.view()             # <<<<<<<<<<<<<<
 *         return cview._init_where(boolarr, limit, skip)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2429; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2429; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2429; __pyx_clineno = __LINE__; goto __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":2430
 *                 "`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_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cview, __pyx_n_s_init_where); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __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":2395
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2432
 *         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_57_init_where(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_56_init_where[] = "carray._init_where(self, boolarr, limit, skip)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_57_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_init_where") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __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_56_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_56_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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  npy_intp __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_where", 0);

  /* "bcolz/carray_ext.pyx":2433
 * 
 *     def _init_where(self, boolarr, limit, skip):
 *         self.reset_iter_sentinels()             # <<<<<<<<<<<<<<
 *         self.where_mode = True
 *         self.where_arr = boolarr
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2434
 *     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_v_self->where_mode = 1;

  /* "bcolz/carray_ext.pyx":2435
 *         self.reset_iter_sentinels()
 *         self.where_mode = True
 *         self.where_arr = boolarr             # <<<<<<<<<<<<<<
 *         if limit is not None:
 *             self.limit = limit + skip
 */
  __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":2436
 *         self.where_mode = True
 *         self.where_arr = boolarr
 *         if limit is not None:             # <<<<<<<<<<<<<<
 *             self.limit = limit + skip
 *         self.skip = skip
 */
  __pyx_t_2 = (__pyx_v_limit != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":2437
 *         self.where_arr = boolarr
 *         if limit is not None:
 *             self.limit = limit + skip             # <<<<<<<<<<<<<<
 *         self.skip = skip
 *         return iter(self)
 */
    __pyx_t_1 = PyNumber_Add(__pyx_v_limit, __pyx_v_skip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2437; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_self->limit = __pyx_t_4;

    /* "bcolz/carray_ext.pyx":2436
 *         self.where_mode = True
 *         self.where_arr = boolarr
 *         if limit is not None:             # <<<<<<<<<<<<<<
 *             self.limit = limit + skip
 *         self.skip = skip
 */
  }

  /* "bcolz/carray_ext.pyx":2438
 *         if limit is not None:
 *             self.limit = limit + skip
 *         self.skip = skip             # <<<<<<<<<<<<<<
 *         return iter(self)
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_skip); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->skip = __pyx_t_4;

  /* "bcolz/carray_ext.pyx":2439
 *             self.limit = limit + skip
 *         self.skip = skip
 *         return iter(self)             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2432
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2441
 *         return iter(self)
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef char *vbool
 *         cdef int nhits_buf
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_59__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_59__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_58__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_58__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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "bcolz/carray_ext.pyx":2445
 *         cdef int nhits_buf
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  __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":2446
 * 
 *         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_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":2447
 *         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_t_2 = (__pyx_v_self->where_mode != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;

  /* "bcolz/carray_ext.pyx":2445
 *         cdef int nhits_buf
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2449
 *                 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_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_iter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_next, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2449; __pyx_clineno = __LINE__; goto __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":2445
 *         cdef int nhits_buf
 * 
 *         if not (self.sss_mode or             # <<<<<<<<<<<<<<
 *                 self.wheretrue_mode or
 *                 self.where_mode):
 */
  }

  /* "bcolz/carray_ext.pyx":2451
 *             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_v_self->nextelement = (__pyx_v_self->_nrow + __pyx_v_self->step);

  /* "bcolz/carray_ext.pyx":2452
 * 
 *         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 (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":2453
 *         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_t_2 = ((__pyx_v_self->nextelement >= __pyx_v_self->nrowsread) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2455
 *             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
 */
      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":2456
 *                 # 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_v_self->nrowsread = (__pyx_v_self->nrowsread + __pyx_v_self->nrowsinbuf);
      }

      /* "bcolz/carray_ext.pyx":2458
 *                     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_v_self->stopb = (__pyx_v_self->stop - __pyx_v_self->nrowsread);

      /* "bcolz/carray_ext.pyx":2459
 *                 # 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_t_2 = ((__pyx_v_self->stopb > __pyx_v_self->nrowsinbuf) != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2460
 *                 self.stopb = self.stop - self.nrowsread
 *                 if self.stopb > self.nrowsinbuf:
 *                     self.stopb = self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                 self._row = self.startb - self.step
 * 
 */
        __pyx_t_6 = __pyx_v_self->nrowsinbuf;
        __pyx_v_self->stopb = __pyx_t_6;

        /* "bcolz/carray_ext.pyx":2459
 *                 # 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":2461
 *                 if self.stopb > self.nrowsinbuf:
 *                     self.stopb = self.nrowsinbuf
 *                 self._row = self.startb - self.step             # <<<<<<<<<<<<<<
 * 
 *                 # Skip chunks with zeros if in wheretrue_mode
 */
      __pyx_v_self->_row = (__pyx_v_self->startb - __pyx_v_self->step);

      /* "bcolz/carray_ext.pyx":2464
 * 
 *                 # 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_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":2465
 *                 # 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_v_self->nrowsread = (__pyx_v_self->nrowsread + __pyx_v_self->nrowsinbuf);

        /* "bcolz/carray_ext.pyx":2466
 *                 if self.wheretrue_mode and self.check_zeros(self):
 *                     self.nrowsread += self.nrowsinbuf
 *                     self.nextelement += self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
        __pyx_v_self->nextelement = (__pyx_v_self->nextelement + __pyx_v_self->nrowsinbuf);

        /* "bcolz/carray_ext.pyx":2467
 *                     self.nrowsread += self.nrowsinbuf
 *                     self.nextelement += self.nrowsinbuf
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 if self.where_mode:
 */
        goto __pyx_L7_continue;

        /* "bcolz/carray_ext.pyx":2464
 * 
 *                 # 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":2469
 *                     continue
 * 
 *                 if self.where_mode:             # <<<<<<<<<<<<<<
 *                     # Skip chunks with zeros in where_arr
 *                     if self.check_zeros(self.where_arr):
 */
      __pyx_t_2 = (__pyx_v_self->where_mode != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2471
 *                 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_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":2472
 *                     # Skip chunks with zeros in where_arr
 *                     if self.check_zeros(self.where_arr):
 *                         self.nrowsread += self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                         self.nextelement += self.nrowsinbuf
 *                         continue
 */
          __pyx_v_self->nrowsread = (__pyx_v_self->nrowsread + __pyx_v_self->nrowsinbuf);

          /* "bcolz/carray_ext.pyx":2473
 *                     if self.check_zeros(self.where_arr):
 *                         self.nrowsread += self.nrowsinbuf
 *                         self.nextelement += self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                         continue
 *                     # Read a chunk of the boolean array
 */
          __pyx_v_self->nextelement = (__pyx_v_self->nextelement + __pyx_v_self->nrowsinbuf);

          /* "bcolz/carray_ext.pyx":2474
 *                         self.nrowsread += self.nrowsinbuf
 *                         self.nextelement += self.nrowsinbuf
 *                         continue             # <<<<<<<<<<<<<<
 *                     # Read a chunk of the boolean array
 *                     self.where_buf = self.where_arr[
 */
          goto __pyx_L7_continue;

          /* "bcolz/carray_ext.pyx":2471
 *                 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":2476
 *                         continue
 *                     # Read a chunk of the boolean array
 *                     self.where_buf = self.where_arr[             # <<<<<<<<<<<<<<
 *                                      self.nrowsread:self.nrowsread + self.nrowsinbuf]
 * 
 */
        __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_filename = __pyx_f[0]; __pyx_lineno = 2476; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2476; __pyx_clineno = __LINE__; goto __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":2469
 *                     continue
 * 
 *                 if self.where_mode:             # <<<<<<<<<<<<<<
 *                     # Skip chunks with zeros in where_arr
 *                     if self.check_zeros(self.where_arr):
 */
      }

      /* "bcolz/carray_ext.pyx":2480
 * 
 *                 # Read a data chunk
 *                 self.iobuf = self[             # <<<<<<<<<<<<<<
 *                              self.nrowsread:self.nrowsread + self.nrowsinbuf]
 *                 self.nrowsread += self.nrowsinbuf
 */
      __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_filename = __pyx_f[0]; __pyx_lineno = 2480; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2480; __pyx_clineno = __LINE__; goto __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":2482
 *                 self.iobuf = self[
 *                              self.nrowsread:self.nrowsread + self.nrowsinbuf]
 *                 self.nrowsread += self.nrowsinbuf             # <<<<<<<<<<<<<<
 * 
 *                 # Check if we can skip this buffer
 */
      __pyx_v_self->nrowsread = (__pyx_v_self->nrowsread + __pyx_v_self->nrowsinbuf);

      /* "bcolz/carray_ext.pyx":2485
 * 
 *                 # 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_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":2486
 *                 # 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_t_2 = (__pyx_v_self->wheretrue_mode != 0);
        if (__pyx_t_2) {

          /* "bcolz/carray_ext.pyx":2487
 *                 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_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->iobuf), __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_v_nhits_buf = __pyx_t_6;

          /* "bcolz/carray_ext.pyx":2486
 *                 # 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":2489
 *                         nhits_buf = self.iobuf.sum()
 *                     else:
 *                         nhits_buf = self.where_buf.sum()             # <<<<<<<<<<<<<<
 *                     if (self.nhits + nhits_buf) < self.skip:
 *                         self.nhits += nhits_buf
 */
        /*else*/ {
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->where_buf), __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __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":2490
 *                     else:
 *                         nhits_buf = self.where_buf.sum()
 *                     if (self.nhits + nhits_buf) < self.skip:             # <<<<<<<<<<<<<<
 *                         self.nhits += nhits_buf
 *                         self.nextelement += self.nrowsinbuf
 */
        __pyx_t_2 = (((__pyx_v_self->nhits + __pyx_v_nhits_buf) < __pyx_v_self->skip) != 0);
        if (__pyx_t_2) {

          /* "bcolz/carray_ext.pyx":2491
 *                         nhits_buf = self.where_buf.sum()
 *                     if (self.nhits + nhits_buf) < self.skip:
 *                         self.nhits += nhits_buf             # <<<<<<<<<<<<<<
 *                         self.nextelement += self.nrowsinbuf
 *                         continue
 */
          __pyx_v_self->nhits = (__pyx_v_self->nhits + __pyx_v_nhits_buf);

          /* "bcolz/carray_ext.pyx":2492
 *                     if (self.nhits + nhits_buf) < self.skip:
 *                         self.nhits += nhits_buf
 *                         self.nextelement += self.nrowsinbuf             # <<<<<<<<<<<<<<
 *                         continue
 * 
 */
          __pyx_v_self->nextelement = (__pyx_v_self->nextelement + __pyx_v_self->nrowsinbuf);

          /* "bcolz/carray_ext.pyx":2493
 *                         self.nhits += nhits_buf
 *                         self.nextelement += self.nrowsinbuf
 *                         continue             # <<<<<<<<<<<<<<
 * 
 *             self._row += self.step
 */
          goto __pyx_L7_continue;

          /* "bcolz/carray_ext.pyx":2490
 *                     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":2485
 * 
 *                 # 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":2453
 *         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":2495
 *                         continue
 * 
 *             self._row += self.step             # <<<<<<<<<<<<<<
 *             self._nrow = self.nextelement
 *             if self._row + self.step >= self.stopb:
 */
    __pyx_v_self->_row = (__pyx_v_self->_row + __pyx_v_self->step);

    /* "bcolz/carray_ext.pyx":2496
 * 
 *             self._row += self.step
 *             self._nrow = self.nextelement             # <<<<<<<<<<<<<<
 *             if self._row + self.step >= self.stopb:
 *                 # Compute the start row for the next buffer
 */
    __pyx_t_7 = __pyx_v_self->nextelement;
    __pyx_v_self->_nrow = __pyx_t_7;

    /* "bcolz/carray_ext.pyx":2497
 *             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_t_2 = (((__pyx_v_self->_row + __pyx_v_self->step) >= __pyx_v_self->stopb) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2499
 *             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_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_filename = __pyx_f[0]; __pyx_lineno = 2499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_self->startb = __Pyx_mod_npy_intp(__pyx_t_7, __pyx_v_self->nrowsinbuf);

      /* "bcolz/carray_ext.pyx":2497
 *             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":2500
 *                 # 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_v_self->nextelement = (__pyx_v_self->_nrow + __pyx_v_self->step);

    /* "bcolz/carray_ext.pyx":2503
 * 
 *             # Return a value depending on the mode we are
 *             if self.wheretrue_mode:             # <<<<<<<<<<<<<<
 *                 vbool = <char *> (self.iobuf.data + self._row)
 *                 if vbool[0]:
 */
    __pyx_t_2 = (__pyx_v_self->wheretrue_mode != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2504
 *             # 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_v_vbool = ((char *)(__pyx_v_self->iobuf->data + __pyx_v_self->_row));

      /* "bcolz/carray_ext.pyx":2505
 *             if self.wheretrue_mode:
 *                 vbool = <char *> (self.iobuf.data + self._row)
 *                 if vbool[0]:             # <<<<<<<<<<<<<<
 *                     self.nhits += 1
 *                     if self.nhits <= self.skip:
 */
      __pyx_t_2 = ((__pyx_v_vbool[0]) != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2506
 *                 vbool = <char *> (self.iobuf.data + self._row)
 *                 if vbool[0]:
 *                     self.nhits += 1             # <<<<<<<<<<<<<<
 *                     if self.nhits <= self.skip:
 *                         continue
 */
        __pyx_v_self->nhits = (__pyx_v_self->nhits + 1);

        /* "bcolz/carray_ext.pyx":2507
 *                 if vbool[0]:
 *                     self.nhits += 1
 *                     if self.nhits <= self.skip:             # <<<<<<<<<<<<<<
 *                         continue
 *                     return self._nrow
 */
        __pyx_t_2 = ((__pyx_v_self->nhits <= __pyx_v_self->skip) != 0);
        if (__pyx_t_2) {

          /* "bcolz/carray_ext.pyx":2508
 *                     self.nhits += 1
 *                     if self.nhits <= self.skip:
 *                         continue             # <<<<<<<<<<<<<<
 *                     return self._nrow
 *                 else:
 */
          goto __pyx_L7_continue;

          /* "bcolz/carray_ext.pyx":2507
 *                 if vbool[0]:
 *                     self.nhits += 1
 *                     if self.nhits <= self.skip:             # <<<<<<<<<<<<<<
 *                         continue
 *                     return self._nrow
 */
        }

        /* "bcolz/carray_ext.pyx":2509
 *                     if self.nhits <= self.skip:
 *                         continue
 *                     return self._nrow             # <<<<<<<<<<<<<<
 *                 else:
 *                     continue
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->_nrow); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;

        /* "bcolz/carray_ext.pyx":2505
 *             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":2511
 *                     return self._nrow
 *                 else:
 *                     continue             # <<<<<<<<<<<<<<
 *             if self.where_mode:
 *                 vbool = <char *> (self.where_buf.data + self._row)
 */
      /*else*/ {
        goto __pyx_L7_continue;
      }

      /* "bcolz/carray_ext.pyx":2503
 * 
 *             # 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":2512
 *                 else:
 *                     continue
 *             if self.where_mode:             # <<<<<<<<<<<<<<
 *                 vbool = <char *> (self.where_buf.data + self._row)
 *                 if not vbool[0]:
 */
    __pyx_t_2 = (__pyx_v_self->where_mode != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2513
 *                     continue
 *             if self.where_mode:
 *                 vbool = <char *> (self.where_buf.data + self._row)             # <<<<<<<<<<<<<<
 *                 if not vbool[0]:
 *                     continue
 */
      __pyx_v_vbool = ((char *)(__pyx_v_self->where_buf->data + __pyx_v_self->_row));

      /* "bcolz/carray_ext.pyx":2514
 *             if self.where_mode:
 *                 vbool = <char *> (self.where_buf.data + self._row)
 *                 if not vbool[0]:             # <<<<<<<<<<<<<<
 *                     continue
 *             self.nhits += 1
 */
      __pyx_t_2 = ((!((__pyx_v_vbool[0]) != 0)) != 0);
      if (__pyx_t_2) {

        /* "bcolz/carray_ext.pyx":2515
 *                 vbool = <char *> (self.where_buf.data + self._row)
 *                 if not vbool[0]:
 *                     continue             # <<<<<<<<<<<<<<
 *             self.nhits += 1
 *             if self.nhits <= self.skip:
 */
        goto __pyx_L7_continue;

        /* "bcolz/carray_ext.pyx":2514
 *             if self.where_mode:
 *                 vbool = <char *> (self.where_buf.data + self._row)
 *                 if not vbool[0]:             # <<<<<<<<<<<<<<
 *                     continue
 *             self.nhits += 1
 */
      }

      /* "bcolz/carray_ext.pyx":2512
 *                 else:
 *                     continue
 *             if self.where_mode:             # <<<<<<<<<<<<<<
 *                 vbool = <char *> (self.where_buf.data + self._row)
 *                 if not vbool[0]:
 */
    }

    /* "bcolz/carray_ext.pyx":2516
 *                 if not vbool[0]:
 *                     continue
 *             self.nhits += 1             # <<<<<<<<<<<<<<
 *             if self.nhits <= self.skip:
 *                 continue
 */
    __pyx_v_self->nhits = (__pyx_v_self->nhits + 1);

    /* "bcolz/carray_ext.pyx":2517
 *                     continue
 *             self.nhits += 1
 *             if self.nhits <= self.skip:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Return the current value in I/O buffer
 */
    __pyx_t_2 = ((__pyx_v_self->nhits <= __pyx_v_self->skip) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2518
 *             self.nhits += 1
 *             if self.nhits <= self.skip:
 *                 continue             # <<<<<<<<<<<<<<
 *             # Return the current value in I/O buffer
 *             if self.itemsize == self.atomsize:
 */
      goto __pyx_L7_continue;

      /* "bcolz/carray_ext.pyx":2517
 *                     continue
 *             self.nhits += 1
 *             if self.nhits <= self.skip:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Return the current value in I/O buffer
 */
    }

    /* "bcolz/carray_ext.pyx":2520
 *                 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_t_2 = ((__pyx_v_self->itemsize == __pyx_v_self->atomsize) != 0);
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2521
 *             # 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_XDECREF(__pyx_r);

      /* "bcolz/carray_ext.pyx":2522
 *             if self.itemsize == self.atomsize:
 *                 return PyArray_GETITEM(
 *                     self.iobuf, self.iobuf.data + self._row * self.atomsize)             # <<<<<<<<<<<<<<
 *             else:
 *                 return self.iobuf[self._row]
 */
      __pyx_t_5 = ((PyObject *)__pyx_v_self->iobuf);
      __Pyx_INCREF(__pyx_t_5);

      /* "bcolz/carray_ext.pyx":2521
 *             # 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_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_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __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":2520
 *                 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":2524
 *                     self.iobuf, self.iobuf.data + self._row * self.atomsize)
 *             else:
 *                 return self.iobuf[self._row]             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    /*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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; __pyx_clineno = __LINE__; goto __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":2528
 *         else:
 *             # Release buffers
 *             self.iobuf = np.empty(0, dtype=self._dtype)             # <<<<<<<<<<<<<<
 *             self.where_buf = np.empty(0, dtype=np.bool_)
 *             self.iter_exhausted = True
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2528; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2528; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_v_self->_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__101, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2528; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2528; __pyx_clineno = __LINE__; goto __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":2529
 *             # 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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__102, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __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":2530
 *             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_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":2531
 *             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_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "bcolz/carray_ext.pyx":2441
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2533
 *             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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_zeros", 0);

  /* "bcolz/carray_ext.pyx":2541
 *         cdef chunk chunk_
 * 
 *         if isinstance(barr, carray):             # <<<<<<<<<<<<<<
 *             # Check for zero'ed chunks in carrays
 *             carr = barr
 */
  __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":2543
 *         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):
 */
    if (!(likely(((__pyx_v_barr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_barr, __pyx_ptype_5bcolz_10carray_ext_carray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2543; __pyx_clineno = __LINE__; goto __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":2544
 *             # 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_v_nchunk = ((npy_intp)(__pyx_v_self->nrowsread / __pyx_v_self->nrowsinbuf));

    /* "bcolz/carray_ext.pyx":2545
 *             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_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_filename = __pyx_f[0]; __pyx_lineno = 2545; __pyx_clineno = __LINE__; goto __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":2546
 *             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_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 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_chunk_ = ((struct __pyx_obj_5bcolz_10carray_ext_chunk *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "bcolz/carray_ext.pyx":2547
 *             if nchunk < len(carr.chunks):
 *                 chunk_ = carr.chunks[nchunk]
 *                 if chunk_.isconstant and chunk_.constant in (0, ''):             # <<<<<<<<<<<<<<
 *                     return 1
 *         else:
 */
      __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_filename = __pyx_f[0]; __pyx_lineno = 2547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; __pyx_clineno = __LINE__; goto __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__103, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; __pyx_clineno = __LINE__; goto __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":2548
 *                 chunk_ = carr.chunks[nchunk]
 *                 if chunk_.isconstant and chunk_.constant in (0, ''):
 *                     return 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Check for zero'ed chunks in ndarrays
 */
        __pyx_r = 1;
        goto __pyx_L0;

        /* "bcolz/carray_ext.pyx":2547
 *             if nchunk < len(carr.chunks):
 *                 chunk_ = carr.chunks[nchunk]
 *                 if chunk_.isconstant and chunk_.constant in (0, ''):             # <<<<<<<<<<<<<<
 *                     return 1
 *         else:
 */
      }

      /* "bcolz/carray_ext.pyx":2545
 *             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":2541
 *         cdef chunk chunk_
 * 
 *         if isinstance(barr, carray):             # <<<<<<<<<<<<<<
 *             # Check for zero'ed chunks in carrays
 *             carr = barr
 */
    goto __pyx_L3;
  }

  /* "bcolz/carray_ext.pyx":2551
 *         else:
 *             # Check for zero'ed chunks in ndarrays
 *             ndarr = barr             # <<<<<<<<<<<<<<
 *             bsize = self.nrowsinbuf
 *             if self.nrowsread + bsize > self.len:
 */
  /*else*/ {
    if (!(likely(((__pyx_v_barr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_barr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __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":2552
 *             # Check for zero'ed chunks in ndarrays
 *             ndarr = barr
 *             bsize = self.nrowsinbuf             # <<<<<<<<<<<<<<
 *             if self.nrowsread + bsize > self.len:
 *                 bsize = self.len - self.nrowsread
 */
    __pyx_t_7 = __pyx_v_self->nrowsinbuf;
    __pyx_v_bsize = __pyx_t_7;

    /* "bcolz/carray_ext.pyx":2553
 *             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_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_self->nrowsread + __pyx_v_bsize)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2553; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2553; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__pyx_t_2) {

      /* "bcolz/carray_ext.pyx":2554
 *             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_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_bsize = __pyx_t_7;

      /* "bcolz/carray_ext.pyx":2553
 *             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":2555
 *             if self.nrowsread + bsize > self.len:
 *                 bsize = self.len - self.nrowsread
 *             if check_zeros(ndarr.data + self.nrowsread, bsize):             # <<<<<<<<<<<<<<
 *                 return 1
 *         return 0
 */
    __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":2556
 *                 bsize = self.len - self.nrowsread
 *             if check_zeros(ndarr.data + self.nrowsread, bsize):
 *                 return 1             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
      __pyx_r = 1;
      goto __pyx_L0;

      /* "bcolz/carray_ext.pyx":2555
 *             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":2557
 *             if check_zeros(ndarr.data + self.nrowsread, bsize):
 *                 return 1
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def _update_disk_sizes(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2533
 *             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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2559
 *         return 0
 * 
 *     def _update_disk_sizes(self):             # <<<<<<<<<<<<<<
 *         """Update the sizes on-disk."""
 *         sizes = dict()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_61_update_disk_sizes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_60_update_disk_sizes[] = "carray._update_disk_sizes(self)\nUpdate the sizes on-disk.";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_61_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_60_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_60_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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_update_disk_sizes", 0);

  /* "bcolz/carray_ext.pyx":2561
 *     def _update_disk_sizes(self):
 *         """Update the sizes on-disk."""
 *         sizes = dict()             # <<<<<<<<<<<<<<
 *         if self._rootdir:
 *             sizes['shape'] = self.shape
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sizes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":2562
 *         """Update the sizes on-disk."""
 *         sizes = dict()
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             sizes['shape'] = self.shape
 *             sizes['nbytes'] = self.nbytes
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_rootdir); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2563
 *         sizes = dict()
 *         if self._rootdir:
 *             sizes['shape'] = self.shape             # <<<<<<<<<<<<<<
 *             sizes['nbytes'] = self.nbytes
 *             sizes['cbytes'] = self.cbytes
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyDict_SetItem(__pyx_v_sizes, __pyx_n_s_shape, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2564
 *         if self._rootdir:
 *             sizes['shape'] = self.shape
 *             sizes['nbytes'] = self.nbytes             # <<<<<<<<<<<<<<
 *             sizes['cbytes'] = self.cbytes
 *             rowsf = os.path.join(self.metadir, SIZES_FILE)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyDict_SetItem(__pyx_v_sizes, __pyx_n_s_nbytes, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2565
 *             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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyDict_SetItem(__pyx_v_sizes, __pyx_n_s_cbytes, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":2566
 *             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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __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":2567
 *             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'))
 */
    /*with:*/ {
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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_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":2568
 *             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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rowsfh, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_3);

            /* "bcolz/carray_ext.pyx":2569
 *             with open(rowsf, 'wb') as rowsfh:
 *                 rowsfh.write(
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))             # <<<<<<<<<<<<<<
 *                 rowsfh.write(b'\n')
 * 
 */
            __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_json); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_5);
            if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_ensure_ascii, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __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__104, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __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":2570
 *                 rowsfh.write(
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))
 *                 rowsfh.write(b'\n')             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_rowsfh, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2570; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2570; __pyx_clineno = __LINE__; goto __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":2567
 *             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_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_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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_ErrRestore(__pyx_t_3, __pyx_t_7, __pyx_t_1);
              __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_1 = 0; 
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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_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_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__106, NULL);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __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":2562
 *         """Update the sizes on-disk."""
 *         sizes = dict()
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             sizes['shape'] = self.shape
 *             sizes['nbytes'] = self.nbytes
 */
  }

  /* "bcolz/carray_ext.pyx":2559
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2572
 *                 rowsfh.write(b'\n')
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         """Flush data in internal buffers to disk.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_63flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_62flush[] = "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_63flush(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_62flush(((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_62flush(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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flush", 0);

  /* "bcolz/carray_ext.pyx":2584
 *         cdef int leftover_atoms
 * 
 *         if self._rootdir is None:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_rootdir == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2585
 * 
 *         if self._rootdir is None:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if self.leftover:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "bcolz/carray_ext.pyx":2584
 *         cdef int leftover_atoms
 * 
 *         if self._rootdir is None:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":2587
 *             return
 * 
 *         if self.leftover:             # <<<<<<<<<<<<<<
 *             leftover_atoms = cython.cdiv(self.leftover, self.atomsize)
 *             chunk_ = chunk(self.lastchunkarr[:leftover_atoms], self.dtype,
 */
  __pyx_t_2 = (__pyx_v_self->leftover != 0);
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2588
 * 
 *         if self.leftover:
 *             leftover_atoms = cython.cdiv(self.leftover, self.atomsize)             # <<<<<<<<<<<<<<
 *             chunk_ = chunk(self.lastchunkarr[:leftover_atoms], self.dtype,
 *                            self.cparams,
 */
    __pyx_v_leftover_atoms = (__pyx_v_self->leftover / __pyx_v_self->atomsize);

    /* "bcolz/carray_ext.pyx":2589
 *         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_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_filename = __pyx_f[0]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);

    /* "bcolz/carray_ext.pyx":2590
 *             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_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);

    /* "bcolz/carray_ext.pyx":2589
 *         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_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __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":2591
 *             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_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":2589
 *         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_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5bcolz_10carray_ext_chunk), __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2589; __pyx_clineno = __LINE__; goto __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":2593
 *                            _memory=self._rootdir is None)
 *             # Flush this chunk to disk
 *             self.chunks.flush(chunk_)             # <<<<<<<<<<<<<<
 * 
 *         # Finally, update the sizes metadata on-disk
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->chunks, __pyx_n_s_flush); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __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":2587
 *             return
 * 
 *         if self.leftover:             # <<<<<<<<<<<<<<
 *             leftover_atoms = cython.cdiv(self.leftover, self.atomsize)
 *             chunk_ = chunk(self.lastchunkarr[:leftover_atoms], self.dtype,
 */
  }

  /* "bcolz/carray_ext.pyx":2596
 * 
 *         # Finally, update the sizes metadata on-disk
 *         self._update_disk_sizes()             # <<<<<<<<<<<<<<
 * 
 *     # XXX This does not work.  Will have to realize how to properly
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update_disk_sizes); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __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":2572
 *                 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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2604
 *     #   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_65purge(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_64purge[] = "carray.purge(self)\n Remove the underlying data for on-disk arrays. ";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_65purge(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_64purge(((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_64purge(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("purge", 0);

  /* "bcolz/carray_ext.pyx":2606
 *     def purge(self):
 *         """ Remove the underlying data for on-disk arrays. """
 *         if self.rootdir:             # <<<<<<<<<<<<<<
 *             shutil.rmtree(self.rootdir)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rootdir); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2607
 *         """ Remove the underlying data for on-disk arrays. """
 *         if self.rootdir:
 *             shutil.rmtree(self.rootdir)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_shutil); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2607; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2607; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2607; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2607; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2607; __pyx_clineno = __LINE__; goto __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":2606
 *     def purge(self):
 *         """ Remove the underlying data for on-disk arrays. """
 *         if self.rootdir:             # <<<<<<<<<<<<<<
 *             shutil.rmtree(self.rootdir)
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":2604
 *     #   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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2609
 *             shutil.rmtree(self.rootdir)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return array2string(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_67__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_67__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_66__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_66__str__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "bcolz/carray_ext.pyx":2610
 * 
 *     def __str__(self):
 *         return array2string(self)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_array2string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __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":2609
 *             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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2612
 *         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_69__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_69__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5bcolz_10carray_ext_6carray_68__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_68__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_fullrepr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "bcolz/carray_ext.pyx":2613
 * 
 *     def __repr__(self):
 *         snbytes = utils.human_readable_size(self._nbytes)             # <<<<<<<<<<<<<<
 *         scbytes = utils.human_readable_size(self._cbytes)
 *         if not self._cbytes:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __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":2614
 *     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_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_utils); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2614; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2614; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2614; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2614; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2614; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2614; __pyx_clineno = __LINE__; goto __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":2615
 *         snbytes = utils.human_readable_size(self._nbytes)
 *         scbytes = utils.human_readable_size(self._cbytes)
 *         if not self._cbytes:             # <<<<<<<<<<<<<<
 *             cratio = np.nan
 *         else:
 */
  __pyx_t_6 = ((!(__pyx_v_self->_cbytes != 0)) != 0);
  if (__pyx_t_6) {

    /* "bcolz/carray_ext.pyx":2616
 *         scbytes = utils.human_readable_size(self._cbytes)
 *         if not self._cbytes:
 *             cratio = np.nan             # <<<<<<<<<<<<<<
 *         else:
 *             cratio = self._nbytes / float(self._cbytes)
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __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":2615
 *         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":2618
 *             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" % (
 */
  /*else*/ {
    if (unlikely(((double)__pyx_v_self->_cbytes) == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->_nbytes / ((double)__pyx_v_self->_cbytes))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_cratio = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":2619
 *         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_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __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":2621
 *         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
 *         if self._rootdir:
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2621; __pyx_clineno = __LINE__; goto __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":2620
 *             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_t_4 = __Pyx_PyString_Format(__pyx_kp_s_nbytes_s_cbytes_s_ratio_2f, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2620; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2620; __pyx_clineno = __LINE__; goto __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":2622
 *         header += "  nbytes: %s; cbytes: %s; ratio: %.2f\n" % (
 *             snbytes, scbytes, cratio)
 *         header += "  cparams := %r\n" % self.cparams             # <<<<<<<<<<<<<<
 *         if self._rootdir:
 *             header += "  rootdir := '%s'\n" % self._rootdir
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cparams); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __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":2623
 *             snbytes, scbytes, cratio)
 *         header += "  cparams := %r\n" % self.cparams
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             header += "  rootdir := '%s'\n" % self._rootdir
 *             header += "  mode    := '%s'\n" % self.mode
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_self->_rootdir); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "bcolz/carray_ext.pyx":2624
 *         header += "  cparams := %r\n" % self.cparams
 *         if self._rootdir:
 *             header += "  rootdir := '%s'\n" % self._rootdir             # <<<<<<<<<<<<<<
 *             header += "  mode    := '%s'\n" % self.mode
 *         fullrepr = header + str(self)
 */
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_rootdir_s, __pyx_v_self->_rootdir); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_header, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_header, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":2625
 *         if self._rootdir:
 *             header += "  rootdir := '%s'\n" % self._rootdir
 *             header += "  mode    := '%s'\n" % self.mode             # <<<<<<<<<<<<<<
 *         fullrepr = header + str(self)
 *         return fullrepr
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_mode_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_header, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_header, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "bcolz/carray_ext.pyx":2623
 *             snbytes, scbytes, cratio)
 *         header += "  cparams := %r\n" % self.cparams
 *         if self._rootdir:             # <<<<<<<<<<<<<<
 *             header += "  rootdir := '%s'\n" % self._rootdir
 *             header += "  mode    := '%s'\n" % self.mode
 */
  }

  /* "bcolz/carray_ext.pyx":2626
 *             header += "  rootdir := '%s'\n" % self._rootdir
 *             header += "  mode    := '%s'\n" % self.mode
 *         fullrepr = header + str(self)             # <<<<<<<<<<<<<<
 *         return fullrepr
 * 
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_v_header, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fullrepr = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "bcolz/carray_ext.pyx":2627
 *             header += "  mode    := '%s'\n" % self.mode
 *         fullrepr = header + str(self)
 *         return fullrepr             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fullrepr);
  __pyx_r = __pyx_v_fullrepr;
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2612
 *         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_fullrepr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2629
 *         return fullrepr
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         if self.rootdir:
 *             return (build_carray, (None,self.rootdir,))
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_71__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_70__reduce__[] = "carray.__reduce__(self)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_71__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_70__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_70__reduce__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "bcolz/carray_ext.pyx":2630
 * 
 *     def __reduce__(self):
 *         if self.rootdir:             # <<<<<<<<<<<<<<
 *             return (build_carray, (None,self.rootdir,))
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rootdir); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2631
 *     def __reduce__(self):
 *         if self.rootdir:
 *             return (build_carray, (None,self.rootdir,))             # <<<<<<<<<<<<<<
 *         else:
 *             return (build_carray,(self[:],None,))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_build_carray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2631; __pyx_clineno = __LINE__; goto __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":2630
 * 
 *     def __reduce__(self):
 *         if self.rootdir:             # <<<<<<<<<<<<<<
 *             return (build_carray, (None,self.rootdir,))
 *         else:
 */
  }

  /* "bcolz/carray_ext.pyx":2633
 *             return (build_carray, (None,self.rootdir,))
 *         else:
 *             return (build_carray,(self[:],None,))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_build_carray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self), 0, 0, NULL, NULL, &__pyx_slice__107, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __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":2629
 *         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_RefNannyFinishContext();
  return __pyx_r;
}

/* "bcolz/carray_ext.pyx":2636
 * 
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_73__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_72__enter__[] = "carray.__enter__(self)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_73__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_72__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_72__enter__(struct __pyx_obj_5bcolz_10carray_ext_carray *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "bcolz/carray_ext.pyx":2637
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, type, value, tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "bcolz/carray_ext.pyx":2636
 * 
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "bcolz/carray_ext.pyx":2639
 *         return self
 * 
 *     def __exit__(self, type, value, tb):             # <<<<<<<<<<<<<<
 *         if self.mode != 'r':
 *             self.flush()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_75__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5bcolz_10carray_ext_6carray_74__exit__[] = "carray.__exit__(self, type, value, tb)";
static PyObject *__pyx_pw_5bcolz_10carray_ext_6carray_75__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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_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_filename = __pyx_f[0]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2639; __pyx_clineno = __LINE__; goto __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_74__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_74__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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "bcolz/carray_ext.pyx":2640
 * 
 *     def __exit__(self, type, value, tb):
 *         if self.mode != 'r':             # <<<<<<<<<<<<<<
 *             self.flush()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "bcolz/carray_ext.pyx":2641
 *     def __exit__(self, type, value, tb):
 *         if self.mode != 'r':
 *             self.flush()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flush); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2641; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2641; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 2641; __pyx_clineno = __LINE__; goto __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":2640
 * 
 *     def __exit__(self, type, value, tb):
 *         if self.mode != 'r':             # <<<<<<<<<<<<<<
 *             self.flush()
 * 
 */
  }

  /* "bcolz/carray_ext.pyx":2639
 *         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_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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->atomsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __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_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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->chunks);
  __pyx_r = __pyx_v_self->chunks;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __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;
  __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_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __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;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../home/faltet/miniconda/lib/python2.7/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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_endian_detector = 1;

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "../../home/faltet/miniconda/lib/python2.7/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_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;

    /* "../../home/faltet/miniconda/lib/python2.7/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;
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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)
 */
  /*else*/ {
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "../../home/faltet/miniconda/lib/python2.7/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_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;
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;

  /* "../../home/faltet/miniconda/lib/python2.7/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")
 */
  if (__pyx_t_1) {

    /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "../../home/faltet/miniconda/lib/python2.7/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")
 */
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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_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;
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;

  /* "../../home/faltet/miniconda/lib/python2.7/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")
 */
  if (__pyx_t_1) {

    /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "../../home/faltet/miniconda/lib/python2.7/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")
 */
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->ndim = __pyx_v_ndim;

  /* "../../home/faltet/miniconda/lib/python2.7/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_t_1 = (__pyx_v_copy_shape != 0);
  if (__pyx_t_1) {

    /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "../../home/faltet/miniconda/lib/python2.7/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_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;

      /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }

    /* "../../home/faltet/miniconda/lib/python2.7/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;
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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
 */
  /*else*/ {
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L11:;

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->suboffsets = NULL;

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));

  /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef int offset
 */
  __pyx_v_f = NULL;

  /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef int offset
 * 
 */
  __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;

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "../../home/faltet/miniconda/lib/python2.7/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_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) {

    /* "../../home/faltet/miniconda/lib/python2.7/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_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;

    /* "../../home/faltet/miniconda/lib/python2.7/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;
  }

  /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
  /*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:;

  /* "../../home/faltet/miniconda/lib/python2.7/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_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_1) {

    /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "../../home/faltet/miniconda/lib/python2.7/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_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:;

    /* "../../home/faltet/miniconda/lib/python2.7/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_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:;

    /* "../../home/faltet/miniconda/lib/python2.7/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")
 */
    if (__pyx_t_1) {

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "../../home/faltet/miniconda/lib/python2.7/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")
 */
    }

    /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
    switch (__pyx_v_t) {
      case NPY_BYTE:
      __pyx_v_f = __pyx_k_b;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_UBYTE:
      __pyx_v_f = __pyx_k_B_2;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_SHORT:
      __pyx_v_f = __pyx_k_h;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_USHORT:
      __pyx_v_f = __pyx_k_H;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_INT:
      __pyx_v_f = __pyx_k_i;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_UINT:
      __pyx_v_f = __pyx_k_I_2;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_LONG:
      __pyx_v_f = __pyx_k_l;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_ULONG:
      __pyx_v_f = __pyx_k_L;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_LONGLONG:
      __pyx_v_f = __pyx_k_q_2;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_ULONGLONG:
      __pyx_v_f = __pyx_k_Q;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_FLOAT:
      __pyx_v_f = __pyx_k_f;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_DOUBLE:
      __pyx_v_f = __pyx_k_d;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_LONGDOUBLE:
      __pyx_v_f = __pyx_k_g;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_CFLOAT:
      __pyx_v_f = __pyx_k_Zf;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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"
 */
      case NPY_CDOUBLE:
      __pyx_v_f = __pyx_k_Zd;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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:
 */
      case NPY_CLONGDOUBLE:
      __pyx_v_f = __pyx_k_Zg;
      break;

      /* "../../home/faltet/miniconda/lib/python2.7/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)
 */
      case NPY_OBJECT:
      __pyx_v_f = __pyx_k_O;
      break;
      default:

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }

    /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->format = __pyx_v_f;

    /* "../../home/faltet/miniconda/lib/python2.7/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_r = 0;
    goto __pyx_L0;

    /* "../../home/faltet/miniconda/lib/python2.7/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
 */
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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
 */
  /*else*/ {
    __pyx_v_info->format = ((char *)malloc(0xFF));

    /* "../../home/faltet/miniconda/lib/python2.7/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_v_info->format[0]) = '^';

    /* "../../home/faltet/miniconda/lib/python2.7/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_v_offset = 0;

    /* "../../home/faltet/miniconda/lib/python2.7/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_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_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_7;

    /* "../../home/faltet/miniconda/lib/python2.7/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_v_f[0]) = '\x00';
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "../../home/faltet/miniconda/lib/python2.7/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_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  if (__pyx_t_1) {

    /* "../../home/faltet/miniconda/lib/python2.7/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)
 */
    free(__pyx_v_info->format);

    /* "../../home/faltet/miniconda/lib/python2.7/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):
 */
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../home/faltet/miniconda/lib/python2.7/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
 * 
 */
    free(__pyx_v_info->strides);

    /* "../../home/faltet/miniconda/lib/python2.7/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
 */
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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 */
  __Pyx_RefNannyFinishContext();
}

/* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "../../home/faltet/miniconda/lib/python2.7/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_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "../../home/faltet/miniconda/lib/python2.7/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_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "../../home/faltet/miniconda/lib/python2.7/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_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "../../home/faltet/miniconda/lib/python2.7/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_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "../../home/faltet/miniconda/lib/python2.7/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_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../home/faltet/miniconda/lib/python2.7/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_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_endian_detector = 1;

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(__pyx_v_descr->names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    if (unlikely(__pyx_v_descr->fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "../../home/faltet/miniconda/lib/python2.7/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:
 */
    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_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __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;

    /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __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) {

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "../../home/faltet/miniconda/lib/python2.7/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")
 * 
 */
    }

    /* "../../home/faltet/miniconda/lib/python2.7/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_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:;

    /* "../../home/faltet/miniconda/lib/python2.7/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_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:;

    /* "../../home/faltet/miniconda/lib/python2.7/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")
 */
    if (__pyx_t_6) {

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "../../home/faltet/miniconda/lib/python2.7/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")
 */
    }

    /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_6) break;

      /* "../../home/faltet/miniconda/lib/python2.7/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_v_f[0]) = 0x78;

      /* "../../home/faltet/miniconda/lib/python2.7/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_v_f = (__pyx_v_f + 1);

      /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_8 = 0;
      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
    }

    /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_8 = 0;
    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);

    /* "../../home/faltet/miniconda/lib/python2.7/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_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
    if (__pyx_t_6) {

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
      if (__pyx_t_6) {

        /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "../../home/faltet/miniconda/lib/python2.7/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.")
 * 
 */
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x68;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x69;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x6C;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x71;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x66;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x64;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 0x67;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __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;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __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;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __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;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L15;
      }

      /* "../../home/faltet/miniconda/lib/python2.7/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:
 */
      /*else*/ {
        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L15:;

      /* "../../home/faltet/miniconda/lib/python2.7/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_v_f = (__pyx_v_f + 1);

      /* "../../home/faltet/miniconda/lib/python2.7/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;
    }

    /* "../../home/faltet/miniconda/lib/python2.7/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
 * 
 */
    /*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_filename = __pyx_f[2]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "../../home/faltet/miniconda/lib/python2.7/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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "../../home/faltet/miniconda/lib/python2.7/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_t_1 = (__pyx_v_base == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "../../home/faltet/miniconda/lib/python2.7/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_v_baseptr = NULL;

    /* "../../home/faltet/miniconda/lib/python2.7/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;
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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)
 */
  /*else*/ {
    Py_INCREF(__pyx_v_base);

    /* "../../home/faltet/miniconda/lib/python2.7/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_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "../../home/faltet/miniconda/lib/python2.7/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
 * 
 */
  Py_XDECREF(__pyx_v_arr->base);

  /* "../../home/faltet/miniconda/lib/python2.7/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_v_arr->base = __pyx_v_baseptr;

  /* "../../home/faltet/miniconda/lib/python2.7/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 */
  __Pyx_RefNannyFinishContext();
}

/* "../../home/faltet/miniconda/lib/python2.7/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_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "../../home/faltet/miniconda/lib/python2.7/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_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  if (__pyx_t_1) {

    /* "../../home/faltet/miniconda/lib/python2.7/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_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  }

  /* "../../home/faltet/miniconda/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }

  /* "../../home/faltet/miniconda/lib/python2.7/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_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __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, __pyx_k_The_NumPy_dtype_for_this_chunk, 0},
  {(char *)"atomsize", __pyx_getprop_5bcolz_10carray_ext_5chunk_atomsize, __pyx_setprop_5bcolz_10carray_ext_5chunk_atomsize, __pyx_k_atomsize_int, 0},
  {(char *)"itemsize", __pyx_getprop_5bcolz_10carray_ext_5chunk_itemsize, __pyx_setprop_5bcolz_10carray_ext_5chunk_itemsize, __pyx_k_itemsize_int, 0},
  {(char *)"blocksize", __pyx_getprop_5bcolz_10carray_ext_5chunk_blocksize, __pyx_setprop_5bcolz_10carray_ext_5chunk_blocksize, __pyx_k_blocksize_int, 0},
  {(char *)"nbytes", __pyx_getprop_5bcolz_10carray_ext_5chunk_nbytes, __pyx_setprop_5bcolz_10carray_ext_5chunk_nbytes, __pyx_k_nbytes_int, 0},
  {(char *)"cbytes", __pyx_getprop_5bcolz_10carray_ext_5chunk_cbytes, __pyx_setprop_5bcolz_10carray_ext_5chunk_cbytes, __pyx_k_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, __pyx_k_The_mode_used_to_create_open_the, 0},
  {(char *)"rootdir", __pyx_getprop_5bcolz_10carray_ext_6chunks_rootdir, __pyx_setprop_5bcolz_10carray_ext_6chunks_rootdir, __pyx_k_The_on_disk_directory_used_for_p, 0},
  {(char *)"datadir", __pyx_getprop_5bcolz_10carray_ext_6chunks_datadir, 0, __pyx_k_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},
  {"_getrange", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_43_getrange, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_42_getrange},
  {"iter", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_47iter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_46iter},
  {"_init_iter", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_49_init_iter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_48_init_iter},
  {"wheretrue", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_51wheretrue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_50wheretrue},
  {"_init_wheretrue", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_53_init_wheretrue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_52_init_wheretrue},
  {"where", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_55where, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_54where},
  {"_init_where", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_57_init_where, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_56_init_where},
  {"__next__", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_59__next__, METH_NOARGS|METH_COEXIST, 0},
  {"_update_disk_sizes", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_61_update_disk_sizes, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_60_update_disk_sizes},
  {"flush", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_63flush, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_62flush},
  {"purge", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_65purge, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_64purge},
  {"__reduce__", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_71__reduce__, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_70__reduce__},
  {"__enter__", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_73__enter__, METH_NOARGS, __pyx_doc_5bcolz_10carray_ext_6carray_72__enter__},
  {"__exit__", (PyCFunction)__pyx_pw_5bcolz_10carray_ext_6carray_75__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5bcolz_10carray_ext_6carray_74__exit__},
  {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, __pyx_k_Pointer_referring_to_the_leftove, 0},
  {(char *)"leftover_array", __pyx_getprop_5bcolz_10carray_ext_6carray_leftover_array, 0, __pyx_k_Array_containing_the_leftovers_c, 0},
  {(char *)"leftover_bytes", __pyx_getprop_5bcolz_10carray_ext_6carray_leftover_bytes, 0, __pyx_k_Number_of_bytes_in_the_leftover, 0},
  {(char *)"leftover_elements", __pyx_getprop_5bcolz_10carray_ext_6carray_leftover_elements, 0, __pyx_k_Number_of_elements_in_the_leftov, 0},
  {(char *)"nchunks", __pyx_getprop_5bcolz_10carray_ext_6carray_nchunks, 0, __pyx_k_Number_of_chunks_in_the_carray, 0},
  {(char *)"partitions", __pyx_getprop_5bcolz_10carray_ext_6carray_partitions, 0, __pyx_k_List_of_tuples_indicating_the_bo, 0},
  {(char *)"attrs", __pyx_getprop_5bcolz_10carray_ext_6carray_attrs, 0, __pyx_k_The_attribute_accessor_See_Also, 0},
  {(char *)"cbytes", __pyx_getprop_5bcolz_10carray_ext_6carray_cbytes, 0, __pyx_k_The_compressed_size_of_this_obje, 0},
  {(char *)"chunklen", __pyx_getprop_5bcolz_10carray_ext_6carray_chunklen, 0, __pyx_k_The_chunklen_of_this_object_in_r, 0},
  {(char *)"cparams", __pyx_getprop_5bcolz_10carray_ext_6carray_cparams, 0, __pyx_k_The_compression_parameters_for_t, 0},
  {(char *)"dflt", __pyx_getprop_5bcolz_10carray_ext_6carray_dflt, 0, __pyx_k_The_default_value_of_this_object, 0},
  {(char *)"dtype", __pyx_getprop_5bcolz_10carray_ext_6carray_dtype, 0, __pyx_k_The_dtype_of_this_object, 0},
  {(char *)"len", __pyx_getprop_5bcolz_10carray_ext_6carray_len, 0, __pyx_k_The_length_leading_dimension_of, 0},
  {(char *)"mode", __pyx_getprop_5bcolz_10carray_ext_6carray_mode, __pyx_setprop_5bcolz_10carray_ext_6carray_mode, __pyx_k_The_mode_used_to_create_open_the, 0},
  {(char *)"nbytes", __pyx_getprop_5bcolz_10carray_ext_6carray_nbytes, 0, __pyx_k_The_original_uncompressed_size_o, 0},
  {(char *)"nleftover", __pyx_getprop_5bcolz_10carray_ext_6carray_nleftover, 0, __pyx_k_The_number_of_leftover_elements, 0},
  {(char *)"ndim", __pyx_getprop_5bcolz_10carray_ext_6carray_ndim, 0, __pyx_k_The_number_of_dimensions_of_this, 0},
  {(char *)"safe", __pyx_getprop_5bcolz_10carray_ext_6carray_safe, 0, __pyx_k_Whether_or_not_to_perform_type_s, 0},
  {(char *)"shape", __pyx_getprop_5bcolz_10carray_ext_6carray_shape, 0, __pyx_k_The_shape_of_this_object, 0},
  {(char *)"size", __pyx_getprop_5bcolz_10carray_ext_6carray_size, 0, __pyx_k_The_size_of_this_object, 0},
  {(char *)"rootdir", __pyx_getprop_5bcolz_10carray_ext_6carray_rootdir, __pyx_setprop_5bcolz_10carray_ext_6carray_rootdir, __pyx_k_The_on_disk_directory_used_for_p, 0},
  {(char *)"itemsize", __pyx_getprop_5bcolz_10carray_ext_6carray_itemsize, __pyx_setprop_5bcolz_10carray_ext_6carray_itemsize, __pyx_k_itemsize_int, 0},
  {(char *)"atomsize", __pyx_getprop_5bcolz_10carray_ext_6carray_atomsize, __pyx_setprop_5bcolz_10carray_ext_6carray_atomsize, __pyx_k_atomsize_int, 0},
  {(char *)"chunks", __pyx_getprop_5bcolz_10carray_ext_6carray_chunks, __pyx_setprop_5bcolz_10carray_ext_6carray_chunks, __pyx_k_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_69__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_67__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 in-memory data container.\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_45__iter__, /*tp_iter*/
  __pyx_pw_5bcolz_10carray_ext_6carray_59__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_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__103, __pyx_k__103, sizeof(__pyx_k__103), 0, 0, 1, 0},
  {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
  {&__pyx_kp_b__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 0, 0},
  {&__pyx_kp_b__9, __pyx_k__9, sizeof(__pyx_k__9), 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_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_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_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_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_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_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_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_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_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_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_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_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_kp_s_tmp_bcolz_bcolz_carray_ext_pyx, __pyx_k_tmp_bcolz_bcolz_carray_ext_pyx, sizeof(__pyx_k_tmp_bcolz_bcolz_carray_ext_pyx), 0, 0, 1, 0},
  {&__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_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_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "bcolz/carray_ext.pyx":150
 *     """
 *     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_ = PyTuple_Pack(2, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "bcolz/carray_ext.pyx":153
 *         # Convert compressor names into regular strings in Python 3 (unicode)
 *         list_compr = list_compr.decode()
 *     clist = list_compr.split(',')             # <<<<<<<<<<<<<<
 *     return clist
 * 
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "bcolz/carray_ext.pyx":213
 *     """
 *     if isinstance(lst, bytes):
 *         return lst.decode('ascii')             # <<<<<<<<<<<<<<
 *     elif isinstance(lst, list):
 *         return [list_bytes_to_str(x) for x in lst]
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "bcolz/carray_ext.pyx":477
 *             # 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__5 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "bcolz/carray_ext.pyx":498
 *         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__6 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "bcolz/carray_ext.pyx":537
 *     def __str__(self):
 *         """Represent the chunk as an string."""
 *         return str(self[:])             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__7);
  __Pyx_GIVEREF(__pyx_slice__7);

  /* "bcolz/carray_ext.pyx":602
 * else:
 *     def decode_byte(byte):
 *         return int(byte.encode('hex'), 16)             # <<<<<<<<<<<<<<
 * def decode_uint32(fourbyte):
 *     return struct.unpack('<I', fourbyte)[0]
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_hex); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "bcolz/carray_ext.pyx":642
 *             '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__11 = PySlice_New(__pyx_int_4, __pyx_int_8, Py_None); if (unlikely(!__pyx_slice__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__11);
  __Pyx_GIVEREF(__pyx_slice__11);

  /* "bcolz/carray_ext.pyx":643
 *             '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__12 = PySlice_New(__pyx_int_8, __pyx_int_12, Py_None); if (unlikely(!__pyx_slice__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__12);
  __Pyx_GIVEREF(__pyx_slice__12);

  /* "bcolz/carray_ext.pyx":644
 *             'nbytes': decode_uint32(buffer_[4:8]),
 *             'blocksize': decode_uint32(buffer_[8:12]),
 *             'ctbytes': decode_uint32(buffer_[12:16])}             # <<<<<<<<<<<<<<
 * 
 * cdef class chunks(object):
 */
  __pyx_slice__13 = PySlice_New(__pyx_int_12, __pyx_int_16, Py_None); if (unlikely(!__pyx_slice__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__13);
  __Pyx_GIVEREF(__pyx_slice__13);

  /* "bcolz/carray_ext.pyx":715
 *         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__14 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "bcolz/carray_ext.pyx":781
 *         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__15 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "bcolz/carray_ext.pyx":993
 *         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__16 = PyTuple_Pack(1, __pyx_kp_s_cannot_modify_the_rootdir_value); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "bcolz/carray_ext.pyx":1005
 *         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__17 = PyTuple_Pack(1, __pyx_kp_s_mode_should_be_r_w_or_a); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "bcolz/carray_ext.pyx":1018
 *             _new = False
 *         else:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "You need at least to pass an array or/and a rootdir")
 * 
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_You_need_at_least_to_pass_an_arr); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "bcolz/carray_ext.pyx":1025
 * 
 *         # Cache a len-1 array for accelerating self[int] case
 *         self.arr1 = np.empty(shape=(1,), dtype=self._dtype)             # <<<<<<<<<<<<<<
 * 
 *         # Sentinels
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "bcolz/carray_ext.pyx":1041
 *                 raise TypeError(repr(dtype_) + " is not a supported dtype")
 *         else:
 *             dtype_ = np.dtype((dtype_, shape[1:]))             # <<<<<<<<<<<<<<
 * 
 *         return dtype_
 */
  __pyx_slice__20 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__20);
  __Pyx_GIVEREF(__pyx_slice__20);

  /* "bcolz/carray_ext.pyx":1064
 * 
 *         if not isinstance(cparams, bcolz.cparams):
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "`cparams` param must be an instance of `cparams` class")
 * 
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_cparams_param_must_be_an_instan); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "bcolz/carray_ext.pyx":1077
 *         # (especially when dtypes and compression params match)
 *         if isinstance(array, carray):
 *             array = array[:]             # <<<<<<<<<<<<<<
 * 
 *         array_ = utils.to_ndarray(array, dtype)
 */
  __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__22);
  __Pyx_GIVEREF(__pyx_slice__22);

  /* "bcolz/carray_ext.pyx":1097
 *         # 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__23 = PyTuple_Pack(1, __pyx_kp_s_atomic_size_is_too_large_2_GB); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "bcolz/carray_ext.pyx":1101
 *         # 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__24 = PyTuple_Pack(1, __pyx_kp_s_atomic_size_cannot_be_zero); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "bcolz/carray_ext.pyx":1107
 * 
 *         # Check defaults for dflt
 *         _dflt = np.zeros((), dtype=dtype)             # <<<<<<<<<<<<<<
 *         if dflt is not None:
 *             if dtype.shape == ():
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "bcolz/carray_ext.pyx":1112
 *                 _dflt[()] = dflt
 *             else:
 *                 _dflt[:] = dflt             # <<<<<<<<<<<<<<
 *         self._dflt = _dflt
 * 
 */
  __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__26);
  __Pyx_GIVEREF(__pyx_slice__26);

  /* "bcolz/carray_ext.pyx":1121
 *                 expectedlen = len(array_)
 *             except TypeError:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "creating carrays from scalar objects is not supported")
 *         try:
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_creating_carrays_from_scalar_obj); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "bcolz/carray_ext.pyx":1126
 *             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__28 = PyTuple_Pack(1, __pyx_kp_s_The_size_cannot_be_larger_than_2); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "bcolz/carray_ext.pyx":1139
 *         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__29 = PyTuple_Pack(1, __pyx_kp_s_chunklen_must_be_a_positive_inte); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "bcolz/carray_ext.pyx":1190
 *             # 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__30 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__30);
  __Pyx_GIVEREF(__pyx_slice__30);

  /* "bcolz/carray_ext.pyx":1210
 *             # 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__31 = PyTuple_Pack(1, __pyx_kp_s_root_directory_does_not_exist); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "bcolz/carray_ext.pyx":1213
 *             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__32 = PyTuple_Pack(1, __pyx_kp_s_data_directory_does_not_exist); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "bcolz/carray_ext.pyx":1216
 *             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__33 = PyTuple_Pack(1, __pyx_kp_s_meta_directory_does_not_exist); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "bcolz/carray_ext.pyx":1222
 *             self.chunks = chunks(self._rootdir, metainfo=metainfo, _new=False)
 *         else:
 *             self.chunks, lastchunkarr[:] = xchunks             # <<<<<<<<<<<<<<
 * 
 *         # Update some counters
 */
  __pyx_slice__34 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__34);
  __Pyx_GIVEREF(__pyx_slice__34);

  /* "bcolz/carray_ext.pyx":1232
 *         if self._mode == "w":
 *             # Remove all entries when mode is 'w'
 *             self.resize(0)             # <<<<<<<<<<<<<<
 * 
 *     def _fill_chunks(self, object array_):
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "bcolz/carray_ext.pyx":1292
 *                 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__36 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "bcolz/carray_ext.pyx":1305
 *                 "expectedlen": self.expectedlen,
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))             # <<<<<<<<<<<<<<
 *             storagefh.write(b"\n")
 * 
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "bcolz/carray_ext.pyx":1306
 *                 "dflt": dflt_list,
 *             }, ensure_ascii=True).encode('ascii'))
 *             storagefh.write(b"\n")             # <<<<<<<<<<<<<<
 * 
 *     def _read_meta(self):
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_b__38); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "bcolz/carray_ext.pyx":1285
 *         """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__40 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "bcolz/carray_ext.pyx":1315
 *         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__41 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "bcolz/carray_ext.pyx":1314
 *         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__42 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "bcolz/carray_ext.pyx":1325
 *         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__43 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "bcolz/carray_ext.pyx":1324
 *         # 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__44 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "bcolz/carray_ext.pyx":1340
 * 
 *         pick_obj = pickle.dumps(arrobj, pickle.HIGHEST_PROTOCOL)
 *         chunk_ = chunk(pick_obj, np.dtype('O'), self._cparams,             # <<<<<<<<<<<<<<
 *                        _memory=self._rootdir is None)
 * 
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "bcolz/carray_ext.pyx":1373
 *             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__46 = PyTuple_Pack(1, __pyx_kp_s_array_dtype_does_not_match_with); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "bcolz/carray_ext.pyx":1383
 *             # 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__47 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "bcolz/carray_ext.pyx":1384
 *             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__48 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__48);
  __Pyx_GIVEREF(__pyx_slice__48);

  /* "bcolz/carray_ext.pyx":1385
 *                 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__49 = PyTuple_Pack(1, __pyx_kp_s_array_trailing_dimensions_do_not); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "bcolz/carray_ext.pyx":1474
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):
 *             raise TypeError("`nitems` must be an integer")             # <<<<<<<<<<<<<<
 * 
 *         # Check that we don't run out of space
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_nitems_must_be_an_integer); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "bcolz/carray_ext.pyx":1478
 *         # 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__51 = PyTuple_Pack(1, __pyx_kp_s_nitems_must_be_less_than_total); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "bcolz/carray_ext.pyx":1541
 * 
 *         if not isinstance(nitems, _inttypes + (float,)):
 *             raise TypeError("`nitems` must be an integer")             # <<<<<<<<<<<<<<
 * 
 *         if nitems == self.len:
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_nitems_must_be_an_integer); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "bcolz/carray_ext.pyx":1546
 *             return
 *         elif nitems < 0:
 *             raise ValueError("`nitems` cannot be negative")             # <<<<<<<<<<<<<<
 * 
 *         if nitems > self.len:
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_nitems_cannot_be_negative); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "bcolz/carray_ext.pyx":1551
 *             # Create a 0-strided array and append it to self
 *             chunk = np.ndarray(nitems - self.len, dtype=self._dtype,
 *                                buffer=self._dflt, strides=(0,))             # <<<<<<<<<<<<<<
 *             self.append(chunk)
 *             self.flush()
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "bcolz/carray_ext.pyx":1589
 *         # 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__55 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "bcolz/carray_ext.pyx":1590
 *         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__56 = PyTuple_Pack(1, __pyx_kp_s_only_one_shape_dimension_can_be); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "bcolz/carray_ext.pyx":1591
 *             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__57 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "bcolz/carray_ext.pyx":1594
 *             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__58 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "bcolz/carray_ext.pyx":1602
 *         # Check shape compatibility
 *         if isize != newsize:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "`newshape` is not compatible with the current one")
 *         # Create the output container
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_newshape_is_not_compatible_with); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "bcolz/carray_ext.pyx":1605
 *                 "`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__60 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__60);
  __Pyx_GIVEREF(__pyx_slice__60);

  /* "bcolz/carray_ext.pyx":1611
 *         # 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__61 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "bcolz/carray_ext.pyx":1632
 *         else:
 *             for i from 0 <= i < ilen:
 *                 out.append(self[i].reshape(-1))             # <<<<<<<<<<<<<<
 *         out.flush()
 * 
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "bcolz/carray_ext.pyx":1665
 * 
 *         # Create a new, empty carray
 *         ccopy = carray(np.empty(0, dtype=self._dtype),             # <<<<<<<<<<<<<<
 *                        expectedlen=expectedlen,
 *                        **kwargs)
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "bcolz/carray_ext.pyx":1691
 *         """
 *         # 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__64 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "bcolz/carray_ext.pyx":1729
 *             dtype = np.dtype(dtype)
 *         if dtype.kind == 'S':
 *             raise TypeError("cannot perform reduce with flexible type")             # <<<<<<<<<<<<<<
 * 
 *         # Get a container for the result
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_cannot_perform_reduce_with_flexi); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "bcolz/carray_ext.pyx":1732
 * 
 *         # Get a container for the result
 *         result = np.zeros(1, dtype=dtype)[0]             # <<<<<<<<<<<<<<
 * 
 *         nchunks = <npy_intp> cython.cdiv(self._nbytes, self._chunksize)
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "bcolz/carray_ext.pyx":1741
 *                 result += chunk_.true_count
 *             else:
 *                 result += chunk_[:].sum(dtype=dtype)             # <<<<<<<<<<<<<<
 *         if self.leftover:
 *             leftover = self.len - nchunks * self._chunklen
 */
  __pyx_slice__67 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__67);
  __Pyx_GIVEREF(__pyx_slice__67);

  /* "bcolz/carray_ext.pyx":1882
 *                 key += self.len
 *             if key >= self.len:
 *                 raise IndexError("index out of range")             # <<<<<<<<<<<<<<
 *             arr1 = self.arr1
 *             if self.dtype.char == 'O':
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_range); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "bcolz/carray_ext.pyx":1897
 *             (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__69 = PyTuple_Pack(1, __pyx_kp_s_step_in_slice_can_only_be_positi); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "bcolz/carray_ext.pyx":1901
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")             # <<<<<<<<<<<<<<
 *             elif len(key) == 1:
 *                 return self[key[0]]
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_empty_tuple_not_supported); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "bcolz/carray_ext.pyx":1909
 *             # 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__71 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__71);
  __Pyx_GIVEREF(__pyx_slice__71);
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_slice__71); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_slice__73 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__73);
  __Pyx_GIVEREF(__pyx_slice__73);

  /* "bcolz/carray_ext.pyx":1911
 *                 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__74 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__74);
  __Pyx_GIVEREF(__pyx_slice__74);

  /* "bcolz/carray_ext.pyx":1922
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "key cannot be converted to an array of indices")
 *             return self[key]
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_key_cannot_be_converted_to_an_ar); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "bcolz/carray_ext.pyx":1930
 *                 # A boolean array
 *                 if len(key) != self.len:
 *                     raise IndexError(             # <<<<<<<<<<<<<<
 *                         "boolean array length must match len(self)")
 *                 if isinstance(key, carray):
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_boolean_array_length_must_match); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "bcolz/carray_ext.pyx":1942
 *                 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__77 = PyTuple_Pack(1, __pyx_kp_s_arrays_used_as_indices_must_be_i); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "bcolz/carray_ext.pyx":1949
 *             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__78 = PyTuple_Pack(1, __pyx_kp_s_only_boolean_expressions_support); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "bcolz/carray_ext.pyx":1951
 *                 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__79 = PyTuple_Pack(1, __pyx_kp_s_boolean_expression_outcome_must); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "bcolz/carray_ext.pyx":2047
 *                 key += self.len
 *             if key >= self.len:
 *                 raise IndexError("index out of range")             # <<<<<<<<<<<<<<
 *             (start, stop, step) = key, key + 1, 1
 *         # Slices
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_range); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "bcolz/carray_ext.pyx":2054
 *             if step:
 *                 if step <= 0:
 *                     raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                         "step in slice can only be positive")
 *         # Multidimensional keys
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_step_in_slice_can_only_be_positi); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "bcolz/carray_ext.pyx":2059
 *         elif isinstance(key, tuple):
 *             if len(key) == 0:
 *                 raise ValueError("empty tuple not supported")             # <<<<<<<<<<<<<<
 *             elif len(key) == 1:
 *                 self[key[0]] = value
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_empty_tuple_not_supported); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "bcolz/carray_ext.pyx":2068
 *             # 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__83 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__83);
  __Pyx_GIVEREF(__pyx_slice__83);
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_slice__83); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_slice__85 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__85);
  __Pyx_GIVEREF(__pyx_slice__85);

  /* "bcolz/carray_ext.pyx":2070
 *                 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__86 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__86);
  __Pyx_GIVEREF(__pyx_slice__86);

  /* "bcolz/carray_ext.pyx":2080
 *                 key = np.array(key, dtype=np.int_)
 *             except:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "key cannot be converted to an array of indices")
 *             self[key] = value
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_key_cannot_be_converted_to_an_ar); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "bcolz/carray_ext.pyx":2089
 *                 # A boolean array
 *                 if len(key) != self.len:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         "boolean array length must match len(self)")
 *                 self.bool_update(key, value)
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_boolean_array_length_must_match); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "bcolz/carray_ext.pyx":2102
 *                 return
 *             else:
 *                 raise IndexError(             # <<<<<<<<<<<<<<
 *                     "arrays used as indices must be of integer (or boolean) "
 *                     "type")
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_arrays_used_as_indices_must_be_o); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "bcolz/carray_ext.pyx":2110
 *             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__90 = PyTuple_Pack(1, __pyx_kp_s_only_boolean_expressions_support); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "bcolz/carray_ext.pyx":2112
 *                 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__91 = PyTuple_Pack(1, __pyx_kp_s_boolean_expression_outcome_must); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "bcolz/carray_ext.pyx":2157
 *                     self._cbytes -= chunk_.cbytes
 *                     # Get all the values there
 *                     cdata = chunk_[:]             # <<<<<<<<<<<<<<
 *                     # Overwrite it with data from value
 *                     cdata[startb:stopb:step] = value[nwrow:nwrow + blen]
 */
  __pyx_slice__92 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__92);
  __Pyx_GIVEREF(__pyx_slice__92);

  /* "bcolz/carray_ext.pyx":2259
 *                 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__93 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__93);
  __Pyx_GIVEREF(__pyx_slice__93);

  /* "bcolz/carray_ext.pyx":2340
 *         # Check limits
 *         if step <= 0:
 *             raise NotImplementedError("step param can only be positive")             # <<<<<<<<<<<<<<
 *         if _next:
 *             cview = self
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_step_param_can_only_be_positive); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "bcolz/carray_ext.pyx":2381
 *         # 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__95 = PyTuple_Pack(1, __pyx_kp_s_self_is_not_an_array_of_boolean); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "bcolz/carray_ext.pyx":2383
 *             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__96 = PyTuple_Pack(1, __pyx_kp_s_self_is_not_unidimensional); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "bcolz/carray_ext.pyx":2421
 *         # 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__97 = PyTuple_Pack(1, __pyx_kp_s_self_is_not_unidimensional); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "bcolz/carray_ext.pyx":2423
 *             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__98 = PyTuple_Pack(1, __pyx_kp_s_boolarr_is_not_an_array); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "bcolz/carray_ext.pyx":2425
 *             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__99 = PyTuple_Pack(1, __pyx_kp_s_boolarr_is_not_an_array_of_bool); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "bcolz/carray_ext.pyx":2427
 *             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__100 = PyTuple_Pack(1, __pyx_kp_s_boolarr_must_be_of_the_same_len); if (unlikely(!__pyx_tuple__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "bcolz/carray_ext.pyx":2528
 *         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__101 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "bcolz/carray_ext.pyx":2529
 *             # 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__102 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "bcolz/carray_ext.pyx":2569
 *             with open(rowsf, 'wb') as rowsfh:
 *                 rowsfh.write(
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))             # <<<<<<<<<<<<<<
 *                 rowsfh.write(b'\n')
 * 
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "bcolz/carray_ext.pyx":2570
 *                 rowsfh.write(
 *                     json.dumps(sizes, ensure_ascii=True).encode('ascii'))
 *                 rowsfh.write(b'\n')             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_b__38); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "bcolz/carray_ext.pyx":2567
 *             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__106 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "bcolz/carray_ext.pyx":2633
 *             return (build_carray, (None,self.rootdir,))
 *         else:
 *             return (build_carray,(self[:],None,))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_slice__107 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__107);
  __Pyx_GIVEREF(__pyx_slice__107);

  /* "../../home/faltet/miniconda/lib/python2.7/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__108 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "../../home/faltet/miniconda/lib/python2.7/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__109 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__109)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "../../home/faltet/miniconda/lib/python2.7/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__110 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "../../home/faltet/miniconda/lib/python2.7/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__111 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "../../home/faltet/miniconda/lib/python2.7/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__112 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__112)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "../../home/faltet/miniconda/lib/python2.7/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__113 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__113)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "bcolz/carray_ext.pyx":38
 * from .utils import build_carray
 * 
 * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *     _MAXINT = 2 ** 31 - 1
 *     _inttypes = (int, np.integer)
 */
  __pyx_tuple__114 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple__114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "bcolz/carray_ext.pyx":134
 * 
 * # Some utilities
 * def blosc_compressor_list():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_compressor_list()
 */
  __pyx_tuple__115 = PyTuple_Pack(2, __pyx_n_s_list_compr, __pyx_n_s_clist); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_bcolz_bcolz_carray_ext_pyx, __pyx_n_s_blosc_compressor_list, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":156
 *     return clist
 * 
 * def _blosc_set_nthreads(nthreads):             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_set_nthreads(nthreads)
 */
  __pyx_tuple__117 = PyTuple_Pack(1, __pyx_n_s_nthreads); if (unlikely(!__pyx_tuple__117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);
  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_bcolz_bcolz_carray_ext_pyx, __pyx_n_s_blosc_set_nthreads, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":174
 *     return blosc_set_nthreads(nthreads)
 * 
 * def _blosc_init():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_init()
 */
  __pyx_codeobj__119 = (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_tmp_bcolz_bcolz_carray_ext_pyx, __pyx_n_s_blosc_init, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":183
 *     blosc_init()
 * 
 * def _blosc_destroy():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_destroy()
 */
  __pyx_codeobj__120 = (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_tmp_bcolz_bcolz_carray_ext_pyx, __pyx_n_s_blosc_destroy, 183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":192
 *     blosc_destroy()
 * 
 * def blosc_version():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_version()
 */
  __pyx_tuple__121 = PyTuple_Pack(2, __pyx_n_s_ver_str, __pyx_n_s_ver_date); if (unlikely(!__pyx_tuple__121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_bcolz_bcolz_carray_ext_pyx, __pyx_n_s_blosc_version, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":208
 *     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__123 = PyTuple_Pack(2, __pyx_n_s_lst, __pyx_n_s_x); if (unlikely(!__pyx_tuple__123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);
  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_bcolz_bcolz_carray_ext_pyx, __pyx_n_s_list_bytes_to_str, 208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":597
 *             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__125 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple__125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "bcolz/carray_ext.pyx":598
 * 
 * if sys.version_info >= (3, 0):
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return byte
 * else:
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_n_s_byte); if (unlikely(!__pyx_tuple__126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);
  __pyx_codeobj__127 = (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_tmp_bcolz_bcolz_carray_ext_pyx, __pyx_n_s_decode_byte, 598, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":601
 *         return byte
 * else:
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):
 */
  __pyx_tuple__128 = PyTuple_Pack(1, __pyx_n_s_byte); if (unlikely(!__pyx_tuple__128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);
  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_bcolz_bcolz_carray_ext_pyx, __pyx_n_s_decode_byte, 601, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":603
 *     def decode_byte(byte):
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):             # <<<<<<<<<<<<<<
 *     return struct.unpack('<I', fourbyte)[0]
 * 
 */
  __pyx_tuple__130 = PyTuple_Pack(1, __pyx_n_s_fourbyte); if (unlikely(!__pyx_tuple__130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp_bcolz_bcolz_carray_ext_pyx, __pyx_n_s_decode_uint32, 603, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_2147483647 = PyInt_FromLong(2147483647L); if (unlikely(!__pyx_int_2147483647)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_9223372036854775807 = PyInt_FromString((char *)"9223372036854775807", 0, 0); if (unlikely(!__pyx_int_9223372036854775807)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initcarray_ext(void); /*proto*/
PyMODINIT_FUNC initcarray_ext(void)
#else
PyMODINIT_FUNC PyInit_carray_ext(void); /*proto*/
PyMODINIT_FUNC PyInit_carray_ext(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_bcolz__carray_ext) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "bcolz.carray_ext")) {
      if (unlikely(PyDict_SetItemString(modules, "bcolz.carray_ext", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "chunk", (PyObject *)&__pyx_type_5bcolz_10carray_ext_chunk) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "chunks", (PyObject *)&__pyx_type_5bcolz_10carray_ext_chunks) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "carray", (PyObject *)&__pyx_type_5bcolz_10carray_ext_carray) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif

  /* "bcolz/carray_ext.pyx":13
 * from __future__ import absolute_import
 * 
 * import sys             # <<<<<<<<<<<<<<
 * import os
 * import os.path
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":14
 * 
 * import sys
 * import os             # <<<<<<<<<<<<<<
 * import os.path
 * import struct
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __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
 * import shutil
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os_path, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":16
 * import os
 * import os.path
 * import struct             # <<<<<<<<<<<<<<
 * import shutil
 * import tempfile
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":17
 * import os.path
 * import struct
 * import shutil             # <<<<<<<<<<<<<<
 * import tempfile
 * import json
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_shutil, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_shutil, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":18
 * import struct
 * import shutil
 * import tempfile             # <<<<<<<<<<<<<<
 * import json
 * import datetime
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_tempfile, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":19
 * import shutil
 * import tempfile
 * import json             # <<<<<<<<<<<<<<
 * import datetime
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":20
 * import tempfile
 * import json
 * import datetime             # <<<<<<<<<<<<<<
 * 
 * import numpy as np
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":22
 * import datetime
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * from numpy cimport (ndarray,
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":33
 * import cython
 * 
 * import bcolz             # <<<<<<<<<<<<<<
 * from bcolz import utils, attrs, array2string
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_bcolz, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bcolz, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":34
 * 
 * import bcolz
 * from bcolz import utils, attrs, array2string             # <<<<<<<<<<<<<<
 * 
 * from .utils import build_carray
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_utils, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_attrs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array2string, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":36
 * from bcolz import utils, attrs, array2string
 * 
 * from .utils import build_carray             # <<<<<<<<<<<<<<
 * 
 * if sys.version_info >= (3, 0):
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_build_carray, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __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":38
 * from .utils import build_carray
 * 
 * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *     _MAXINT = 2 ** 31 - 1
 *     _inttypes = (int, np.integer)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__114, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":39
 * 
 * if sys.version_info >= (3, 0):
 *     _MAXINT = 2 ** 31 - 1             # <<<<<<<<<<<<<<
 *     _inttypes = (int, np.integer)
 * else:
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXINT, __pyx_int_2147483647) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "bcolz/carray_ext.pyx":40
 * if sys.version_info >= (3, 0):
 *     _MAXINT = 2 ** 31 - 1
 *     _inttypes = (int, np.integer)             # <<<<<<<<<<<<<<
 * else:
 *     _MAXINT = sys.maxint
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":38
 * 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":42
 *     _inttypes = (int, np.integer)
 * else:
 *     _MAXINT = sys.maxint             # <<<<<<<<<<<<<<
 *     _inttypes = (int, long, np.integer)
 * 
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "bcolz/carray_ext.pyx":43
 * else:
 *     _MAXINT = sys.maxint
 *     _inttypes = (int, long, np.integer)             # <<<<<<<<<<<<<<
 * 
 * _KB = 1024
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L2:;

  /* "bcolz/carray_ext.pyx":45
 *     _inttypes = (int, long, np.integer)
 * 
 * _KB = 1024             # <<<<<<<<<<<<<<
 * _MB = 1024 * _KB
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_KB, __pyx_int_1024) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":46
 * 
 * _KB = 1024
 * _MB = 1024 * _KB             # <<<<<<<<<<<<<<
 * 
 * # Directories for saving the data and metadata for bcolz persistency
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_KB); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":49
 * 
 * # Directories for saving the data and metadata for bcolz persistency
 * DATA_DIR = 'data'             # <<<<<<<<<<<<<<
 * META_DIR = 'meta'
 * SIZES_FILE = 'sizes'
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DATA_DIR, __pyx_n_s_data) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":50
 * # Directories for saving the data and metadata for bcolz persistency
 * DATA_DIR = 'data'
 * META_DIR = 'meta'             # <<<<<<<<<<<<<<
 * SIZES_FILE = 'sizes'
 * STORAGE_FILE = 'storage'
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_META_DIR, __pyx_n_s_meta) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":51
 * DATA_DIR = 'data'
 * META_DIR = 'meta'
 * SIZES_FILE = 'sizes'             # <<<<<<<<<<<<<<
 * STORAGE_FILE = 'storage'
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIZES_FILE, __pyx_n_s_sizes) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":52
 * META_DIR = 'meta'
 * SIZES_FILE = 'sizes'
 * STORAGE_FILE = 'storage'             # <<<<<<<<<<<<<<
 * 
 * # For the persistence layer
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STORAGE_FILE, __pyx_n_s_storage) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":55
 * 
 * # For the persistence layer
 * EXTENSION = '.blp'             # <<<<<<<<<<<<<<
 * MAGIC = b'blpk'
 * BLOSCPACK_HEADER_LENGTH = 16
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTENSION, __pyx_kp_s_blp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":56
 * # For the persistence layer
 * EXTENSION = '.blp'
 * MAGIC = b'blpk'             # <<<<<<<<<<<<<<
 * BLOSCPACK_HEADER_LENGTH = 16
 * BLOSC_HEADER_LENGTH = 16
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAGIC, __pyx_n_b_blpk) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":57
 * EXTENSION = '.blp'
 * MAGIC = b'blpk'
 * BLOSCPACK_HEADER_LENGTH = 16             # <<<<<<<<<<<<<<
 * BLOSC_HEADER_LENGTH = 16
 * FORMAT_VERSION = 1
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLOSCPACK_HEADER_LENGTH, __pyx_int_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":58
 * MAGIC = b'blpk'
 * BLOSCPACK_HEADER_LENGTH = 16
 * BLOSC_HEADER_LENGTH = 16             # <<<<<<<<<<<<<<
 * FORMAT_VERSION = 1
 * MAX_FORMAT_VERSION = 255
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLOSC_HEADER_LENGTH, __pyx_int_16) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":59
 * BLOSCPACK_HEADER_LENGTH = 16
 * BLOSC_HEADER_LENGTH = 16
 * FORMAT_VERSION = 1             # <<<<<<<<<<<<<<
 * MAX_FORMAT_VERSION = 255
 * MAX_CHUNKS = (2 ** 63) - 1
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORMAT_VERSION, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":60
 * BLOSC_HEADER_LENGTH = 16
 * FORMAT_VERSION = 1
 * MAX_FORMAT_VERSION = 255             # <<<<<<<<<<<<<<
 * MAX_CHUNKS = (2 ** 63) - 1
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_FORMAT_VERSION, __pyx_int_255) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":61
 * FORMAT_VERSION = 1
 * MAX_FORMAT_VERSION = 255
 * MAX_CHUNKS = (2 ** 63) - 1             # <<<<<<<<<<<<<<
 * 
 * # The type used for size values: indexes, coordinates, dimension
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAX_CHUNKS, __pyx_int_9223372036854775807) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "bcolz/carray_ext.pyx":65
 * # 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_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "bcolz/carray_ext.pyx":68
 * 
 * # The native int type for this platform
 * IntType = np.dtype(np.int_)             # <<<<<<<<<<<<<<
 * 
 * #-----------------------------------------------------------------
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":129
 * # The numpy API requires this function to be called before
 * # using any numpy facilities in an extension module.
 * import_array()             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------
 */
  import_array();

  /* "bcolz/carray_ext.pyx":134
 * 
 * # Some utilities
 * def blosc_compressor_list():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_compressor_list()
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blosc_compressor_list, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":156
 *     return clist
 * 
 * def _blosc_set_nthreads(nthreads):             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_set_nthreads(nthreads)
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blosc_set_nthreads, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":174
 *     return blosc_set_nthreads(nthreads)
 * 
 * def _blosc_init():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_init()
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blosc_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":183
 *     blosc_init()
 * 
 * def _blosc_destroy():             # <<<<<<<<<<<<<<
 *     """
 *     _blosc_destroy()
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blosc_destroy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":192
 *     blosc_destroy()
 * 
 * def blosc_version():             # <<<<<<<<<<<<<<
 *     """
 *     blosc_version()
 */
  __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_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blosc_version, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":208
 *     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_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_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":547
 * 
 * 
 * cdef create_bloscpack_header(nchunks=None, format_version=FORMAT_VERSION):             # <<<<<<<<<<<<<<
 *     """Create the bloscpack header string.
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT_VERSION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__8 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":597
 *             struct.pack('<q', nchunks if nchunks is not None else -1))
 * 
 * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
 *     def decode_byte(byte):
 *         return byte
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__125, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "bcolz/carray_ext.pyx":598
 * 
 * if sys.version_info >= (3, 0):
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return byte
 * else:
 */
    __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_13decode_byte, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_byte, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bcolz/carray_ext.pyx":597
 *             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":601
 *         return byte
 * else:
 *     def decode_byte(byte):             # <<<<<<<<<<<<<<
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):
 */
  /*else*/ {
    __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_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_byte, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "bcolz/carray_ext.pyx":603
 *     def decode_byte(byte):
 *         return int(byte.encode('hex'), 16)
 * def decode_uint32(fourbyte):             # <<<<<<<<<<<<<<
 *     return struct.unpack('<I', fourbyte)[0]
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5bcolz_10carray_ext_17decode_uint32, NULL, __pyx_n_s_bcolz_carray_ext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_uint32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bcolz/carray_ext.pyx":1
 * #!python             # <<<<<<<<<<<<<<
 * #cython: embedsignature=True
 * #########################################################################
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "../../home/faltet/miniconda/lib/python2.7/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
 */

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

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;
}

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;
}

#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

#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

#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

#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

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;
}

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;
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

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;
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#endif
    __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
}

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);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.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;
}

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;
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (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_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

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
}

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
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

static 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))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            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));
}

#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
#endif

#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

#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

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))
                    PyErr_Clear();
                else
                    goto bad;
            }
        }
        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;
}

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;
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (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;
}

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

#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

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))
                    PyErr_Clear();
                else
                    goto bad;
            }
        }
        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;
}

static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if CYTHON_COMPILING_IN_PYPY
    float_value = PyNumber_Float(obj);  if (0) goto bad;
#else
    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
    if (likely(nb) && likely(nb->nb_float)) {
        float_value = nb->nb_float(obj);
        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
            PyErr_Format(PyExc_TypeError,
                "__float__ returned non-float (type %.200s)",
                Py_TYPE(float_value)->tp_name);
            Py_DECREF(float_value);
            goto bad;
        }
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

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;
}

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;
}

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;
}

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;
}

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;
}

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;
}

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

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;
}

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;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

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);
    }
}

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;
}

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;
}

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;
}

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))
                        PyErr_Clear();
                    else
                        return -1;
                }
            }
            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);
}

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;
}

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;
}

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;
}

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);
}

#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);
}

#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;\
    }

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) 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_Int(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_Int(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;
}

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) 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_Int(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_Int(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;
}

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);
    }
}

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);
    }
}

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) 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_Int(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_Int(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;
}

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);
    }
}

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) 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_Int(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_Int(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;
}

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);
    }
}

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        float denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(a, a);
                    case 3:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, a);
                    case 4:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_absf(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        double denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(a, a);
                    case 3:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, a);
                    case 4:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_abs(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

static CYTHON_INLINE 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);
    }
}

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;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_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",
            module_name, class_name);
        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",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

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