/* Generated by Cython 0.29.22 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "define_macros": [
            [
                "NPY_NO_DEPRECATED_API",
                "NPY_1_7_API_VERSION"
            ]
        ],
        "extra_compile_args": [
            "-fno-strict-aliasing",
            "-O3"
        ],
        "include_dirs": [
            "/private/var/folders/mv/4s6tfcd91mz8r8yqpw7frs4wlcl4v9/T/build-env-evcii6dl/lib/python3.9/site-packages/numpy/core/include"
        ],
        "name": "S3netCDF4._s3netCDF4",
        "sources": [
            "S3netCDF4/_s3netCDF4.pyx"
        ]
    },
    "module_name": "S3netCDF4._s3netCDF4"
}
END: Cython Metadata */

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

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

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

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

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

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

#define __PYX_HAVE__S3netCDF4___s3netCDF4
#define __PYX_HAVE_API__S3netCDF4___s3netCDF4
/* Early includes */
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

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


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

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


static const char *__pyx_f[] = {
  "S3netCDF4/_s3netCDF4.pyx",
};

/*--- Type declarations ---*/
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults1;
typedef struct __pyx_defaults1 __pyx_defaults1;
struct __pyx_defaults2;
typedef struct __pyx_defaults2 __pyx_defaults2;
struct __pyx_defaults3;
typedef struct __pyx_defaults3 __pyx_defaults3;
struct __pyx_defaults4;
typedef struct __pyx_defaults4 __pyx_defaults4;
struct __pyx_defaults5;
typedef struct __pyx_defaults5 __pyx_defaults5;
struct __pyx_defaults {
  PyObject *__pyx_arg_metadata;
};
struct __pyx_defaults1 {
  PyObject *__pyx_arg_subarray_shape;
};
struct __pyx_defaults2 {
  PyObject *__pyx_arg_metadata;
};
struct __pyx_defaults3 {
  PyObject *__pyx_arg_subarray_shape;
};
struct __pyx_defaults4 {
  PyObject *__pyx_arg_metadata;
};
struct __pyx_defaults5 {
  PyObject *__pyx_arg_subarray_shape;
};

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

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

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

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

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

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

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#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);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

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

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

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

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

/* PyObject_Unicode.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
#else
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static 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);

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

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

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

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

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

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

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


/* Module declarations from 'S3netCDF4._s3netCDF4' */
#define __Pyx_MODULE_NAME "S3netCDF4._s3netCDF4"
extern int __pyx_module_is_main_S3netCDF4___s3netCDF4;
int __pyx_module_is_main_S3netCDF4___s3netCDF4 = 0;

/* Implementation of 'S3netCDF4._s3netCDF4' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_IOError;
static const char __pyx_k_[] = "{}\n";
static const char __pyx_k_2[] = "2";
static const char __pyx_k_5[] = "5";
static const char __pyx_k_U[] = "U";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_g[] = "g";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_m[] = "m";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_v[] = "v";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k__2[] = "    {}: {} \n";
static const char __pyx_k__3[] = "";
static const char __pyx_k__5[] = "{} {}({})\n";
static const char __pyx_k__6[] = ",";
static const char __pyx_k__7[] = "{}({}), ";
static const char __pyx_k__8[] = "{} {}({}), ";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_0_4[] = "0.4";
static const char __pyx_k_0_5[] = "0.5";
static const char __pyx_k_CDF[] = "CDF";
static const char __pyx_k_HDF[] = "HDF";
static const char __pyx_k__10[] = "\n";
static const char __pyx_k__11[] = ", ";
static const char __pyx_k__13[] = "{}, ";
static const char __pyx_k__17[] = "\016";
static const char __pyx_k__18[] = "\003";
static const char __pyx_k__19[] = "\023";
static const char __pyx_k__20[] = "\001";
static const char __pyx_k__22[] = "*";
static const char __pyx_k_cfa[] = "cfa_";
static const char __pyx_k_dim[] = "dim";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_grp[] = "_grp";
static const char __pyx_k_len[] = "__len__";
static const char __pyx_k_ncd[] = "ncd";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_s3d[] = "s3d";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_url[] = "url";
static const char __pyx_k_var[] = "var";
static const char __pyx_k_CFA3[] = "CFA3";
static const char __pyx_k_CFA4[] = "CFA4";
static const char __pyx_k_Mode[] = "Mode ";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_elem[] = "elem";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_lock[] = "lock";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_prod[] = "prod";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_repr[] = "__repr__";
static const char __pyx_k_root[] = "root";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_type[] = "type: '{}'\n";
static const char __pyx_k_zlib[] = "zlib";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_atype[] = "atype";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_dimid[] = "_dimid";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_errno[] = "errno";
static const char __pyx_k_fname[] = "fname";
static const char __pyx_k_group[] = "group /{}:\n";
static const char __pyx_k_grp_2[] = "grp";
static const char __pyx_k_grpid[] = "_grpid";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_nc_ds[] = "nc_ds";
static const char __pyx_k_numpy[] = "numpy";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_ENOENT[] = "ENOENT";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_cfa_ds[] = "cfa_ds";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_endian[] = "endian";
static const char __pyx_k_extend[] = "extend";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_getLen[] = "getLen";
static const char __pyx_k_groups[] = "groups";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_memory[] = "memory";
static const char __pyx_k_mode_2[] = "_mode";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "_name";
static const char __pyx_k_name_3[] = "name: '{}'\n";
static const char __pyx_k_name_4[] = "__name__";
static const char __pyx_k_native[] = "native";
static const char __pyx_k_nc_dim[] = "nc_dim";
static const char __pyx_k_nc_grp[] = "_nc_grp";
static const char __pyx_k_nc_obj[] = "nc_obj";
static const char __pyx_k_nc_var[] = "nc_var";
static const char __pyx_k_ncdump[] = "ncdump";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_parent[] = "parent";
static const char __pyx_k_parser[] = "parser";
static const char __pyx_k_psutil[] = "psutil";
static const char __pyx_k_size_2[] = "size = ({})\n";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_target[] = "target";
static const char __pyx_k_DEFAULT[] = "DEFAULT";
static const char __pyx_k_Dataset[] = "Dataset";
static const char __pyx_k_IOError[] = "IOError";
static const char __pyx_k_NETCDF4[] = "NETCDF4";
static const char __pyx_k_attdict[] = "attdict";
static const char __pyx_k_authors[] = "__authors__";
static const char __pyx_k_cfa_dim[] = "cfa_dim";
static const char __pyx_k_cfa_grp[] = "_cfa_grp";
static const char __pyx_k_cfa_obj[] = "cfa_obj";
static const char __pyx_k_cfa_var[] = "cfa_var";
static const char __pyx_k_clobber[] = "clobber";
static const char __pyx_k_dealloc[] = "__dealloc__";
static const char __pyx_k_dim_len[] = "dim_len";
static const char __pyx_k_dimname[] = "dimname";
static const char __pyx_k_getName[] = "getName";
static const char __pyx_k_getType[] = "getType";
static const char __pyx_k_getattr[] = "__getattr__";
static const char __pyx_k_getitem[] = "__getitem__";
static const char __pyx_k_is_file[] = "is_file";
static const char __pyx_k_license[] = "__license__";
static const char __pyx_k_ncattrs[] = "ncattrs";
static const char __pyx_k_netCDF4[] = "netCDF4";
static const char __pyx_k_new_grp[] = "new_grp";
static const char __pyx_k_new_var[] = "new_var";
static const char __pyx_k_newname[] = "newname";
static const char __pyx_k_oldname[] = "oldname";
static const char __pyx_k_persist[] = "persist";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_s3Group[] = "s3Group";
static const char __pyx_k_setType[] = "setType";
static const char __pyx_k_setattr[] = "__setattr__";
static const char __pyx_k_setitem[] = "__setitem__";
static const char __pyx_k_shuffle[] = "shuffle";
static const char __pyx_k_unicode[] = "__unicode__";
static const char __pyx_k_varname[] = "varname";
static const char __pyx_k_CFAError[] = "CFAError";
static const char __pyx_k_CFAGroup[] = "CFAGroup";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_cfa_meta[] = "cfa_meta";
static const char __pyx_k_datatype[] = "datatype";
static const char __pyx_k_dim_name[] = "dim_name";
static const char __pyx_k_diskless[] = "diskless";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_getGroup[] = "getGroup";
static const char __pyx_k_groups_2[] = "groups: ";
static const char __pyx_k_grp_name[] = "grp_name";
static const char __pyx_k_itemsize[] = "itemsize";
static const char __pyx_k_location[] = "location";
static const char __pyx_k_metadata[] = "metadata";
static const char __pyx_k_nc_bytes[] = "nc_bytes";
static const char __pyx_k_nc_dim_2[] = "_nc_dim";
static const char __pyx_k_nc_dtype[] = "nc_dtype";
static const char __pyx_k_nc_grp_2[] = "nc_grp";
static const char __pyx_k_nc_var_2[] = "_nc_var";
static const char __pyx_k_parallel[] = "parallel";
static const char __pyx_k_pm_shape[] = "pm_shape";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_strerror[] = "strerror";
static const char __pyx_k_var_name[] = "var_name";
static const char __pyx_k_FillValue[] = "_FillValue";
static const char __pyx_k_axis_type[] = "axis_type";
static const char __pyx_k_cfa_dim_2[] = "_cfa_dim";
static const char __pyx_k_cfa_group[] = "cfa_group";
static const char __pyx_k_cfa_grp_2[] = "cfa_grp";
static const char __pyx_k_cfa_var_2[] = "_cfa_var";
static const char __pyx_k_complevel[] = "complevel";
static const char __pyx_k_copyright[] = "__copyright__";
static const char __pyx_k_delncattr[] = "delncattr";
static const char __pyx_k_dim_names[] = "dim_names";
static const char __pyx_k_file_type[] = "file_type";
static const char __pyx_k_getFormat[] = "getFormat";
static const char __pyx_k_getncattr[] = "getncattr";
static const char __pyx_k_groupname[] = "groupname";
static const char __pyx_k_in_memory[] = "in_memory";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_nc_object[] = "nc_object";
static const char __pyx_k_nc_parent[] = "nc_parent";
static const char __pyx_k_nc_sa_grp[] = "nc_sa_grp";
static const char __pyx_k_open_mode[] = "open_mode";
static const char __pyx_k_orig_mode[] = "orig_mode";
static const char __pyx_k_partition[] = "partition";
static const char __pyx_k_read_from[] = "read_from";
static const char __pyx_k_s3Dataset[] = "s3Dataset";
static const char __pyx_k_s3_groups[] = "_s3_groups";
static const char __pyx_k_setncattr[] = "setncattr";
static const char __pyx_k_setncatts[] = "setncatts";
static const char __pyx_k_traceback[] = "traceback";
static const char __pyx_k_unlimdims[] = "unlimdims";
static const char __pyx_k_variables[] = "variables";
static const char __pyx_k_CFADataset[] = "CFADataset";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_NOT_NETCDF[] = "NOT_NETCDF";
static const char __pyx_k_cfa_groups[] = "cfa_groups: ";
static const char __pyx_k_chunksizes[] = "chunksizes";
static const char __pyx_k_contiguous[] = "contiguous";
static const char __pyx_k_data_model[] = "_data_model";
static const char __pyx_k_dimensions[] = "dimensions";
static const char __pyx_k_fill_value[] = "fill_value";
static const char __pyx_k_fletcher32[] = "fletcher32";
static const char __pyx_k_index_list[] = "index_list";
static const char __pyx_k_nc_dataset[] = "_nc_dataset";
static const char __pyx_k_open_state[] = "open_state";
static const char __pyx_k_s3Variable[] = "s3Variable";
static const char __pyx_k_s3_dataset[] = "s3_dataset";
static const char __pyx_k_CFAVariable[] = "CFAVariable";
static const char __pyx_k_FileManager[] = "FileManager";
static const char __pyx_k_IOException[] = "IOException";
static const char __pyx_k_Neil_Massey[] = "Neil Massey";
static const char __pyx_k_axis_type_2[] = "axis type: '{}'\n";
static const char __pyx_k_cfa_dataset[] = "_cfa_dataset";
static const char __pyx_k_cfa_version[] = "cfa_version";
static const char __pyx_k_chunk_cache[] = "chunk_cache";
static const char __pyx_k_createGroup[] = "createGroup";
static const char __pyx_k_data_object[] = "data_object";
static const char __pyx_k_disk_format[] = "disk_format";
static const char __pyx_k_file_object[] = "file_object";
static const char __pyx_k_filling_off[] = "filling off\n";
static const char __pyx_k_getAxisType[] = "getAxisType";
static const char __pyx_k_getMetadata[] = "getMetadata";
static const char __pyx_k_getVariable[] = "getVariable";
static const char __pyx_k_group_names[] = "group_names";
static const char __pyx_k_inmemory_nc[] = "inmemory.nc";
static const char __pyx_k_isunlimited[] = "isunlimited";
static const char __pyx_k_keepweakref[] = "keepweakref";
static const char __pyx_k_renameGroup[] = "renameGroup";
static const char __pyx_k_s3Dimension[] = "s3Dimension";
static const char __pyx_k_APIException[] = "APIException";
static const char __pyx_k_CFADimension[] = "CFADimension";
static const char __pyx_k_errno_ENOENT[] = "errno_ENOENT";
static const char __pyx_k_file_manager[] = "_file_manager";
static const char __pyx_k_file_version[] = "file_version";
static const char __pyx_k_getDimension[] = "getDimension";
static const char __pyx_k_getVariables[] = "getVariables";
static const char __pyx_k_open_success[] = "open_success";
static const char __pyx_k_private_atts[] = "_private_atts";
static const char __pyx_k_request_file[] = "request_file";
static const char __pyx_k_s3_variables[] = "_s3_variables";
static const char __pyx_k_target_array[] = "target_array";
static const char __pyx_k_version_info[] = "version_info";
static const char __pyx_k_current_shape[] = "current shape = ({})\n";
static const char __pyx_k_getCFAVersion[] = "getCFAVersion";
static const char __pyx_k_getDimensions[] = "getDimensions";
static const char __pyx_k_nc_dimensions[] = "nc_dimensions";
static const char __pyx_k_nc_in_dataset[] = "nc_in_dataset";
static const char __pyx_k_nc_sa_dataset[] = "nc_sa_dataset";
static const char __pyx_k_nc_sa_dim_var[] = "nc_sa_dim_var";
static const char __pyx_k_nc_sa_fld_var[] = "nc_sa_fld_var";
static const char __pyx_k_not_supported[] = " not supported.";
static const char __pyx_k_pm_dimensions[] = "pm_dimensions";
static const char __pyx_k_remote_system[] = "remote_system";
static const char __pyx_k_request_array[] = "request_array";
static const char __pyx_k_s3_dimensions[] = "_s3_dimensions";
static const char __pyx_k_DOES_NOT_EXIST[] = "DOES_NOT_EXIST";
static const char __pyx_k_OpenFileRecord[] = "OpenFileRecord";
static const char __pyx_k_cfa_root_group[] = "cfa_root_group";
static const char __pyx_k_createVariable[] = "createVariable";
static const char __pyx_k_file_manager_2[] = "file_manager";
static const char __pyx_k_free_all_files[] = "free_all_files";
static const char __pyx_k_managed_object[] = "_managed_object";
static const char __pyx_k_nc_out_dataset[] = "nc_out_dataset";
static const char __pyx_k_renameVariable[] = "renameVariable";
static const char __pyx_k_request_object[] = "request_object";
static const char __pyx_k_s3Group___init[] = "s3Group.__init__";
static const char __pyx_k_s3Group___repr[] = "s3Group.__repr__";
static const char __pyx_k_s3Group_create[] = "s3Group.create";
static const char __pyx_k_subarray_shape[] = "subarray_shape";
static const char __pyx_k_unlimited_True[] = "unlimited: True\n";
static const char __pyx_k_var_names_dims[] = "var_names_dims";
static const char __pyx_k_virtual_memory[] = "virtual_memory";
static const char __pyx_k_writePartition[] = "writePartition";
static const char __pyx_k_NETCDF3_CLASSIC[] = "NETCDF3_CLASSIC";
static const char __pyx_k_cfa_group_names[] = "cfa_group_names";
static const char __pyx_k_createDimension[] = "createDimension";
static const char __pyx_k_creation_params[] = "_creation_params";
static const char __pyx_k_dim_names_sizes[] = "dim_names_sizes";
static const char __pyx_k_free_all_arrays[] = "free_all_arrays";
static const char __pyx_k_getBaseFilename[] = "getBaseFilename";
static const char __pyx_k_renameDimension[] = "renameDimension";
static const char __pyx_k_s3Dataset_close[] = "s3Dataset.close";
static const char __pyx_k_s3Group_ncattrs[] = "s3Group.ncattrs";
static const char __pyx_k_CFA_netCDFParser[] = "CFA_netCDFParser";
static const char __pyx_k_OPEN_NEW_ON_DISK[] = "OPEN_NEW_ON_DISK";
static const char __pyx_k_dimensions_sizes[] = "    dimensions(sizes): ";
static const char __pyx_k_netCDF4__netCDF4[] = "netCDF4._netCDF4";
static const char __pyx_k_s3Dataset___exit[] = "s3Dataset.__exit__";
static const char __pyx_k_s3Dataset___init[] = "s3Dataset.__init__";
static const char __pyx_k_s3Dataset___repr[] = "s3Dataset.__repr__";
static const char __pyx_k_s3Dataset_groups[] = "s3Dataset.groups";
static const char __pyx_k_s3Dimension_size[] = "s3Dimension.size";
static const char __pyx_k_s3Variable_dtype[] = "s3Variable.dtype";
static const char __pyx_k_s3Variable_shape[] = "s3Variable.shape";
static const char __pyx_k_setncattr_string[] = "setncattr_string";
static const char __pyx_k_sys_version_info[] = "sys_version_info";
static const char __pyx_k_FileNotFoundError[] = "FileNotFoundError";
static const char __pyx_k_max_subarray_size[] = "max_subarray_size";
static const char __pyx_k_s3Dataset___enter[] = "s3Dataset.__enter__";
static const char __pyx_k_s3Dataset_ncattrs[] = "s3Dataset.ncattrs";
static const char __pyx_k_s3Dimension___len[] = "s3Dimension.__len__";
static const char __pyx_k_s3Group___getattr[] = "s3Group.__getattr__";
static const char __pyx_k_s3Group___getitem[] = "s3Group.__getitem__";
static const char __pyx_k_s3Group___setattr[] = "s3Group.__setattr__";
static const char __pyx_k_s3Group___unicode[] = "s3Group.__unicode__";
static const char __pyx_k_s3Group_delncattr[] = "s3Group.delncattr";
static const char __pyx_k_s3Group_getncattr[] = "s3Group.getncattr";
static const char __pyx_k_s3Group_setncattr[] = "s3Group.setncattr";
static const char __pyx_k_s3Group_setncatts[] = "s3Group.setncatts";
static const char __pyx_k_s3Group_variables[] = "s3Group.variables";
static const char __pyx_k_s3Variable___init[] = "s3Variable.__init__";
static const char __pyx_k_s3Variable___repr[] = "s3Variable.__repr__";
static const char __pyx_k_s3Variable_create[] = "s3Variable.create";
static const char __pyx_k_NETCDF3_64BIT_DATA[] = "NETCDF3_64BIT_DATA";
static const char __pyx_k_OPEN_NEW_IN_MEMORY[] = "OPEN_NEW_IN_MEMORY";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_s3Dimension___init[] = "s3Dimension.__init__";
static const char __pyx_k_s3Dimension___repr[] = "s3Dimension.__repr__";
static const char __pyx_k_s3Dimension_create[] = "s3Dimension.create";
static const char __pyx_k_s3Group_dimensions[] = "s3Group.dimensions";
static const char __pyx_k_s3Variable_ncattrs[] = "s3Variable.ncattrs";
static const char __pyx_k_OPEN_EXISTS_ON_DISK[] = "OPEN_EXISTS_ON_DISK";
static const char __pyx_k_get_file_open_state[] = "get_file_open_state";
static const char __pyx_k_s3Dataset___dealloc[] = "s3Dataset.__dealloc__";
static const char __pyx_k_s3Dataset___getattr[] = "s3Dataset.__getattr__";
static const char __pyx_k_s3Dataset___getitem[] = "s3Dataset.__getitem__";
static const char __pyx_k_s3Dataset___setattr[] = "s3Dataset.__setattr__";
static const char __pyx_k_s3Dataset___unicode[] = "s3Dataset.__unicode__";
static const char __pyx_k_s3Dataset_delncattr[] = "s3Dataset.delncattr";
static const char __pyx_k_s3Dataset_getncattr[] = "s3Dataset.getncattr";
static const char __pyx_k_s3Dataset_setncattr[] = "s3Dataset.setncattr";
static const char __pyx_k_s3Dataset_setncatts[] = "s3Dataset.setncatts";
static const char __pyx_k_s3Dataset_variables[] = "s3Dataset.variables";
static const char __pyx_k_KNOWN_EXISTS_ON_DISK[] = "KNOWN_EXISTS_ON_DISK";
static const char __pyx_k_NETCDF3_64BIT_OFFSET[] = "NETCDF3_64BIT_OFFSET";
static const char __pyx_k_S3netCDF4__s3netCDF4[] = "S3netCDF4._s3netCDF4";
static const char __pyx_k_open_subarray_ncfile[] = "__open_subarray_ncfile";
static const char __pyx_k_s3Dataset_dimensions[] = "s3Dataset.dimensions";
static const char __pyx_k_s3Variable___getattr[] = "s3Variable.__getattr__";
static const char __pyx_k_s3Variable___getitem[] = "s3Variable.__getitem__";
static const char __pyx_k_s3Variable___setattr[] = "s3Variable.__setattr__";
static const char __pyx_k_s3Variable___setitem[] = "s3Variable.__setitem__";
static const char __pyx_k_s3Variable___unicode[] = "s3Variable.__unicode__";
static const char __pyx_k_s3Variable_delncattr[] = "s3Variable.delncattr";
static const char __pyx_k_s3Variable_getncattr[] = "s3Variable.getncattr";
static const char __pyx_k_s3Variable_setncattr[] = "s3Variable.setncattr";
static const char __pyx_k_s3Variable_setncatts[] = "s3Variable.setncatts";
static const char __pyx_k_unlimited_dimensions[] = "unlimited dimensions: {}\n";
static const char __pyx_k_variables_dimensions[] = "    variables(dimensions): ";
static const char __pyx_k_OPEN_EXISTS_IN_MEMORY[] = "OPEN_EXISTS_IN_MEMORY";
static const char __pyx_k_S3netCDF4__Exceptions[] = "S3netCDF4._Exceptions";
static const char __pyx_k_s3Dataset_createGroup[] = "s3Dataset.createGroup";
static const char __pyx_k_s3Dataset_file_object[] = "s3Dataset.file_object";
static const char __pyx_k_s3Dataset_renameGroup[] = "s3Dataset.renameGroup";
static const char __pyx_k_s3Dimension___getattr[] = "s3Dimension.__getattr__";
static const char __pyx_k_s3Dimension___setattr[] = "s3Dimension.__setattr__";
static const char __pyx_k_s3Dimension___unicode[] = "s3Dimension.__unicode__";
static const char __pyx_k_s3Variable_dimensions[] = "s3Variable.dimensions";
static const char __pyx_k_create_subarray_ncfile[] = "__create_subarray_ncfile";
static const char __pyx_k_group_and_dataset_repr[] = "_group_and_dataset_repr";
static const char __pyx_k_partition_matrix_shape[] = "partition matrix shape: ({})\n";
static const char __pyx_k_s3Group_createVariable[] = "s3Group.createVariable";
static const char __pyx_k_s3Group_renameVariable[] = "s3Group.renameVariable";
static const char __pyx_k_KNOWN_EXISTS_ON_STORAGE[] = "KNOWN_EXISTS_ON_STORAGE";
static const char __pyx_k_Unsupported_CFA_version[] = "Unsupported CFA version {}.";
static const char __pyx_k_getPartitionMatrixShape[] = "getPartitionMatrixShape";
static const char __pyx_k_least_significant_digit[] = "least_significant_digit";
static const char __pyx_k_s3Group_createDimension[] = "s3Group.createDimension";
static const char __pyx_k_s3Group_renameDimension[] = "s3Group.renameDimension";
static const char __pyx_k_s3Variable_file_manager[] = "s3Variable.file_manager";
static const char __pyx_k_S3netCDF4__s3netCDF4_pyx[] = "S3netCDF4/_s3netCDF4.pyx";
static const char __pyx_k_s3Dataset_createVariable[] = "s3Dataset.createVariable";
static const char __pyx_k_s3Dataset_renameVariable[] = "s3Dataset.renameVariable";
static const char __pyx_k_s3Group_setncattr_string[] = "s3Group.setncattr_string";
static const char __pyx_k_File_is_not_a_netCDF_file[] = "File: {} is not a netCDF file";
static const char __pyx_k_S3netCDF4_CFA__CFAClasses[] = "S3netCDF4.CFA._CFAClasses";
static const char __pyx_k_duplicate_subarray_ncfile[] = "__duplicate_subarray_ncfile";
static const char __pyx_k_interpret_netCDF_filetype[] = "_interpret_netCDF_filetype";
static const char __pyx_k_s3Dataset_createDimension[] = "s3Dataset.createDimension";
static const char __pyx_k_s3Dataset_renameDimension[] = "s3Dataset.renameDimension";
static const char __pyx_k_writeInitialPartitionInfo[] = "writeInitialPartitionInfo";
static const char __pyx_k_s3Dataset_setncattr_string[] = "s3Dataset.setncattr_string";
static const char __pyx_k_partition_matrix_dimensions[] = "partition matrix dimensions: ({})";
static const char __pyx_k_s3Variable_setncattr_string[] = "s3Variable.setncattr_string";
static const char __pyx_k_S3netCDF4_CFA__CFAExceptions[] = "S3netCDF4.CFA._CFAExceptions";
static const char __pyx_k_getPartitionMatrixDimensions[] = "getPartitionMatrixDimensions";
static const char __pyx_k_Dimension_name_already_exists[] = "Dimension name: {} already exists.";
static const char __pyx_k_Dimension_name_does_not_exist[] = "Dimension name: {} does not exist.";
static const char __pyx_k_filling_on__FillValue_of_used[] = "filling on, _FillValue of {} used\n";
static const char __pyx_k_Attribute_not_found_in_dataset[] = "Attribute {} not found in dataset";
static const char __pyx_k_s3Variable__duplicate_subarray[] = "_s3Variable__duplicate_subarray_ncfile";
static const char __pyx_k_Attribute_not_found_in_variable[] = "Attribute {} not found in variable {}";
static const char __pyx_k_C_2019_2021_Science_and_Technol[] = "(C) 2019-2021 Science and Technology Facilities Council";
static const char __pyx_k_Cannot_find_group_or_dataset_in[] = "Cannot find group or dataset in parent";
static const char __pyx_k_Duplicate_the_UniData_netCDF4_D[] = "\n       Duplicate the UniData netCDF4 Dimension class and override some key member\n       functions to allow the adding dimensions to netCDF files and CFA netCDF\n       files.\n    ";
static const char __pyx_k_Duplicate_the_UniData_netCDF4_G[] = "\n       Duplicate the UniData netCDF4 Group class and override some key member\n       functions to allow the adding groups to netCDF files and CFA netCDF\n       files.\n    ";
static const char __pyx_k_Duplicate_the_UniData_netCDF4_V[] = "\n       Duplicate the UniData netCDF4 Variable class and override some key member\n       functions to allow the adding variables to netCDF files and CFA netCDF\n       files.\n    ";
static const char __pyx_k_S3netCDF4_Managers__FileManager[] = "S3netCDF4.Managers._FileManager";
static const char __pyx_k_not_found_as_a_group_or_variabl[] = "{} not found as a group or variable in Dataset";
static const char __pyx_k_s3Variable___duplicate_subarray[] = "s3Variable.__duplicate_subarray_ncfile";
static const char __pyx_k_s3Variable__create_subarray_ncf[] = "_s3Variable__create_subarray_ncfile";
static const char __pyx_k_s3Variable__open_subarray_ncfil[] = "_s3Variable__open_subarray_ncfile";
static const char __pyx_k_BSD_see_LICENSE_file_in_top_leve[] = "BSD - see LICENSE file in top-level directory";
static const char __pyx_k_CFA_0_5_is_not_compatible_with_N[] = "CFA 0.5 is not compatible with NETCDF3 file formats.";
static const char __pyx_k_Dimensions_has_to_be_of_type_tup[] = "Dimensions has to be of type tuple";
static const char __pyx_k_S3netCDF4_CFA_Parsers__CFAnetCDF[] = "S3netCDF4.CFA.Parsers._CFAnetCDFParser";
static const char __pyx_k_root_group_data_model_file_forma[] = "root group ({} data model, file format {}, CFA v{}):\n";
static const char __pyx_k_s3Dataset__interpret_netCDF_file[] = "s3Dataset._interpret_netCDF_filetype";
static const char __pyx_k_s3Variable___create_subarray_ncf[] = "s3Variable.__create_subarray_ncfile";
static const char __pyx_k_s3Variable___open_subarray_ncfil[] = "s3Variable.__open_subarray_ncfile";
static const char __pyx_k_Duplicate_the_UniData_netCDF4_D_2[] = "\n       Duplicate the UniData netCDF4 Dataset class and override some key member\n       functions to allow the read and write of netCDF files and CFA formatted\n       netCDF files to an object store accessed via an AWS S3 HTTP API.\n    ";
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_kp_u_0_4;
static PyObject *__pyx_kp_u_0_5;
static PyObject *__pyx_kp_u_2;
static PyObject *__pyx_kp_u_5;
static PyObject *__pyx_n_s_APIException;
static PyObject *__pyx_kp_u_Attribute_not_found_in_dataset;
static PyObject *__pyx_kp_u_Attribute_not_found_in_variable;
static PyObject *__pyx_kp_u_BSD_see_LICENSE_file_in_top_leve;
static PyObject *__pyx_n_b_CDF;
static PyObject *__pyx_n_u_CFA3;
static PyObject *__pyx_n_u_CFA4;
static PyObject *__pyx_n_s_CFADataset;
static PyObject *__pyx_n_s_CFADimension;
static PyObject *__pyx_n_s_CFAError;
static PyObject *__pyx_n_s_CFAGroup;
static PyObject *__pyx_n_s_CFAVariable;
static PyObject *__pyx_kp_u_CFA_0_5_is_not_compatible_with_N;
static PyObject *__pyx_n_s_CFA_netCDFParser;
static PyObject *__pyx_kp_u_C_2019_2021_Science_and_Technol;
static PyObject *__pyx_kp_u_Cannot_find_group_or_dataset_in;
static PyObject *__pyx_n_u_DEFAULT;
static PyObject *__pyx_n_s_DOES_NOT_EXIST;
static PyObject *__pyx_n_s_Dataset;
static PyObject *__pyx_kp_u_Dimension_name_already_exists;
static PyObject *__pyx_kp_u_Dimension_name_does_not_exist;
static PyObject *__pyx_kp_u_Dimensions_has_to_be_of_type_tup;
static PyObject *__pyx_kp_s_Duplicate_the_UniData_netCDF4_D;
static PyObject *__pyx_kp_s_Duplicate_the_UniData_netCDF4_D_2;
static PyObject *__pyx_kp_s_Duplicate_the_UniData_netCDF4_G;
static PyObject *__pyx_kp_s_Duplicate_the_UniData_netCDF4_V;
static PyObject *__pyx_n_s_ENOENT;
static PyObject *__pyx_n_s_FileManager;
static PyObject *__pyx_n_s_FileNotFoundError;
static PyObject *__pyx_kp_u_File_is_not_a_netCDF_file;
static PyObject *__pyx_n_s_FillValue;
static PyObject *__pyx_n_u_FillValue;
static PyObject *__pyx_n_b_HDF;
static PyObject *__pyx_n_s_IOError;
static PyObject *__pyx_n_s_IOException;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_n_s_KNOWN_EXISTS_ON_DISK;
static PyObject *__pyx_n_s_KNOWN_EXISTS_ON_STORAGE;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_kp_u_Mode;
static PyObject *__pyx_n_u_NETCDF3_64BIT_DATA;
static PyObject *__pyx_n_u_NETCDF3_64BIT_OFFSET;
static PyObject *__pyx_n_u_NETCDF3_CLASSIC;
static PyObject *__pyx_n_u_NETCDF4;
static PyObject *__pyx_n_u_NOT_NETCDF;
static PyObject *__pyx_kp_u_Neil_Massey;
static PyObject *__pyx_n_s_OPEN_EXISTS_IN_MEMORY;
static PyObject *__pyx_n_s_OPEN_EXISTS_ON_DISK;
static PyObject *__pyx_n_s_OPEN_NEW_IN_MEMORY;
static PyObject *__pyx_n_s_OPEN_NEW_ON_DISK;
static PyObject *__pyx_n_s_OpenFileRecord;
static PyObject *__pyx_n_s_S3netCDF4_CFA_Parsers__CFAnetCDF;
static PyObject *__pyx_n_s_S3netCDF4_CFA__CFAClasses;
static PyObject *__pyx_n_s_S3netCDF4_CFA__CFAExceptions;
static PyObject *__pyx_n_s_S3netCDF4_Managers__FileManager;
static PyObject *__pyx_n_s_S3netCDF4__Exceptions;
static PyObject *__pyx_n_s_S3netCDF4__s3netCDF4;
static PyObject *__pyx_kp_s_S3netCDF4__s3netCDF4_pyx;
static PyObject *__pyx_n_u_U;
static PyObject *__pyx_kp_u_Unsupported_CFA_version;
static PyObject *__pyx_kp_u__10;
static PyObject *__pyx_kp_u__11;
static PyObject *__pyx_kp_u__13;
static PyObject *__pyx_kp_b__17;
static PyObject *__pyx_kp_b__18;
static PyObject *__pyx_kp_b__19;
static PyObject *__pyx_kp_u__2;
static PyObject *__pyx_kp_b__20;
static PyObject *__pyx_n_s__22;
static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_kp_u__5;
static PyObject *__pyx_kp_u__6;
static PyObject *__pyx_kp_u__7;
static PyObject *__pyx_kp_u__8;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_attdict;
static PyObject *__pyx_n_s_atype;
static PyObject *__pyx_n_s_authors;
static PyObject *__pyx_n_s_axis_type;
static PyObject *__pyx_kp_u_axis_type_2;
static PyObject *__pyx_n_u_cfa;
static PyObject *__pyx_n_s_cfa_dataset;
static PyObject *__pyx_n_u_cfa_dataset;
static PyObject *__pyx_n_s_cfa_dim;
static PyObject *__pyx_n_s_cfa_dim_2;
static PyObject *__pyx_n_u_cfa_dim_2;
static PyObject *__pyx_n_s_cfa_ds;
static PyObject *__pyx_n_u_cfa_group;
static PyObject *__pyx_n_s_cfa_group_names;
static PyObject *__pyx_kp_u_cfa_groups;
static PyObject *__pyx_n_s_cfa_grp;
static PyObject *__pyx_n_u_cfa_grp;
static PyObject *__pyx_n_s_cfa_grp_2;
static PyObject *__pyx_n_s_cfa_meta;
static PyObject *__pyx_n_s_cfa_obj;
static PyObject *__pyx_n_s_cfa_root_group;
static PyObject *__pyx_n_s_cfa_var;
static PyObject *__pyx_n_s_cfa_var_2;
static PyObject *__pyx_n_u_cfa_var_2;
static PyObject *__pyx_n_s_cfa_version;
static PyObject *__pyx_n_s_chunk_cache;
static PyObject *__pyx_n_s_chunksizes;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_clobber;
static PyObject *__pyx_n_u_clobber;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_complevel;
static PyObject *__pyx_n_s_contiguous;
static PyObject *__pyx_n_s_copyright;
static PyObject *__pyx_n_s_create;
static PyObject *__pyx_n_s_createDimension;
static PyObject *__pyx_n_s_createGroup;
static PyObject *__pyx_n_s_createVariable;
static PyObject *__pyx_n_s_create_subarray_ncfile;
static PyObject *__pyx_n_s_creation_params;
static PyObject *__pyx_n_u_creation_params;
static PyObject *__pyx_kp_u_current_shape;
static PyObject *__pyx_n_s_d;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_data_model;
static PyObject *__pyx_n_u_data_model;
static PyObject *__pyx_n_s_data_object;
static PyObject *__pyx_n_s_datatype;
static PyObject *__pyx_n_s_dealloc;
static PyObject *__pyx_n_s_delncattr;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dim;
static PyObject *__pyx_n_s_dim_len;
static PyObject *__pyx_n_s_dim_name;
static PyObject *__pyx_n_s_dim_names;
static PyObject *__pyx_n_s_dim_names_sizes;
static PyObject *__pyx_n_s_dimensions;
static PyObject *__pyx_kp_u_dimensions_sizes;
static PyObject *__pyx_n_s_dimid;
static PyObject *__pyx_n_u_dimid;
static PyObject *__pyx_n_s_dimname;
static PyObject *__pyx_n_s_disk_format;
static PyObject *__pyx_n_s_diskless;
static PyObject *__pyx_n_u_diskless;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_duplicate_subarray_ncfile;
static PyObject *__pyx_n_s_elem;
static PyObject *__pyx_n_s_endian;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_errno;
static PyObject *__pyx_n_s_errno_ENOENT;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_extend;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_file_manager;
static PyObject *__pyx_n_u_file_manager;
static PyObject *__pyx_n_s_file_manager_2;
static PyObject *__pyx_n_s_file_object;
static PyObject *__pyx_n_s_file_type;
static PyObject *__pyx_n_s_file_version;
static PyObject *__pyx_n_s_filename;
static PyObject *__pyx_n_s_fill_value;
static PyObject *__pyx_kp_u_filling_off;
static PyObject *__pyx_kp_u_filling_on__FillValue_of_used;
static PyObject *__pyx_n_s_fletcher32;
static PyObject *__pyx_n_s_fname;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_u_format;
static PyObject *__pyx_n_s_free_all_arrays;
static PyObject *__pyx_n_s_free_all_files;
static PyObject *__pyx_n_s_g;
static PyObject *__pyx_n_s_getAxisType;
static PyObject *__pyx_n_s_getBaseFilename;
static PyObject *__pyx_n_s_getCFAVersion;
static PyObject *__pyx_n_s_getDimension;
static PyObject *__pyx_n_s_getDimensions;
static PyObject *__pyx_n_s_getFormat;
static PyObject *__pyx_n_s_getGroup;
static PyObject *__pyx_n_u_getGroup;
static PyObject *__pyx_n_s_getLen;
static PyObject *__pyx_n_s_getMetadata;
static PyObject *__pyx_n_s_getName;
static PyObject *__pyx_n_s_getPartitionMatrixDimensions;
static PyObject *__pyx_n_s_getPartitionMatrixShape;
static PyObject *__pyx_n_s_getType;
static PyObject *__pyx_n_s_getVariable;
static PyObject *__pyx_n_s_getVariables;
static PyObject *__pyx_n_s_get_file_open_state;
static PyObject *__pyx_n_s_getattr;
static PyObject *__pyx_n_s_getitem;
static PyObject *__pyx_n_s_getncattr;
static PyObject *__pyx_kp_u_group;
static PyObject *__pyx_n_s_group_and_dataset_repr;
static PyObject *__pyx_n_s_group_names;
static PyObject *__pyx_n_s_groupname;
static PyObject *__pyx_n_s_groups;
static PyObject *__pyx_n_u_groups;
static PyObject *__pyx_kp_u_groups_2;
static PyObject *__pyx_n_s_grp;
static PyObject *__pyx_n_u_grp;
static PyObject *__pyx_n_s_grp_2;
static PyObject *__pyx_n_s_grp_name;
static PyObject *__pyx_n_s_grpid;
static PyObject *__pyx_n_u_grpid;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_in_memory;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_index_list;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_kp_u_inmemory_nc;
static PyObject *__pyx_n_s_interpret_netCDF_filetype;
static PyObject *__pyx_n_s_is_file;
static PyObject *__pyx_n_s_isunlimited;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_itemsize;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_keepweakref;
static PyObject *__pyx_n_u_keepweakref;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_least_significant_digit;
static PyObject *__pyx_n_s_len;
static PyObject *__pyx_n_s_license;
static PyObject *__pyx_n_s_location;
static PyObject *__pyx_n_s_lock;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_managed_object;
static PyObject *__pyx_n_u_managed_object;
static PyObject *__pyx_n_s_max_subarray_size;
static PyObject *__pyx_n_s_memory;
static PyObject *__pyx_n_u_memory;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_metadata;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_u_mode;
static PyObject *__pyx_n_s_mode_2;
static PyObject *__pyx_n_u_mode_2;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_u_name_2;
static PyObject *__pyx_kp_u_name_3;
static PyObject *__pyx_n_s_name_4;
static PyObject *__pyx_n_u_native;
static PyObject *__pyx_n_s_nc_bytes;
static PyObject *__pyx_n_s_nc_dataset;
static PyObject *__pyx_n_u_nc_dataset;
static PyObject *__pyx_n_s_nc_dim;
static PyObject *__pyx_n_s_nc_dim_2;
static PyObject *__pyx_n_u_nc_dim_2;
static PyObject *__pyx_n_s_nc_dimensions;
static PyObject *__pyx_n_s_nc_ds;
static PyObject *__pyx_n_s_nc_dtype;
static PyObject *__pyx_n_s_nc_grp;
static PyObject *__pyx_n_u_nc_grp;
static PyObject *__pyx_n_s_nc_grp_2;
static PyObject *__pyx_n_s_nc_in_dataset;
static PyObject *__pyx_n_s_nc_obj;
static PyObject *__pyx_n_s_nc_object;
static PyObject *__pyx_n_s_nc_out_dataset;
static PyObject *__pyx_n_s_nc_parent;
static PyObject *__pyx_n_s_nc_sa_dataset;
static PyObject *__pyx_n_s_nc_sa_dim_var;
static PyObject *__pyx_n_s_nc_sa_fld_var;
static PyObject *__pyx_n_s_nc_sa_grp;
static PyObject *__pyx_n_s_nc_var;
static PyObject *__pyx_n_s_nc_var_2;
static PyObject *__pyx_n_u_nc_var_2;
static PyObject *__pyx_n_s_ncattrs;
static PyObject *__pyx_n_s_ncd;
static PyObject *__pyx_n_s_ncdump;
static PyObject *__pyx_n_s_netCDF4;
static PyObject *__pyx_n_s_netCDF4__netCDF4;
static PyObject *__pyx_n_s_new_grp;
static PyObject *__pyx_n_s_new_var;
static PyObject *__pyx_n_s_newname;
static PyObject *__pyx_kp_u_not_found_as_a_group_or_variabl;
static PyObject *__pyx_kp_u_not_supported;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_oldname;
static PyObject *__pyx_n_s_open_mode;
static PyObject *__pyx_n_s_open_state;
static PyObject *__pyx_n_s_open_subarray_ncfile;
static PyObject *__pyx_n_s_open_success;
static PyObject *__pyx_n_s_orig_mode;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_parallel;
static PyObject *__pyx_n_s_parent;
static PyObject *__pyx_n_u_parent;
static PyObject *__pyx_n_s_parser;
static PyObject *__pyx_n_s_partition;
static PyObject *__pyx_kp_u_partition_matrix_dimensions;
static PyObject *__pyx_kp_u_partition_matrix_shape;
static PyObject *__pyx_n_s_persist;
static PyObject *__pyx_n_u_persist;
static PyObject *__pyx_n_s_pm_dimensions;
static PyObject *__pyx_n_s_pm_shape;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_private_atts;
static PyObject *__pyx_n_s_prod;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_psutil;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_u_r;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_read_from;
static PyObject *__pyx_n_s_remote_system;
static PyObject *__pyx_n_s_renameDimension;
static PyObject *__pyx_n_s_renameGroup;
static PyObject *__pyx_n_s_renameVariable;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_s_request_array;
static PyObject *__pyx_n_s_request_file;
static PyObject *__pyx_n_s_request_object;
static PyObject *__pyx_n_u_root;
static PyObject *__pyx_kp_u_root_group_data_model_file_forma;
static PyObject *__pyx_n_s_s3Dataset;
static PyObject *__pyx_n_s_s3Dataset___dealloc;
static PyObject *__pyx_n_s_s3Dataset___enter;
static PyObject *__pyx_n_s_s3Dataset___exit;
static PyObject *__pyx_n_s_s3Dataset___getattr;
static PyObject *__pyx_n_s_s3Dataset___getitem;
static PyObject *__pyx_n_s_s3Dataset___init;
static PyObject *__pyx_n_s_s3Dataset___repr;
static PyObject *__pyx_n_s_s3Dataset___setattr;
static PyObject *__pyx_n_s_s3Dataset___unicode;
static PyObject *__pyx_n_s_s3Dataset__interpret_netCDF_file;
static PyObject *__pyx_n_s_s3Dataset_close;
static PyObject *__pyx_n_s_s3Dataset_createDimension;
static PyObject *__pyx_n_s_s3Dataset_createGroup;
static PyObject *__pyx_n_s_s3Dataset_createVariable;
static PyObject *__pyx_n_s_s3Dataset_delncattr;
static PyObject *__pyx_n_s_s3Dataset_dimensions;
static PyObject *__pyx_n_s_s3Dataset_file_object;
static PyObject *__pyx_n_s_s3Dataset_getncattr;
static PyObject *__pyx_n_s_s3Dataset_groups;
static PyObject *__pyx_n_s_s3Dataset_ncattrs;
static PyObject *__pyx_n_s_s3Dataset_renameDimension;
static PyObject *__pyx_n_s_s3Dataset_renameGroup;
static PyObject *__pyx_n_s_s3Dataset_renameVariable;
static PyObject *__pyx_n_s_s3Dataset_setncattr;
static PyObject *__pyx_n_s_s3Dataset_setncattr_string;
static PyObject *__pyx_n_s_s3Dataset_setncatts;
static PyObject *__pyx_n_s_s3Dataset_variables;
static PyObject *__pyx_n_s_s3Dimension;
static PyObject *__pyx_n_s_s3Dimension___getattr;
static PyObject *__pyx_n_s_s3Dimension___init;
static PyObject *__pyx_n_s_s3Dimension___len;
static PyObject *__pyx_n_s_s3Dimension___repr;
static PyObject *__pyx_n_s_s3Dimension___setattr;
static PyObject *__pyx_n_s_s3Dimension___unicode;
static PyObject *__pyx_n_s_s3Dimension_create;
static PyObject *__pyx_n_s_s3Dimension_size;
static PyObject *__pyx_n_s_s3Group;
static PyObject *__pyx_n_s_s3Group___getattr;
static PyObject *__pyx_n_s_s3Group___getitem;
static PyObject *__pyx_n_s_s3Group___init;
static PyObject *__pyx_n_s_s3Group___repr;
static PyObject *__pyx_n_s_s3Group___setattr;
static PyObject *__pyx_n_s_s3Group___unicode;
static PyObject *__pyx_n_s_s3Group_create;
static PyObject *__pyx_n_s_s3Group_createDimension;
static PyObject *__pyx_n_s_s3Group_createVariable;
static PyObject *__pyx_n_s_s3Group_delncattr;
static PyObject *__pyx_n_s_s3Group_dimensions;
static PyObject *__pyx_n_s_s3Group_getncattr;
static PyObject *__pyx_n_s_s3Group_ncattrs;
static PyObject *__pyx_n_s_s3Group_renameDimension;
static PyObject *__pyx_n_s_s3Group_renameVariable;
static PyObject *__pyx_n_s_s3Group_setncattr;
static PyObject *__pyx_n_s_s3Group_setncattr_string;
static PyObject *__pyx_n_s_s3Group_setncatts;
static PyObject *__pyx_n_s_s3Group_variables;
static PyObject *__pyx_n_s_s3Variable;
static PyObject *__pyx_n_s_s3Variable___create_subarray_ncf;
static PyObject *__pyx_n_s_s3Variable___duplicate_subarray;
static PyObject *__pyx_n_s_s3Variable___getattr;
static PyObject *__pyx_n_s_s3Variable___getitem;
static PyObject *__pyx_n_s_s3Variable___init;
static PyObject *__pyx_n_s_s3Variable___open_subarray_ncfil;
static PyObject *__pyx_n_s_s3Variable___repr;
static PyObject *__pyx_n_s_s3Variable___setattr;
static PyObject *__pyx_n_s_s3Variable___setitem;
static PyObject *__pyx_n_s_s3Variable___unicode;
static PyObject *__pyx_n_s_s3Variable__create_subarray_ncf;
static PyObject *__pyx_n_s_s3Variable__duplicate_subarray;
static PyObject *__pyx_n_s_s3Variable__open_subarray_ncfil;
static PyObject *__pyx_n_s_s3Variable_create;
static PyObject *__pyx_n_s_s3Variable_delncattr;
static PyObject *__pyx_n_s_s3Variable_dimensions;
static PyObject *__pyx_n_s_s3Variable_dtype;
static PyObject *__pyx_n_s_s3Variable_file_manager;
static PyObject *__pyx_n_s_s3Variable_getncattr;
static PyObject *__pyx_n_s_s3Variable_ncattrs;
static PyObject *__pyx_n_s_s3Variable_setncattr;
static PyObject *__pyx_n_s_s3Variable_setncattr_string;
static PyObject *__pyx_n_s_s3Variable_setncatts;
static PyObject *__pyx_n_s_s3Variable_shape;
static PyObject *__pyx_n_s_s3_dataset;
static PyObject *__pyx_n_s_s3_dimensions;
static PyObject *__pyx_n_u_s3_dimensions;
static PyObject *__pyx_n_s_s3_groups;
static PyObject *__pyx_n_u_s3_groups;
static PyObject *__pyx_n_s_s3_variables;
static PyObject *__pyx_n_u_s3_variables;
static PyObject *__pyx_n_s_s3d;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_setType;
static PyObject *__pyx_n_s_setattr;
static PyObject *__pyx_n_s_setitem;
static PyObject *__pyx_n_s_setncattr;
static PyObject *__pyx_n_s_setncattr_string;
static PyObject *__pyx_n_s_setncatts;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_u_shape;
static PyObject *__pyx_n_s_shuffle;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_kp_u_size_2;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_s_strerror;
static PyObject *__pyx_n_s_subarray_shape;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_sys_version_info;
static PyObject *__pyx_n_s_target;
static PyObject *__pyx_n_s_target_array;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_traceback;
static PyObject *__pyx_kp_u_type;
static PyObject *__pyx_n_s_unicode;
static PyObject *__pyx_n_s_unlimdims;
static PyObject *__pyx_kp_u_unlimited_True;
static PyObject *__pyx_kp_u_unlimited_dimensions;
static PyObject *__pyx_n_s_url;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_var;
static PyObject *__pyx_n_s_var_name;
static PyObject *__pyx_n_s_var_names_dims;
static PyObject *__pyx_n_s_variables;
static PyObject *__pyx_kp_u_variables_dimensions;
static PyObject *__pyx_n_s_varname;
static PyObject *__pyx_n_s_version_info;
static PyObject *__pyx_n_s_virtual_memory;
static PyObject *__pyx_n_u_w;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_writeInitialPartitionInfo;
static PyObject *__pyx_n_s_writePartition;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_zlib;
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cfa_dim, PyObject *__pyx_v_nc_dim, PyObject *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_2create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_name, PyObject *__pyx_v_size, PyObject *__pyx_v_axis_type, CYTHON_UNUSED PyObject *__pyx_v_metadata, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_4__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_6__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_8__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_10size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_12__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_14__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cfa_var, PyObject *__pyx_v_cfa_dim, PyObject *__pyx_v_nc_var, PyObject *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_2file_manager(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_4create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_name, PyObject *__pyx_v_datatype, PyObject *__pyx_v_dimensions, PyObject *__pyx_v_zlib, PyObject *__pyx_v_complevel, PyObject *__pyx_v_shuffle, PyObject *__pyx_v_fletcher32, PyObject *__pyx_v_contiguous, PyObject *__pyx_v_chunksizes, PyObject *__pyx_v_endian, PyObject *__pyx_v_least_significant_digit, PyObject *__pyx_v_fill_value, PyObject *__pyx_v_chunk_cache, PyObject *__pyx_v_subarray_shape, PyObject *__pyx_v_max_subarray_size, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_6shape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_8dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_10dimensions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_12__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_14__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_16delncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_18getncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_20ncattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_22setncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_24setncattr_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_26setncatts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attdict); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_28__open_subarray_ncfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_request_object, PyObject *__pyx_v_in_memory, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_30__duplicate_subarray_ncfile(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_nc_in_dataset, PyObject *__pyx_v_nc_out_dataset); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_32__create_subarray_ncfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_in_memory, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_34__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elem, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_36__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elem); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_38__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_40__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4__group_and_dataset_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ncdump, PyObject *__pyx_v_cfa_obj, PyObject *__pyx_v_nc_obj); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nc_grp, PyObject *__pyx_v_cfa_grp, PyObject *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_2create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_4createDimension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dimname, PyObject *__pyx_v_size, PyObject *__pyx_v_axis_type, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_6renameDimension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_8createVariable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_varname, PyObject *__pyx_v_datatype, PyObject *__pyx_v_dimensions, PyObject *__pyx_v_zlib, PyObject *__pyx_v_complevel, PyObject *__pyx_v_shuffle, PyObject *__pyx_v_fletcher32, PyObject *__pyx_v_contiguous, PyObject *__pyx_v_chunksizes, PyObject *__pyx_v_endian, PyObject *__pyx_v_least_significant_digit, PyObject *__pyx_v_fill_value, PyObject *__pyx_v_chunk_cache, PyObject *__pyx_v_subarray_shape, PyObject *__pyx_v_max_subarray_size); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_10renameVariable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_12delncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_14getncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_16ncattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_18setncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_20setncattr_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_22setncatts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attdict); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_24__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elem); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_26variables(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_28dimensions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_30__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_32__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_34__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_36__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_file_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_clobber, PyObject *__pyx_v_format, PyObject *__pyx_v_diskless, PyObject *__pyx_v_persist, PyObject *__pyx_v_keepweakref, PyObject *__pyx_v_memory, PyObject *__pyx_v_cfa_version, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_4__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_6__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_atype, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_8close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_10__dealloc__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_12createDimension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dimname, PyObject *__pyx_v_size, PyObject *__pyx_v_axis_type, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_14renameDimension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_16createVariable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_varname, PyObject *__pyx_v_datatype, PyObject *__pyx_v_dimensions, PyObject *__pyx_v_zlib, PyObject *__pyx_v_complevel, PyObject *__pyx_v_shuffle, PyObject *__pyx_v_fletcher32, PyObject *__pyx_v_contiguous, PyObject *__pyx_v_chunksizes, PyObject *__pyx_v_endian, PyObject *__pyx_v_least_significant_digit, PyObject *__pyx_v_fill_value, PyObject *__pyx_v_chunk_cache, PyObject *__pyx_v_subarray_shape, PyObject *__pyx_v_max_subarray_size); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_18renameVariable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_20createGroup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_groupname); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_22renameGroup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_24__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_26__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_28__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elem); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_30groups(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_32variables(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_34dimensions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_36__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_38__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_40_interpret_netCDF_filetype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_42delncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_44getncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_46ncattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_48setncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_50setncattr_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_52setncatts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attdict); /* proto */
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_neg_2;
static PyObject *__pyx_slice__4;
static PyObject *__pyx_slice__9;
static PyObject *__pyx_slice__12;
static PyObject *__pyx_slice__16;
static PyObject *__pyx_slice__21;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__161;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__181;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_codeobj__25;
static PyObject *__pyx_codeobj__28;
static PyObject *__pyx_codeobj__30;
static PyObject *__pyx_codeobj__32;
static PyObject *__pyx_codeobj__34;
static PyObject *__pyx_codeobj__36;
static PyObject *__pyx_codeobj__38;
static PyObject *__pyx_codeobj__40;
static PyObject *__pyx_codeobj__43;
static PyObject *__pyx_codeobj__46;
static PyObject *__pyx_codeobj__48;
static PyObject *__pyx_codeobj__50;
static PyObject *__pyx_codeobj__52;
static PyObject *__pyx_codeobj__54;
static PyObject *__pyx_codeobj__56;
static PyObject *__pyx_codeobj__58;
static PyObject *__pyx_codeobj__60;
static PyObject *__pyx_codeobj__62;
static PyObject *__pyx_codeobj__64;
static PyObject *__pyx_codeobj__66;
static PyObject *__pyx_codeobj__68;
static PyObject *__pyx_codeobj__70;
static PyObject *__pyx_codeobj__72;
static PyObject *__pyx_codeobj__75;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__80;
static PyObject *__pyx_codeobj__82;
static PyObject *__pyx_codeobj__84;
static PyObject *__pyx_codeobj__86;
static PyObject *__pyx_codeobj__88;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__94;
static PyObject *__pyx_codeobj__96;
static PyObject *__pyx_codeobj__98;
static PyObject *__pyx_codeobj__100;
static PyObject *__pyx_codeobj__102;
static PyObject *__pyx_codeobj__104;
static PyObject *__pyx_codeobj__106;
static PyObject *__pyx_codeobj__108;
static PyObject *__pyx_codeobj__110;
static PyObject *__pyx_codeobj__112;
static PyObject *__pyx_codeobj__114;
static PyObject *__pyx_codeobj__116;
static PyObject *__pyx_codeobj__118;
static PyObject *__pyx_codeobj__120;
static PyObject *__pyx_codeobj__122;
static PyObject *__pyx_codeobj__124;
static PyObject *__pyx_codeobj__126;
static PyObject *__pyx_codeobj__128;
static PyObject *__pyx_codeobj__131;
static PyObject *__pyx_codeobj__133;
static PyObject *__pyx_codeobj__136;
static PyObject *__pyx_codeobj__138;
static PyObject *__pyx_codeobj__140;
static PyObject *__pyx_codeobj__142;
static PyObject *__pyx_codeobj__144;
static PyObject *__pyx_codeobj__146;
static PyObject *__pyx_codeobj__148;
static PyObject *__pyx_codeobj__150;
static PyObject *__pyx_codeobj__152;
static PyObject *__pyx_codeobj__154;
static PyObject *__pyx_codeobj__156;
static PyObject *__pyx_codeobj__158;
static PyObject *__pyx_codeobj__160;
static PyObject *__pyx_codeobj__162;
static PyObject *__pyx_codeobj__164;
static PyObject *__pyx_codeobj__166;
static PyObject *__pyx_codeobj__168;
static PyObject *__pyx_codeobj__170;
static PyObject *__pyx_codeobj__172;
static PyObject *__pyx_codeobj__174;
static PyObject *__pyx_codeobj__176;
static PyObject *__pyx_codeobj__178;
static PyObject *__pyx_codeobj__180;
static PyObject *__pyx_codeobj__182;
static PyObject *__pyx_codeobj__184;
/* Late includes */

/* "S3netCDF4/_s3netCDF4.pyx":41
 *     """
 *     _private_atts = ["_cfa_dim", "_nc_dim"]
 *     def __init__(self, cfa_dim=None, nc_dim=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the dimension.  The variables will be loaded in by
 *         either the createDimension method(s) or the load function called from
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_11s3Dimension___init__[] = "Just initialise the dimension.  The variables will be loaded in by\n        either the createDimension method(s) or the load function called from\n        the parser.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_11s3Dimension___init__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_cfa_dim = 0;
  PyObject *__pyx_v_nc_dim = 0;
  PyObject *__pyx_v_parent = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_cfa_dim,&__pyx_n_s_nc_dim,&__pyx_n_s_parent,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfa_dim);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc_dim);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 41, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_cfa_dim = values[1];
    __pyx_v_nc_dim = values[2];
    __pyx_v_parent = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 41, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dimension.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension___init__(__pyx_self, __pyx_v_self, __pyx_v_cfa_dim, __pyx_v_nc_dim, __pyx_v_parent);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cfa_dim, PyObject *__pyx_v_nc_dim, PyObject *__pyx_v_parent) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":45
 *         either the createDimension method(s) or the load function called from
 *         the parser."""
 *         self._cfa_dim = cfa_dim             # <<<<<<<<<<<<<<
 *         self._nc_dim = nc_dim
 *         self.parent = parent
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2, __pyx_v_cfa_dim) < 0) __PYX_ERR(0, 45, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":46
 *         the parser."""
 *         self._cfa_dim = cfa_dim
 *         self._nc_dim = nc_dim             # <<<<<<<<<<<<<<
 *         self.parent = parent
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2, __pyx_v_nc_dim) < 0) __PYX_ERR(0, 46, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":47
 *         self._cfa_dim = cfa_dim
 *         self._nc_dim = nc_dim
 *         self.parent = parent             # <<<<<<<<<<<<<<
 * 
 *     def create(self, parent, name, size=None,
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 47, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":41
 *     """
 *     _private_atts = ["_cfa_dim", "_nc_dim"]
 *     def __init__(self, cfa_dim=None, nc_dim=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the dimension.  The variables will be loaded in by
 *         either the createDimension method(s) or the load function called from
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dimension.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":49
 *         self.parent = parent
 * 
 *     def create(self, parent, name, size=None,             # <<<<<<<<<<<<<<
 *                axis_type="U", metadata={}, **kwargs):
 *         """Initialise the dimension.  This adds the CFADimension structure to
 */

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject*)__pyx_n_u_U));
  __Pyx_GIVEREF(((PyObject*)__pyx_n_u_U));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_u_U));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_metadata);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_metadata);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_metadata);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __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(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_3create(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_11s3Dimension_2create[] = "Initialise the dimension.  This adds the CFADimension structure to\n        the dimension as well as initialising the superclass.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_3create = {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_3create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_11s3Dimension_2create};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_3create(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_axis_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_metadata = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_parent,&__pyx_n_s_name,&__pyx_n_s_size,&__pyx_n_s_axis_type,&__pyx_n_s_metadata,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject*)__pyx_n_u_U));
    values[5] = __pyx_dynamic_args->__pyx_arg_metadata;
    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);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create", 0, 3, 6, 1); __PYX_ERR(0, 49, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create", 0, 3, 6, 2); __PYX_ERR(0, 49, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_axis_type);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "create") < 0)) __PYX_ERR(0, 49, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_self = values[0];
    __pyx_v_parent = values[1];
    __pyx_v_name = values[2];
    __pyx_v_size = values[3];
    __pyx_v_axis_type = values[4];
    __pyx_v_metadata = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 49, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dimension.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_2create(__pyx_self, __pyx_v_self, __pyx_v_parent, __pyx_v_name, __pyx_v_size, __pyx_v_axis_type, __pyx_v_metadata, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_2create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_name, PyObject *__pyx_v_size, PyObject *__pyx_v_axis_type, CYTHON_UNUSED PyObject *__pyx_v_metadata, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_nc_object = NULL;
  PyObject *__pyx_v_cfa_root_group = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":54
 *         the dimension as well as initialising the superclass."""
 *         # Has this been called from a group?
 *         if hasattr(parent, "_cfa_grp") and parent._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_dim = parent._cfa_grp.createDimension(
 *                                 name, size, axis_type=axis_type
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_parent, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 54, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":55
 *         # Has this been called from a group?
 *         if hasattr(parent, "_cfa_grp") and parent._cfa_grp:
 *             self._cfa_dim = parent._cfa_grp.createDimension(             # <<<<<<<<<<<<<<
 *                                 name, size, axis_type=axis_type
 *                             )
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_createDimension); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":56
 *         if hasattr(parent, "_cfa_grp") and parent._cfa_grp:
 *             self._cfa_dim = parent._cfa_grp.createDimension(
 *                                 name, size, axis_type=axis_type             # <<<<<<<<<<<<<<
 *                             )
 *             nc_object = parent._nc_grp
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_GIVEREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_size);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis_type, __pyx_v_axis_type) < 0) __PYX_ERR(0, 56, __pyx_L1_error)

    /* "S3netCDF4/_s3netCDF4.pyx":55
 *         # Has this been called from a group?
 *         if hasattr(parent, "_cfa_grp") and parent._cfa_grp:
 *             self._cfa_dim = parent._cfa_grp.createDimension(             # <<<<<<<<<<<<<<
 *                                 name, size, axis_type=axis_type
 *                             )
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __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;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2, __pyx_t_7) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":58
 *                                 name, size, axis_type=axis_type
 *                             )
 *             nc_object = parent._nc_grp             # <<<<<<<<<<<<<<
 *         # or has it been called from a dataset?
 *         elif hasattr(parent, "_cfa_dataset") and parent._cfa_dataset:
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_v_nc_object = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":54
 *         the dimension as well as initialising the superclass."""
 *         # Has this been called from a group?
 *         if hasattr(parent, "_cfa_grp") and parent._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_dim = parent._cfa_grp.createDimension(
 *                                 name, size, axis_type=axis_type
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":60
 *             nc_object = parent._nc_grp
 *         # or has it been called from a dataset?
 *         elif hasattr(parent, "_cfa_dataset") and parent._cfa_dataset:             # <<<<<<<<<<<<<<
 *             cfa_root_group = parent._cfa_dataset.getGroup("root")
 *             self._cfa_dim = cfa_root_group.createDimension(
 */
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_parent, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 60, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":61
 *         # or has it been called from a dataset?
 *         elif hasattr(parent, "_cfa_dataset") and parent._cfa_dataset:
 *             cfa_root_group = parent._cfa_dataset.getGroup("root")             # <<<<<<<<<<<<<<
 *             self._cfa_dim = cfa_root_group.createDimension(
 *                                 name, size, axis_type=axis_type
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_n_u_root) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_u_root);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_cfa_root_group = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":62
 *         elif hasattr(parent, "_cfa_dataset") and parent._cfa_dataset:
 *             cfa_root_group = parent._cfa_dataset.getGroup("root")
 *             self._cfa_dim = cfa_root_group.createDimension(             # <<<<<<<<<<<<<<
 *                                 name, size, axis_type=axis_type
 *                             )
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_root_group, __pyx_n_s_createDimension); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "S3netCDF4/_s3netCDF4.pyx":63
 *             cfa_root_group = parent._cfa_dataset.getGroup("root")
 *             self._cfa_dim = cfa_root_group.createDimension(
 *                                 name, size, axis_type=axis_type             # <<<<<<<<<<<<<<
 *                             )
 *             nc_object = parent._nc_dataset
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_GIVEREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_size);
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis_type, __pyx_v_axis_type) < 0) __PYX_ERR(0, 63, __pyx_L1_error)

    /* "S3netCDF4/_s3netCDF4.pyx":62
 *         elif hasattr(parent, "_cfa_dataset") and parent._cfa_dataset:
 *             cfa_root_group = parent._cfa_dataset.getGroup("root")
 *             self._cfa_dim = cfa_root_group.createDimension(             # <<<<<<<<<<<<<<
 *                                 name, size, axis_type=axis_type
 *                             )
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2, __pyx_t_5) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":65
 *                                 name, size, axis_type=axis_type
 *                             )
 *             nc_object = parent._nc_dataset             # <<<<<<<<<<<<<<
 *         else:
 *             self._cfa_dim = None
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_nc_object = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":60
 *             nc_object = parent._nc_grp
 *         # or has it been called from a dataset?
 *         elif hasattr(parent, "_cfa_dataset") and parent._cfa_dataset:             # <<<<<<<<<<<<<<
 *             cfa_root_group = parent._cfa_dataset.getGroup("root")
 *             self._cfa_dim = cfa_root_group.createDimension(
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":67
 *             nc_object = parent._nc_dataset
 *         else:
 *             self._cfa_dim = None             # <<<<<<<<<<<<<<
 *             # get the group or dataset (for none-CFA)
 *             if hasattr(parent, "_nc_grp"):
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2, Py_None) < 0) __PYX_ERR(0, 67, __pyx_L1_error)

    /* "S3netCDF4/_s3netCDF4.pyx":69
 *             self._cfa_dim = None
 *             # get the group or dataset (for none-CFA)
 *             if hasattr(parent, "_nc_grp"):             # <<<<<<<<<<<<<<
 *                 nc_object = parent._nc_grp
 *             elif hasattr(parent, "_nc_dataset"):
 */
    __pyx_t_1 = __Pyx_HasAttr(__pyx_v_parent, __pyx_n_u_nc_grp); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 69, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "S3netCDF4/_s3netCDF4.pyx":70
 *             # get the group or dataset (for none-CFA)
 *             if hasattr(parent, "_nc_grp"):
 *                 nc_object = parent._nc_grp             # <<<<<<<<<<<<<<
 *             elif hasattr(parent, "_nc_dataset"):
 *                 nc_object = parent._nc_dataset
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_v_nc_object = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":69
 *             self._cfa_dim = None
 *             # get the group or dataset (for none-CFA)
 *             if hasattr(parent, "_nc_grp"):             # <<<<<<<<<<<<<<
 *                 nc_object = parent._nc_grp
 *             elif hasattr(parent, "_nc_dataset"):
 */
      goto __pyx_L8;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":71
 *             if hasattr(parent, "_nc_grp"):
 *                 nc_object = parent._nc_grp
 *             elif hasattr(parent, "_nc_dataset"):             # <<<<<<<<<<<<<<
 *                 nc_object = parent._nc_dataset
 *             else:
 */
    __pyx_t_2 = __Pyx_HasAttr(__pyx_v_parent, __pyx_n_u_nc_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 71, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (likely(__pyx_t_1)) {

      /* "S3netCDF4/_s3netCDF4.pyx":72
 *                 nc_object = parent._nc_grp
 *             elif hasattr(parent, "_nc_dataset"):
 *                 nc_object = parent._nc_dataset             # <<<<<<<<<<<<<<
 *             else:
 *                 raise APIException("Cannot find group or dataset in parent")
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_v_nc_object = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":71
 *             if hasattr(parent, "_nc_grp"):
 *                 nc_object = parent._nc_grp
 *             elif hasattr(parent, "_nc_dataset"):             # <<<<<<<<<<<<<<
 *                 nc_object = parent._nc_dataset
 *             else:
 */
      goto __pyx_L8;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":74
 *                 nc_object = parent._nc_dataset
 *             else:
 *                 raise APIException("Cannot find group or dataset in parent")             # <<<<<<<<<<<<<<
 *         # Axis type metadata and metadata dictionary will be added to the
 *         # variable when the dimensions variable for this dimension is created
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_APIException); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 74, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_kp_u_Cannot_find_group_or_dataset_in) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_u_Cannot_find_group_or_dataset_in);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 74, __pyx_L1_error)
    }
    __pyx_L8:;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":77
 *         # Axis type metadata and metadata dictionary will be added to the
 *         # variable when the dimensions variable for this dimension is created
 *         self._nc_dim = nc_object.createDimension(name, size)             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, name):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_object, __pyx_n_s_createDimension); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_size};
    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_size};
    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __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_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_size);
    __Pyx_GIVEREF(__pyx_v_size);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_size);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2, __pyx_t_5) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":49
 *         self.parent = parent
 * 
 *     def create(self, parent, name, size=None,             # <<<<<<<<<<<<<<
 *                axis_type="U", metadata={}, **kwargs):
 *         """Initialise the dimension.  This adds the CFADimension structure to
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dimension.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nc_object);
  __Pyx_XDECREF(__pyx_v_cfa_root_group);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":79
 *         self._nc_dim = nc_object.createDimension(name, size)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the dimension and return the
 *             corresponding attribute from the _nc_dim object."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_5__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_11s3Dimension_4__getattr__[] = "Override the __getattr__ for the dimension and return the\n            corresponding attribute from the _nc_dim object.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_5__getattr__ = {"__getattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_5__getattr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_11s3Dimension_4__getattr__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_5__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, 1); __PYX_ERR(0, 79, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattr__") < 0)) __PYX_ERR(0, 79, __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_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 79, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dimension.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_4__getattr__(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_4__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":82
 *         """Override the __getattr__ for the dimension and return the
 *             corresponding attribute from the _nc_dim object."""
 *         if name in s3Dimension._private_atts:             # <<<<<<<<<<<<<<
 *             return self.__dict__[name]
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_s3Dimension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":83
 *             corresponding attribute from the _nc_dim object."""
 *         if name in s3Dimension._private_atts:
 *             return self.__dict__[name]             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_dim.__getattr__(name)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __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;

    /* "S3netCDF4/_s3netCDF4.pyx":82
 *         """Override the __getattr__ for the dimension and return the
 *             corresponding attribute from the _nc_dim object."""
 *         if name in s3Dimension._private_atts:             # <<<<<<<<<<<<<<
 *             return self.__dict__[name]
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":85
 *             return self.__dict__[name]
 *         else:
 *             return self._nc_dim.__getattr__(name)             # <<<<<<<<<<<<<<
 * 
 *     def __setattr__(self, name, value):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":79
 *         self._nc_dim = nc_object.createDimension(name, size)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the dimension and return the
 *             corresponding attribute from the _nc_dim object."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dimension.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":87
 *             return self._nc_dim.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the dimension and set the
 *             corresponding attribute in the _nc_dim object."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_7__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_11s3Dimension_6__setattr__[] = "Override the __setattr__ for the dimension and set the\n            corresponding attribute in the _nc_dim object.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_7__setattr__ = {"__setattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_7__setattr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_11s3Dimension_6__setattr__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_7__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 1); __PYX_ERR(0, 87, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 2); __PYX_ERR(0, 87, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setattr__") < 0)) __PYX_ERR(0, 87, __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_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 87, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dimension.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_6__setattr__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_6__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setattr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":90
 *         """Override the __setattr__ for the dimension and set the
 *             corresponding attribute in the _nc_dim object."""
 *         if name in s3Dimension._private_atts:             # <<<<<<<<<<<<<<
 *             self.__dict__[name] = value
 *         elif name == "_dimid":
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_s3Dimension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":91
 *             corresponding attribute in the _nc_dim object."""
 *         if name in s3Dimension._private_atts:
 *             self.__dict__[name] = value             # <<<<<<<<<<<<<<
 *         elif name == "_dimid":
 *             self._nc_dim._dimid = value
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 91, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":90
 *         """Override the __setattr__ for the dimension and set the
 *             corresponding attribute in the _nc_dim object."""
 *         if name in s3Dimension._private_atts:             # <<<<<<<<<<<<<<
 *             self.__dict__[name] = value
 *         elif name == "_dimid":
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":92
 *         if name in s3Dimension._private_atts:
 *             self.__dict__[name] = value
 *         elif name == "_dimid":             # <<<<<<<<<<<<<<
 *             self._nc_dim._dimid = value
 *         elif name == "_grpid":
 */
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_dimid, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 92, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":93
 *             self.__dict__[name] = value
 *         elif name == "_dimid":
 *             self._nc_dim._dimid = value             # <<<<<<<<<<<<<<
 *         elif name == "_grpid":
 *             self._nc_dim._grpid = value
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_dimid, __pyx_v_value) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":92
 *         if name in s3Dimension._private_atts:
 *             self.__dict__[name] = value
 *         elif name == "_dimid":             # <<<<<<<<<<<<<<
 *             self._nc_dim._dimid = value
 *         elif name == "_grpid":
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":94
 *         elif name == "_dimid":
 *             self._nc_dim._dimid = value
 *         elif name == "_grpid":             # <<<<<<<<<<<<<<
 *             self._nc_dim._grpid = value
 *         elif name == "_data_model":
 */
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_grpid, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 94, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":95
 *             self._nc_dim._dimid = value
 *         elif name == "_grpid":
 *             self._nc_dim._grpid = value             # <<<<<<<<<<<<<<
 *         elif name == "_data_model":
 *             self._nc_dim._data_model = value
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_grpid, __pyx_v_value) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":94
 *         elif name == "_dimid":
 *             self._nc_dim._dimid = value
 *         elif name == "_grpid":             # <<<<<<<<<<<<<<
 *             self._nc_dim._grpid = value
 *         elif name == "_data_model":
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":96
 *         elif name == "_grpid":
 *             self._nc_dim._grpid = value
 *         elif name == "_data_model":             # <<<<<<<<<<<<<<
 *             self._nc_dim._data_model = value
 *         elif name == "_name":
 */
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_data_model, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 96, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":97
 *             self._nc_dim._grpid = value
 *         elif name == "_data_model":
 *             self._nc_dim._data_model = value             # <<<<<<<<<<<<<<
 *         elif name == "_name":
 *             self._nc_dim._name = value
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_data_model, __pyx_v_value) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":96
 *         elif name == "_grpid":
 *             self._nc_dim._grpid = value
 *         elif name == "_data_model":             # <<<<<<<<<<<<<<
 *             self._nc_dim._data_model = value
 *         elif name == "_name":
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":98
 *         elif name == "_data_model":
 *             self._nc_dim._data_model = value
 *         elif name == "_name":             # <<<<<<<<<<<<<<
 *             self._nc_dim._name = value
 *         elif name == "_grp":
 */
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_name_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 98, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":99
 *             self._nc_dim._data_model = value
 *         elif name == "_name":
 *             self._nc_dim._name = value             # <<<<<<<<<<<<<<
 *         elif name == "_grp":
 *             self._nc_dim._grp = value
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_name_2, __pyx_v_value) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":98
 *         elif name == "_data_model":
 *             self._nc_dim._data_model = value
 *         elif name == "_name":             # <<<<<<<<<<<<<<
 *             self._nc_dim._name = value
 *         elif name == "_grp":
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":100
 *         elif name == "_name":
 *             self._nc_dim._name = value
 *         elif name == "_grp":             # <<<<<<<<<<<<<<
 *             self._nc_dim._grp = value
 * 
 */
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_grp, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 100, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":101
 *             self._nc_dim._name = value
 *         elif name == "_grp":
 *             self._nc_dim._grp = value             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_grp, __pyx_v_value) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":100
 *         elif name == "_name":
 *             self._nc_dim._name = value
 *         elif name == "_grp":             # <<<<<<<<<<<<<<
 *             self._nc_dim._grp = value
 * 
 */
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":87
 *             return self._nc_dim.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the dimension and set the
 *             corresponding attribute in the _nc_dim object."""
 */

  /* 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("S3netCDF4._s3netCDF4.s3Dimension.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":103
 *             self._nc_dim._grp = value
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._nc_dim.__len__()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_9__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_9__len__ = {"__len__", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_9__len__, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_9__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_8__len__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_8__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("__len__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":104
 * 
 *     def __len__(self):
 *         return self._nc_dim.__len__()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":103
 *             self._nc_dim._grp = value
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._nc_dim.__len__()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dimension.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":107
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self._nc_dim.__len__()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_11size(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_11size = {"size", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_11size, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_11size(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("size (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_10size(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_10size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("size", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":108
 *     @property
 *     def size(self):
 *         return self._nc_dim.__len__()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":107
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self._nc_dim.__len__()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dimension.size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":110
 *         return self._nc_dim.__len__()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             if sys_version_info[0] > 2:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_13__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_13__repr__ = {"__repr__", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_13__repr__, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_13__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_12__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_12__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":111
 * 
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dim_2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 111, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":112
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             if sys_version_info[0] > 2:             # <<<<<<<<<<<<<<
 *                 return self.__unicode__()
 *             else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys_version_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "S3netCDF4/_s3netCDF4.pyx":113
 *         if hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()             # <<<<<<<<<<<<<<
 *             else:
 *                 return unicode(self).encode('utf-8')
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __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;

      /* "S3netCDF4/_s3netCDF4.pyx":112
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             if sys_version_info[0] > 2:             # <<<<<<<<<<<<<<
 *                 return self.__unicode__()
 *             else:
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":115
 *                 return self.__unicode__()
 *             else:
 *                 return unicode(self).encode('utf-8')             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_dim.__repr__()
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":111
 * 
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":117
 *                 return unicode(self).encode('utf-8')
 *         else:
 *             return self._nc_dim.__repr__()             # <<<<<<<<<<<<<<
 * 
 *     def __unicode__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_repr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":110
 *         return self._nc_dim.__len__()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             if sys_version_info[0] > 2:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dimension.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":119
 *             return self._nc_dim.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_dim = self._cfa_dim
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_15__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_15__unicode__ = {"__unicode__", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_15__unicode__, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_11s3Dimension_15__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_14__unicode__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_11s3Dimension_14__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ncdump = NULL;
  PyObject *__pyx_v_cfa_dim = NULL;
  PyObject *__pyx_v_cfa_meta = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__unicode__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":120
 * 
 *     def __unicode__(self):
 *         ncdump = ['{}\n'.format(type(self))]             # <<<<<<<<<<<<<<
 *         cfa_dim = self._cfa_dim
 *         # get whether this is an unlimited dimension
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)Py_TYPE(__pyx_v_self))) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)Py_TYPE(__pyx_v_self)));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_ncdump = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":121
 *     def __unicode__(self):
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_dim = self._cfa_dim             # <<<<<<<<<<<<<<
 *         # get whether this is an unlimited dimension
 *         if self._nc_dim.isunlimited():
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_cfa_dim = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":123
 *         cfa_dim = self._cfa_dim
 *         # get whether this is an unlimited dimension
 *         if self._nc_dim.isunlimited():             # <<<<<<<<<<<<<<
 *             ncdump.append("unlimited: True\n")
 *         ncdump.append("name: '{}'\n".format(cfa_dim.getName()))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dim_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_isunlimited); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":124
 *         # get whether this is an unlimited dimension
 *         if self._nc_dim.isunlimited():
 *             ncdump.append("unlimited: True\n")             # <<<<<<<<<<<<<<
 *         ncdump.append("name: '{}'\n".format(cfa_dim.getName()))
 *         # add the metadata
 */
    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_kp_u_unlimited_True); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 124, __pyx_L1_error)

    /* "S3netCDF4/_s3netCDF4.pyx":123
 *         cfa_dim = self._cfa_dim
 *         # get whether this is an unlimited dimension
 *         if self._nc_dim.isunlimited():             # <<<<<<<<<<<<<<
 *             ncdump.append("unlimited: True\n")
 *         ncdump.append("name: '{}'\n".format(cfa_dim.getName()))
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":125
 *         if self._nc_dim.isunlimited():
 *             ncdump.append("unlimited: True\n")
 *         ncdump.append("name: '{}'\n".format(cfa_dim.getName()))             # <<<<<<<<<<<<<<
 *         # add the metadata
 *         cfa_meta = cfa_dim.getMetadata()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_name_3, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_dim, __pyx_n_s_getName); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":127
 *         ncdump.append("name: '{}'\n".format(cfa_dim.getName()))
 *         # add the metadata
 *         cfa_meta = cfa_dim.getMetadata()             # <<<<<<<<<<<<<<
 *         for m in cfa_meta:
 *             ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_dim, __pyx_n_s_getMetadata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_cfa_meta = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":128
 *         # add the metadata
 *         cfa_meta = cfa_dim.getMetadata()
 *         for m in cfa_meta:             # <<<<<<<<<<<<<<
 *             ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_cfa_meta)) || PyTuple_CheckExact(__pyx_v_cfa_meta)) {
    __pyx_t_2 = __pyx_v_cfa_meta; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_cfa_meta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 128, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 128, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":129
 *         cfa_meta = cfa_dim.getMetadata()
 *         for m in cfa_meta:
 *             ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))             # <<<<<<<<<<<<<<
 * 
 *         ncdump.append("type: '{}'\n".format(cfa_dim.getType()))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__2, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_cfa_meta, __pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && 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);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_m, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_m, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_v_m);
      __Pyx_GIVEREF(__pyx_v_m);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_m);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_3); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 129, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":128
 *         # add the metadata
 *         cfa_meta = cfa_dim.getMetadata()
 *         for m in cfa_meta:             # <<<<<<<<<<<<<<
 *             ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":131
 *             ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))
 * 
 *         ncdump.append("type: '{}'\n".format(cfa_dim.getType()))             # <<<<<<<<<<<<<<
 *         ncdump.append("axis type: '{}'\n".format(cfa_dim.getAxisType()))
 *         ncdump.append("size = ({})\n".format(cfa_dim.getLen()))
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_type, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_dim, __pyx_n_s_getType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_11, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":132
 * 
 *         ncdump.append("type: '{}'\n".format(cfa_dim.getType()))
 *         ncdump.append("axis type: '{}'\n".format(cfa_dim.getAxisType()))             # <<<<<<<<<<<<<<
 *         ncdump.append("size = ({})\n".format(cfa_dim.getLen()))
 *         #ncdump.append(str(self._nc_dim))
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_axis_type_2, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_dim, __pyx_n_s_getAxisType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_11, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":133
 *         ncdump.append("type: '{}'\n".format(cfa_dim.getType()))
 *         ncdump.append("axis type: '{}'\n".format(cfa_dim.getAxisType()))
 *         ncdump.append("size = ({})\n".format(cfa_dim.getLen()))             # <<<<<<<<<<<<<<
 *         #ncdump.append(str(self._nc_dim))
 *         return "".join(ncdump)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_size_2, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_dim, __pyx_n_s_getLen); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_11, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":135
 *         ncdump.append("size = ({})\n".format(cfa_dim.getLen()))
 *         #ncdump.append(str(self._nc_dim))
 *         return "".join(ncdump)             # <<<<<<<<<<<<<<
 * 
 * class s3Variable(object):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__3, __pyx_v_ncdump); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":119
 *             return self._nc_dim.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_dim = self._cfa_dim
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dimension.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ncdump);
  __Pyx_XDECREF(__pyx_v_cfa_dim);
  __Pyx_XDECREF(__pyx_v_cfa_meta);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":148
 *     ]
 * 
 *     def __init__(self, cfa_var=None, cfa_dim=None, nc_var=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the class, any loading of the variables will be done
 *         in the create method."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable___init__[] = "Just initialise the class, any loading of the variables will be done\n        in the create method.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable___init__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_cfa_var = 0;
  PyObject *__pyx_v_cfa_dim = 0;
  PyObject *__pyx_v_nc_var = 0;
  PyObject *__pyx_v_parent = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_cfa_var,&__pyx_n_s_cfa_dim,&__pyx_n_s_nc_var,&__pyx_n_s_parent,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfa_var);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfa_dim);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc_var);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 148, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_cfa_var = values[1];
    __pyx_v_cfa_dim = values[2];
    __pyx_v_nc_var = values[3];
    __pyx_v_parent = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 148, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable___init__(__pyx_self, __pyx_v_self, __pyx_v_cfa_var, __pyx_v_cfa_dim, __pyx_v_nc_var, __pyx_v_parent);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cfa_var, PyObject *__pyx_v_cfa_dim, PyObject *__pyx_v_nc_var, PyObject *__pyx_v_parent) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":151
 *         """Just initialise the class, any loading of the variables will be done
 *         in the create method."""
 *         self._cfa_var = cfa_var             # <<<<<<<<<<<<<<
 *         self._cfa_dim = cfa_dim
 *         self._nc_var = nc_var
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2, __pyx_v_cfa_var) < 0) __PYX_ERR(0, 151, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":152
 *         in the create method."""
 *         self._cfa_var = cfa_var
 *         self._cfa_dim = cfa_dim             # <<<<<<<<<<<<<<
 *         self._nc_var = nc_var
 *         self.parent = parent
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2, __pyx_v_cfa_dim) < 0) __PYX_ERR(0, 152, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":153
 *         self._cfa_var = cfa_var
 *         self._cfa_dim = cfa_dim
 *         self._nc_var = nc_var             # <<<<<<<<<<<<<<
 *         self.parent = parent
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2, __pyx_v_nc_var) < 0) __PYX_ERR(0, 153, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":154
 *         self._cfa_dim = cfa_dim
 *         self._nc_var = nc_var
 *         self.parent = parent             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 154, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":148
 *     ]
 * 
 *     def __init__(self, cfa_var=None, cfa_dim=None, nc_var=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the class, any loading of the variables will be done
 *         in the create method."""
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":157
 * 
 *     @property
 *     def file_manager(self):             # <<<<<<<<<<<<<<
 *         """Return the parent's (or parent's parent's) file manager"""
 *         # assign the file manager
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_3file_manager(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_2file_manager[] = "Return the parent's (or parent's parent's) file manager";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_3file_manager = {"file_manager", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_3file_manager, METH_O, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_2file_manager};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_3file_manager(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file_manager (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_2file_manager(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_2file_manager(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("file_manager", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":160
 *         """Return the parent's (or parent's parent's) file manager"""
 *         # assign the file manager
 *         if hasattr(self.parent, "_cfa_grp"):             # <<<<<<<<<<<<<<
 *             return self.parent.parent._file_manager
 *         elif hasattr(self.parent, "_cfa_dataset"):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":161
 *         # assign the file manager
 *         if hasattr(self.parent, "_cfa_grp"):
 *             return self.parent.parent._file_manager             # <<<<<<<<<<<<<<
 *         elif hasattr(self.parent, "_cfa_dataset"):
 *             return self.parent._file_manager
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __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_file_manager); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":160
 *         """Return the parent's (or parent's parent's) file manager"""
 *         # assign the file manager
 *         if hasattr(self.parent, "_cfa_grp"):             # <<<<<<<<<<<<<<
 *             return self.parent.parent._file_manager
 *         elif hasattr(self.parent, "_cfa_dataset"):
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":162
 *         if hasattr(self.parent, "_cfa_grp"):
 *             return self.parent.parent._file_manager
 *         elif hasattr(self.parent, "_cfa_dataset"):             # <<<<<<<<<<<<<<
 *             return self.parent._file_manager
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 162, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "S3netCDF4/_s3netCDF4.pyx":163
 *             return self.parent.parent._file_manager
 *         elif hasattr(self.parent, "_cfa_dataset"):
 *             return self.parent._file_manager             # <<<<<<<<<<<<<<
 *         else:
 *             return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_file_manager); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":162
 *         if hasattr(self.parent, "_cfa_grp"):
 *             return self.parent.parent._file_manager
 *         elif hasattr(self.parent, "_cfa_dataset"):             # <<<<<<<<<<<<<<
 *             return self.parent._file_manager
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":165
 *             return self.parent._file_manager
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def create(self, parent, name, datatype, dimensions=(), zlib=False,
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":157
 * 
 *     @property
 *     def file_manager(self):             # <<<<<<<<<<<<<<
 *         """Return the parent's (or parent's parent's) file manager"""
 *         # assign the file manager
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.file_manager", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":167
 *             return None
 * 
 *     def create(self, parent, name, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *             complevel=4, shuffle=True, fletcher32=False, contiguous=False,
 *             chunksizes=None, endian='native', least_significant_digit=None,
 */

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

  /* "S3netCDF4/_s3netCDF4.pyx":170
 *             complevel=4, shuffle=True, fletcher32=False, contiguous=False,
 *             chunksizes=None, endian='native', least_significant_digit=None,
 *             fill_value=None, chunk_cache=None, subarray_shape=np.array([]),             # <<<<<<<<<<<<<<
 *             max_subarray_size=0, **kwargs):
 *         """Initialise the variable.  This adds the CFAVariable structure to
 */
  __pyx_t_1 = PyTuple_New(13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject*)__pyx_empty_tuple));
  __Pyx_GIVEREF(((PyObject*)__pyx_empty_tuple));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)__pyx_empty_tuple));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)__pyx_int_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_4));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_4));
  __Pyx_INCREF(((PyObject *)Py_True));
  __Pyx_GIVEREF(((PyObject *)Py_True));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_True));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject*)__pyx_n_u_native));
  __Pyx_GIVEREF(((PyObject*)__pyx_n_u_native));
  PyTuple_SET_ITEM(__pyx_t_1, 7, ((PyObject*)__pyx_n_u_native));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 8, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 9, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 10, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_subarray_shape);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_subarray_shape);
  PyTuple_SET_ITEM(__pyx_t_1, 11, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_subarray_shape);
  __Pyx_INCREF(((PyObject *)__pyx_int_0));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_0));
  PyTuple_SET_ITEM(__pyx_t_1, 12, ((PyObject *)__pyx_int_0));

  /* "S3netCDF4/_s3netCDF4.pyx":167
 *             return None
 * 
 *     def create(self, parent, name, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *             complevel=4, shuffle=True, fletcher32=False, contiguous=False,
 *             chunksizes=None, endian='native', least_significant_digit=None,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __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(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_5create(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_4create[] = "Initialise the variable.  This adds the CFAVariable structure to\n        the variable as well as initialising the superclass.\n        The CFA conventions dictate that the variables are created in two\n        different ways:\n        1. Dimension variables are created as regular netCDF variables, with\n           the same dimension attached to them\n        2. Field variables are created as scalar variables, i.e. they have no\n           dimensions associated with them. Instead, the dimensions go in the\n           netCDF attribute:\n              :cfa_dimensions = \"dim1 dim2 dim3\"\n        ";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_5create = {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_5create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_4create};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_5create(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_datatype = 0;
  PyObject *__pyx_v_dimensions = 0;
  PyObject *__pyx_v_zlib = 0;
  PyObject *__pyx_v_complevel = 0;
  PyObject *__pyx_v_shuffle = 0;
  PyObject *__pyx_v_fletcher32 = 0;
  PyObject *__pyx_v_contiguous = 0;
  PyObject *__pyx_v_chunksizes = 0;
  PyObject *__pyx_v_endian = 0;
  PyObject *__pyx_v_least_significant_digit = 0;
  PyObject *__pyx_v_fill_value = 0;
  PyObject *__pyx_v_chunk_cache = 0;
  PyObject *__pyx_v_subarray_shape = 0;
  PyObject *__pyx_v_max_subarray_size = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_parent,&__pyx_n_s_name,&__pyx_n_s_datatype,&__pyx_n_s_dimensions,&__pyx_n_s_zlib,&__pyx_n_s_complevel,&__pyx_n_s_shuffle,&__pyx_n_s_fletcher32,&__pyx_n_s_contiguous,&__pyx_n_s_chunksizes,&__pyx_n_s_endian,&__pyx_n_s_least_significant_digit,&__pyx_n_s_fill_value,&__pyx_n_s_chunk_cache,&__pyx_n_s_subarray_shape,&__pyx_n_s_max_subarray_size,0};
    PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
    values[4] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    values[5] = ((PyObject *)((PyObject *)Py_False));
    values[6] = ((PyObject *)((PyObject *)__pyx_int_4));
    values[7] = ((PyObject *)((PyObject *)Py_True));
    values[8] = ((PyObject *)((PyObject *)Py_False));
    values[9] = ((PyObject *)((PyObject *)Py_False));
    values[10] = ((PyObject *)((PyObject *)Py_None));
    values[11] = ((PyObject *)((PyObject*)__pyx_n_u_native));
    values[12] = ((PyObject *)((PyObject *)Py_None));
    values[13] = ((PyObject *)((PyObject *)Py_None));
    values[14] = ((PyObject *)((PyObject *)Py_None));
    values[15] = __pyx_dynamic_args->__pyx_arg_subarray_shape;
    values[16] = ((PyObject *)((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 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create", 0, 4, 17, 1); __PYX_ERR(0, 167, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create", 0, 4, 17, 2); __PYX_ERR(0, 167, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_datatype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create", 0, 4, 17, 3); __PYX_ERR(0, 167, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dimensions);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zlib);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_complevel);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shuffle);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fletcher32);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_contiguous);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chunksizes);
          if (value) { values[10] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_endian);
          if (value) { values[11] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_least_significant_digit);
          if (value) { values[12] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[13] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chunk_cache);
          if (value) { values[14] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subarray_shape);
          if (value) { values[15] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 16:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_subarray_size);
          if (value) { values[16] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "create") < 0)) __PYX_ERR(0, 167, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        CYTHON_FALLTHROUGH;
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_parent = values[1];
    __pyx_v_name = values[2];
    __pyx_v_datatype = values[3];
    __pyx_v_dimensions = values[4];
    __pyx_v_zlib = values[5];
    __pyx_v_complevel = values[6];
    __pyx_v_shuffle = values[7];
    __pyx_v_fletcher32 = values[8];
    __pyx_v_contiguous = values[9];
    __pyx_v_chunksizes = values[10];
    __pyx_v_endian = values[11];
    __pyx_v_least_significant_digit = values[12];
    __pyx_v_fill_value = values[13];
    __pyx_v_chunk_cache = values[14];
    __pyx_v_subarray_shape = values[15];
    __pyx_v_max_subarray_size = values[16];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 4, 17, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 167, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_4create(__pyx_self, __pyx_v_self, __pyx_v_parent, __pyx_v_name, __pyx_v_datatype, __pyx_v_dimensions, __pyx_v_zlib, __pyx_v_complevel, __pyx_v_shuffle, __pyx_v_fletcher32, __pyx_v_contiguous, __pyx_v_chunksizes, __pyx_v_endian, __pyx_v_least_significant_digit, __pyx_v_fill_value, __pyx_v_chunk_cache, __pyx_v_subarray_shape, __pyx_v_max_subarray_size, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_4create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_name, PyObject *__pyx_v_datatype, PyObject *__pyx_v_dimensions, PyObject *__pyx_v_zlib, PyObject *__pyx_v_complevel, PyObject *__pyx_v_shuffle, PyObject *__pyx_v_fletcher32, PyObject *__pyx_v_contiguous, PyObject *__pyx_v_chunksizes, PyObject *__pyx_v_endian, PyObject *__pyx_v_least_significant_digit, PyObject *__pyx_v_fill_value, PyObject *__pyx_v_chunk_cache, PyObject *__pyx_v_subarray_shape, PyObject *__pyx_v_max_subarray_size, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_nc_dimensions = NULL;
  PyObject *__pyx_v_s3_dataset = NULL;
  PyObject *__pyx_v_nc_parent = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_ncd = NULL;
  PyObject *__pyx_v_cfa_root_group = NULL;
  PyObject *__pyx_v_pm_dimensions = NULL;
  PyObject *__pyx_v_pm_shape = NULL;
  PyObject *__pyx_v_cfa_version = 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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":184
 *         """
 *         # first check if this is a group, and create within the group if it is
 *         if type(dimensions) is not tuple:             # <<<<<<<<<<<<<<
 *             raise APIException("Dimensions has to be of type tuple")
 * 
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_dimensions)) != ((PyObject *)(&PyTuple_Type)));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "S3netCDF4/_s3netCDF4.pyx":185
 *         # first check if this is a group, and create within the group if it is
 *         if type(dimensions) is not tuple:
 *             raise APIException("Dimensions has to be of type tuple")             # <<<<<<<<<<<<<<
 * 
 *         # keep track of the parent that created the variable
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_APIException); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Dimensions_has_to_be_of_type_tup) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Dimensions_has_to_be_of_type_tup);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 185, __pyx_L1_error)

    /* "S3netCDF4/_s3netCDF4.pyx":184
 *         """
 *         # first check if this is a group, and create within the group if it is
 *         if type(dimensions) is not tuple:             # <<<<<<<<<<<<<<
 *             raise APIException("Dimensions has to be of type tuple")
 * 
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":188
 * 
 *         # keep track of the parent that created the variable
 *         self.parent = parent             # <<<<<<<<<<<<<<
 * 
 *         if hasattr(parent, "_cfa_grp") and parent._cfa_grp:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 188, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":190
 *         self.parent = parent
 * 
 *         if hasattr(parent, "_cfa_grp") and parent._cfa_grp:             # <<<<<<<<<<<<<<
 *             # check if this is a dimension variable and, if it is, assign the
 *             # netCDF dimension.  If it is a field variable then don't assign.
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_parent, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 190, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_2 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "S3netCDF4/_s3netCDF4.pyx":193
 *             # check if this is a dimension variable and, if it is, assign the
 *             # netCDF dimension.  If it is a field variable then don't assign.
 *             if name in parent._cfa_grp.getDimensions():             # <<<<<<<<<<<<<<
 *                 nc_dimensions = (name,)
 *                 # get a reference to the already created cfa_dim
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getDimensions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 193, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = (__pyx_t_2 != 0);
    if (__pyx_t_6) {

      /* "S3netCDF4/_s3netCDF4.pyx":194
 *             # netCDF dimension.  If it is a field variable then don't assign.
 *             if name in parent._cfa_grp.getDimensions():
 *                 nc_dimensions = (name,)             # <<<<<<<<<<<<<<
 *                 # get a reference to the already created cfa_dim
 *                 self._cfa_dim = parent._cfa_grp.getDimension(name)
 */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_name);
      __pyx_v_nc_dimensions = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":196
 *                 nc_dimensions = (name,)
 *                 # get a reference to the already created cfa_dim
 *                 self._cfa_dim = parent._cfa_grp.getDimension(name)             # <<<<<<<<<<<<<<
 *                 self._cfa_dim.setType(np.dtype(datatype))
 *             else:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getDimension); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2, __pyx_t_3) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":197
 *                 # get a reference to the already created cfa_dim
 *                 self._cfa_dim = parent._cfa_grp.getDimension(name)
 *                 self._cfa_dim.setType(np.dtype(datatype))             # <<<<<<<<<<<<<<
 *             else:
 *                 nc_dimensions = list([])
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_setType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_datatype) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_datatype);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __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;

      /* "S3netCDF4/_s3netCDF4.pyx":193
 *             # check if this is a dimension variable and, if it is, assign the
 *             # netCDF dimension.  If it is a field variable then don't assign.
 *             if name in parent._cfa_grp.getDimensions():             # <<<<<<<<<<<<<<
 *                 nc_dimensions = (name,)
 *                 # get a reference to the already created cfa_dim
 */
      goto __pyx_L7;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":199
 *                 self._cfa_dim.setType(np.dtype(datatype))
 *             else:
 *                 nc_dimensions = list([])             # <<<<<<<<<<<<<<
 *                 # only create the cfa variable for field variables
 *                 self._cfa_var = parent._cfa_grp.createVariable(
 */
    /*else*/ {
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_nc_dimensions = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":201
 *                 nc_dimensions = list([])
 *                 # only create the cfa variable for field variables
 *                 self._cfa_var = parent._cfa_grp.createVariable(             # <<<<<<<<<<<<<<
 *                     var_name=name,
 *                     nc_dtype=np.dtype(datatype),
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_createVariable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":202
 *                 # only create the cfa variable for field variables
 *                 self._cfa_var = parent._cfa_grp.createVariable(
 *                     var_name=name,             # <<<<<<<<<<<<<<
 *                     nc_dtype=np.dtype(datatype),
 *                     dim_names=list(dimensions),
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_var_name, __pyx_v_name) < 0) __PYX_ERR(0, 202, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":203
 *                 self._cfa_var = parent._cfa_grp.createVariable(
 *                     var_name=name,
 *                     nc_dtype=np.dtype(datatype),             # <<<<<<<<<<<<<<
 *                     dim_names=list(dimensions),
 *                     subarray_shape=subarray_shape,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_datatype) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_datatype);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_nc_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":204
 *                     var_name=name,
 *                     nc_dtype=np.dtype(datatype),
 *                     dim_names=list(dimensions),             # <<<<<<<<<<<<<<
 *                     subarray_shape=subarray_shape,
 *                     max_subarray_size=max_subarray_size
 */
      __pyx_t_4 = PySequence_List(__pyx_v_dimensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dim_names, __pyx_t_4) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":205
 *                     nc_dtype=np.dtype(datatype),
 *                     dim_names=list(dimensions),
 *                     subarray_shape=subarray_shape,             # <<<<<<<<<<<<<<
 *                     max_subarray_size=max_subarray_size
 *                 )
 */
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_subarray_shape, __pyx_v_subarray_shape) < 0) __PYX_ERR(0, 202, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":206
 *                     dim_names=list(dimensions),
 *                     subarray_shape=subarray_shape,
 *                     max_subarray_size=max_subarray_size             # <<<<<<<<<<<<<<
 *                 )
 *             # get the s3_dataset
 */
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_max_subarray_size, __pyx_v_max_subarray_size) < 0) __PYX_ERR(0, 202, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":201
 *                 nc_dimensions = list([])
 *                 # only create the cfa variable for field variables
 *                 self._cfa_var = parent._cfa_grp.createVariable(             # <<<<<<<<<<<<<<
 *                     var_name=name,
 *                     nc_dtype=np.dtype(datatype),
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __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;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2, __pyx_t_4) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L7:;

    /* "S3netCDF4/_s3netCDF4.pyx":209
 *                 )
 *             # get the s3_dataset
 *             s3_dataset = parent.parent             # <<<<<<<<<<<<<<
 *             # get the netCDF parent (group)
 *             nc_parent = parent._nc_grp
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_s3_dataset = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":211
 *             s3_dataset = parent.parent
 *             # get the netCDF parent (group)
 *             nc_parent = parent._nc_grp             # <<<<<<<<<<<<<<
 *             # get the netCDF dataset
 *             ncd = s3_dataset._nc_dataset
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_nc_parent = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":213
 *             nc_parent = parent._nc_grp
 *             # get the netCDF dataset
 *             ncd = s3_dataset._nc_dataset             # <<<<<<<<<<<<<<
 * 
 *         # second check if this is a dataset, and create or get a "root" CFAgroup
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s3_dataset, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_ncd = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":190
 *         self.parent = parent
 * 
 *         if hasattr(parent, "_cfa_grp") and parent._cfa_grp:             # <<<<<<<<<<<<<<
 *             # check if this is a dimension variable and, if it is, assign the
 *             # netCDF dimension.  If it is a field variable then don't assign.
 */
    goto __pyx_L4;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":217
 *         # second check if this is a dataset, and create or get a "root" CFAgroup
 *         # if it is and add the CFAVariable to that group
 *         elif hasattr(parent, "_cfa_dataset") and parent._cfa_dataset:             # <<<<<<<<<<<<<<
 *             # same logic as above for whether to create a variable or if it is
 *             # a dimension variable
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_parent, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 217, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {
  } else {
    __pyx_t_6 = __pyx_t_1;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __pyx_t_1;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_6) {

    /* "S3netCDF4/_s3netCDF4.pyx":220
 *             # same logic as above for whether to create a variable or if it is
 *             # a dimension variable
 *             cfa_root_group = parent._cfa_dataset.getGroup("root")             # <<<<<<<<<<<<<<
 * 
 *             # get the dimensions - the name of the variable if it is a dimension
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getGroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_n_u_root) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_u_root);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_cfa_root_group = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":224
 *             # get the dimensions - the name of the variable if it is a dimension
 *             # variable, or empty if a field variable
 *             if name in cfa_root_group.getDimensions():             # <<<<<<<<<<<<<<
 *                 nc_dimensions = (name,)
 *                 # get a reference to the already created cfa_dim
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_root_group, __pyx_n_s_getDimensions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 224, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = (__pyx_t_6 != 0);
    if (__pyx_t_1) {

      /* "S3netCDF4/_s3netCDF4.pyx":225
 *             # variable, or empty if a field variable
 *             if name in cfa_root_group.getDimensions():
 *                 nc_dimensions = (name,)             # <<<<<<<<<<<<<<
 *                 # get a reference to the already created cfa_dim
 *                 self._cfa_dim = cfa_root_group.getDimension(name)
 */
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name);
      __pyx_v_nc_dimensions = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":227
 *                 nc_dimensions = (name,)
 *                 # get a reference to the already created cfa_dim
 *                 self._cfa_dim = cfa_root_group.getDimension(name)             # <<<<<<<<<<<<<<
 *                 self._cfa_dim.setType(np.dtype(datatype))
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_root_group, __pyx_n_s_getDimension); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && 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_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2, __pyx_t_4) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":228
 *                 # get a reference to the already created cfa_dim
 *                 self._cfa_dim = cfa_root_group.getDimension(name)
 *                 self._cfa_dim.setType(np.dtype(datatype))             # <<<<<<<<<<<<<<
 *             else:
 *                 nc_dimensions = list([])
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_datatype) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_datatype);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __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;

      /* "S3netCDF4/_s3netCDF4.pyx":224
 *             # get the dimensions - the name of the variable if it is a dimension
 *             # variable, or empty if a field variable
 *             if name in cfa_root_group.getDimensions():             # <<<<<<<<<<<<<<
 *                 nc_dimensions = (name,)
 *                 # get a reference to the already created cfa_dim
 */
      goto __pyx_L10;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":230
 *                 self._cfa_dim.setType(np.dtype(datatype))
 *             else:
 *                 nc_dimensions = list([])             # <<<<<<<<<<<<<<
 *                 # create the CFA var for field variables only
 *                 self._cfa_var = cfa_root_group.createVariable(
 */
    /*else*/ {
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_nc_dimensions = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":232
 *                 nc_dimensions = list([])
 *                 # create the CFA var for field variables only
 *                 self._cfa_var = cfa_root_group.createVariable(             # <<<<<<<<<<<<<<
 *                     var_name=name,
 *                     nc_dtype=np.dtype(datatype),
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_root_group, __pyx_n_s_createVariable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "S3netCDF4/_s3netCDF4.pyx":233
 *                 # create the CFA var for field variables only
 *                 self._cfa_var = cfa_root_group.createVariable(
 *                     var_name=name,             # <<<<<<<<<<<<<<
 *                     nc_dtype=np.dtype(datatype),
 *                     dim_names=list(dimensions),
 */
      __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_var_name, __pyx_v_name) < 0) __PYX_ERR(0, 233, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":234
 *                 self._cfa_var = cfa_root_group.createVariable(
 *                     var_name=name,
 *                     nc_dtype=np.dtype(datatype),             # <<<<<<<<<<<<<<
 *                     dim_names=list(dimensions),
 *                     subarray_shape=subarray_shape,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_datatype) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_datatype);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_nc_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":235
 *                     var_name=name,
 *                     nc_dtype=np.dtype(datatype),
 *                     dim_names=list(dimensions),             # <<<<<<<<<<<<<<
 *                     subarray_shape=subarray_shape,
 *                     max_subarray_size=max_subarray_size
 */
      __pyx_t_3 = PySequence_List(__pyx_v_dimensions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dim_names, __pyx_t_3) < 0) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":236
 *                     nc_dtype=np.dtype(datatype),
 *                     dim_names=list(dimensions),
 *                     subarray_shape=subarray_shape,             # <<<<<<<<<<<<<<
 *                     max_subarray_size=max_subarray_size
 *                 )
 */
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_subarray_shape, __pyx_v_subarray_shape) < 0) __PYX_ERR(0, 233, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":237
 *                     dim_names=list(dimensions),
 *                     subarray_shape=subarray_shape,
 *                     max_subarray_size=max_subarray_size             # <<<<<<<<<<<<<<
 *                 )
 *                 # later we will need to write the partition information into
 */
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_max_subarray_size, __pyx_v_max_subarray_size) < 0) __PYX_ERR(0, 233, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":232
 *                 nc_dimensions = list([])
 *                 # create the CFA var for field variables only
 *                 self._cfa_var = cfa_root_group.createVariable(             # <<<<<<<<<<<<<<
 *                     var_name=name,
 *                     nc_dtype=np.dtype(datatype),
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __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 (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2, __pyx_t_3) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L10:;

    /* "S3netCDF4/_s3netCDF4.pyx":242
 *                 # the partition object
 *             # get the s3_dataset
 *             s3_dataset = parent             # <<<<<<<<<<<<<<
 *             # get the netCDF parent (dataset)
 *             nc_parent = s3_dataset._nc_dataset
 */
    __Pyx_INCREF(__pyx_v_parent);
    __pyx_v_s3_dataset = __pyx_v_parent;

    /* "S3netCDF4/_s3netCDF4.pyx":244
 *             s3_dataset = parent
 *             # get the netCDF parent (dataset)
 *             nc_parent = s3_dataset._nc_dataset             # <<<<<<<<<<<<<<
 *             # get the netCDF dataset
 *             ncd = s3_dataset._nc_dataset
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s3_dataset, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_nc_parent = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":246
 *             nc_parent = s3_dataset._nc_dataset
 *             # get the netCDF dataset
 *             ncd = s3_dataset._nc_dataset             # <<<<<<<<<<<<<<
 *         else:
 *             self._cfa_var = None
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s3_dataset, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_ncd = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":217
 *         # second check if this is a dataset, and create or get a "root" CFAgroup
 *         # if it is and add the CFAVariable to that group
 *         elif hasattr(parent, "_cfa_dataset") and parent._cfa_dataset:             # <<<<<<<<<<<<<<
 *             # same logic as above for whether to create a variable or if it is
 *             # a dimension variable
 */
    goto __pyx_L4;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":248
 *             ncd = s3_dataset._nc_dataset
 *         else:
 *             self._cfa_var = None             # <<<<<<<<<<<<<<
 *             nc_dimensions = dimensions
 *             # get the group or dataset (for none-CFA)
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2, Py_None) < 0) __PYX_ERR(0, 248, __pyx_L1_error)

    /* "S3netCDF4/_s3netCDF4.pyx":249
 *         else:
 *             self._cfa_var = None
 *             nc_dimensions = dimensions             # <<<<<<<<<<<<<<
 *             # get the group or dataset (for none-CFA)
 *             if hasattr(parent, "_nc_grp"):
 */
    __Pyx_INCREF(__pyx_v_dimensions);
    __pyx_v_nc_dimensions = __pyx_v_dimensions;

    /* "S3netCDF4/_s3netCDF4.pyx":251
 *             nc_dimensions = dimensions
 *             # get the group or dataset (for none-CFA)
 *             if hasattr(parent, "_nc_grp"):             # <<<<<<<<<<<<<<
 *                 nc_parent = parent._nc_grp
 *             elif hasattr(parent, "_nc_dataset"):
 */
    __pyx_t_1 = __Pyx_HasAttr(__pyx_v_parent, __pyx_n_u_nc_grp); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 251, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_1 != 0);
    if (__pyx_t_6) {

      /* "S3netCDF4/_s3netCDF4.pyx":252
 *             # get the group or dataset (for none-CFA)
 *             if hasattr(parent, "_nc_grp"):
 *                 nc_parent = parent._nc_grp             # <<<<<<<<<<<<<<
 *             elif hasattr(parent, "_nc_dataset"):
 *                 nc_parent = parent._nc_dataset
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_nc_parent = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":251
 *             nc_dimensions = dimensions
 *             # get the group or dataset (for none-CFA)
 *             if hasattr(parent, "_nc_grp"):             # <<<<<<<<<<<<<<
 *                 nc_parent = parent._nc_grp
 *             elif hasattr(parent, "_nc_dataset"):
 */
      goto __pyx_L11;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":253
 *             if hasattr(parent, "_nc_grp"):
 *                 nc_parent = parent._nc_grp
 *             elif hasattr(parent, "_nc_dataset"):             # <<<<<<<<<<<<<<
 *                 nc_parent = parent._nc_dataset
 *             else:
 */
    __pyx_t_6 = __Pyx_HasAttr(__pyx_v_parent, __pyx_n_u_nc_dataset); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 253, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_6 != 0);
    if (likely(__pyx_t_1)) {

      /* "S3netCDF4/_s3netCDF4.pyx":254
 *                 nc_parent = parent._nc_grp
 *             elif hasattr(parent, "_nc_dataset"):
 *                 nc_parent = parent._nc_dataset             # <<<<<<<<<<<<<<
 *             else:
 *                 raise APIException("Cannot find group or dataset in parent")
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_nc_parent = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":253
 *             if hasattr(parent, "_nc_grp"):
 *                 nc_parent = parent._nc_grp
 *             elif hasattr(parent, "_nc_dataset"):             # <<<<<<<<<<<<<<
 *                 nc_parent = parent._nc_dataset
 *             else:
 */
      goto __pyx_L11;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":256
 *                 nc_parent = parent._nc_dataset
 *             else:
 *                 raise APIException("Cannot find group or dataset in parent")             # <<<<<<<<<<<<<<
 * 
 *         if (hasattr(self, "_cfa_var") and self._cfa_var and
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_APIException); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Cannot_find_group_or_dataset_in) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Cannot_find_group_or_dataset_in);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 256, __pyx_L1_error)
    }
    __pyx_L11:;
  }
  __pyx_L4:;

  /* "S3netCDF4/_s3netCDF4.pyx":258
 *                 raise APIException("Cannot find group or dataset in parent")
 * 
 *         if (hasattr(self, "_cfa_var") and self._cfa_var and             # <<<<<<<<<<<<<<
 *             len(self._cfa_var.getDimensions()) != 0):
 *             # get the partition matrix dimensions from the created variable
 */
  __pyx_t_6 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 258, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_6 != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L13_bool_binop_done;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":259
 * 
 *         if (hasattr(self, "_cfa_var") and self._cfa_var and
 *             len(self._cfa_var.getDimensions()) != 0):             # <<<<<<<<<<<<<<
 *             # get the partition matrix dimensions from the created variable
 *             pm_dimensions = self._cfa_var.getPartitionMatrixDimensions()
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getDimensions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = ((__pyx_t_9 != 0) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L13_bool_binop_done:;

  /* "S3netCDF4/_s3netCDF4.pyx":258
 *                 raise APIException("Cannot find group or dataset in parent")
 * 
 *         if (hasattr(self, "_cfa_var") and self._cfa_var and             # <<<<<<<<<<<<<<
 *             len(self._cfa_var.getDimensions()) != 0):
 *             # get the partition matrix dimensions from the created variable
 */
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":261
 *             len(self._cfa_var.getDimensions()) != 0):
 *             # get the partition matrix dimensions from the created variable
 *             pm_dimensions = self._cfa_var.getPartitionMatrixDimensions()             # <<<<<<<<<<<<<<
 *             pm_shape = self._cfa_var.getPartitionMatrixShape()
 *             assert(len(pm_dimensions) == len(pm_shape))
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getPartitionMatrixDimensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_pm_dimensions = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":262
 *             # get the partition matrix dimensions from the created variable
 *             pm_dimensions = self._cfa_var.getPartitionMatrixDimensions()
 *             pm_shape = self._cfa_var.getPartitionMatrixShape()             # <<<<<<<<<<<<<<
 *             assert(len(pm_dimensions) == len(pm_shape))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getPartitionMatrixShape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_pm_shape = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":263
 *             pm_dimensions = self._cfa_var.getPartitionMatrixDimensions()
 *             pm_shape = self._cfa_var.getPartitionMatrixShape()
 *             assert(len(pm_dimensions) == len(pm_shape))             # <<<<<<<<<<<<<<
 * 
 *             # get the version of the cfa dataset
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_9 = PyObject_Length(__pyx_v_pm_dimensions); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 263, __pyx_L1_error)
      __pyx_t_10 = PyObject_Length(__pyx_v_pm_shape); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 263, __pyx_L1_error)
      if (unlikely(!((__pyx_t_9 == __pyx_t_10) != 0))) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(0, 263, __pyx_L1_error)
      }
    }
    #endif

    /* "S3netCDF4/_s3netCDF4.pyx":266
 * 
 *             # get the version of the cfa dataset
 *             cfa_version = s3_dataset._cfa_dataset.getCFAVersion()             # <<<<<<<<<<<<<<
 * 
 *             if cfa_version == "0.5" or cfa_version == "0.4":
 */
    if (unlikely(!__pyx_v_s3_dataset)) { __Pyx_RaiseUnboundLocalError("s3_dataset"); __PYX_ERR(0, 266, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s3_dataset, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getCFAVersion); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_cfa_version = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":268
 *             cfa_version = s3_dataset._cfa_dataset.getCFAVersion()
 * 
 *             if cfa_version == "0.5" or cfa_version == "0.4":             # <<<<<<<<<<<<<<
 *                 self._cfa_var.writeInitialPartitionInfo(
 *                     cfa_version, nc_parent
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_cfa_version, __pyx_kp_u_0_5, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L17_bool_binop_done;
    }
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_cfa_version, __pyx_kp_u_0_4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_2;
    __pyx_L17_bool_binop_done:;
    if (likely(__pyx_t_1)) {

      /* "S3netCDF4/_s3netCDF4.pyx":269
 * 
 *             if cfa_version == "0.5" or cfa_version == "0.4":
 *                 self._cfa_var.writeInitialPartitionInfo(             # <<<<<<<<<<<<<<
 *                     cfa_version, nc_parent
 *                 )
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_writeInitialPartitionInfo); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":270
 *             if cfa_version == "0.5" or cfa_version == "0.4":
 *                 self._cfa_var.writeInitialPartitionInfo(
 *                     cfa_version, nc_parent             # <<<<<<<<<<<<<<
 *                 )
 *             else:
 */
      __pyx_t_4 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_UNPACK_METHODS && 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_11 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_cfa_version, __pyx_v_nc_parent};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_cfa_version, __pyx_v_nc_parent};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __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_cfa_version);
        __Pyx_GIVEREF(__pyx_v_cfa_version);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_11, __pyx_v_cfa_version);
        __Pyx_INCREF(__pyx_v_nc_parent);
        __Pyx_GIVEREF(__pyx_v_nc_parent);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_v_nc_parent);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":268
 *             cfa_version = s3_dataset._cfa_dataset.getCFAVersion()
 * 
 *             if cfa_version == "0.5" or cfa_version == "0.4":             # <<<<<<<<<<<<<<
 *                 self._cfa_var.writeInitialPartitionInfo(
 *                     cfa_version, nc_parent
 */
      goto __pyx_L16;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":273
 *                 )
 *             else:
 *                 raise CFAError(             # <<<<<<<<<<<<<<
 *                     "Unsupported CFA version {}.".format(cfa_version)
 *                 )
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CFAError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "S3netCDF4/_s3netCDF4.pyx":274
 *             else:
 *                 raise CFAError(
 *                     "Unsupported CFA version {}.".format(cfa_version)             # <<<<<<<<<<<<<<
 *                 )
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Unsupported_CFA_version, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(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_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_cfa_version) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_cfa_version);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 273, __pyx_L1_error)
    }
    __pyx_L16:;

    /* "S3netCDF4/_s3netCDF4.pyx":258
 *                 raise APIException("Cannot find group or dataset in parent")
 * 
 *         if (hasattr(self, "_cfa_var") and self._cfa_var and             # <<<<<<<<<<<<<<
 *             len(self._cfa_var.getDimensions()) != 0):
 *             # get the partition matrix dimensions from the created variable
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":278
 * 
 *         # Initialise the base class
 *         self._nc_var = nc_parent.createVariable(             # <<<<<<<<<<<<<<
 *             name,
 *             datatype,
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_parent, __pyx_n_s_createVariable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "S3netCDF4/_s3netCDF4.pyx":280
 *         self._nc_var = nc_parent.createVariable(
 *             name,
 *             datatype,             # <<<<<<<<<<<<<<
 *             dimensions=nc_dimensions,
 *             zlib=zlib,
 */
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_name);
  __Pyx_INCREF(__pyx_v_datatype);
  __Pyx_GIVEREF(__pyx_v_datatype);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_datatype);

  /* "S3netCDF4/_s3netCDF4.pyx":281
 *             name,
 *             datatype,
 *             dimensions=nc_dimensions,             # <<<<<<<<<<<<<<
 *             zlib=zlib,
 *             complevel=complevel,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dimensions, __pyx_v_nc_dimensions) < 0) __PYX_ERR(0, 281, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":282
 *             datatype,
 *             dimensions=nc_dimensions,
 *             zlib=zlib,             # <<<<<<<<<<<<<<
 *             complevel=complevel,
 *             shuffle=shuffle,
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_zlib, __pyx_v_zlib) < 0) __PYX_ERR(0, 281, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":283
 *             dimensions=nc_dimensions,
 *             zlib=zlib,
 *             complevel=complevel,             # <<<<<<<<<<<<<<
 *             shuffle=shuffle,
 *             fletcher32=fletcher32,
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_complevel, __pyx_v_complevel) < 0) __PYX_ERR(0, 281, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":284
 *             zlib=zlib,
 *             complevel=complevel,
 *             shuffle=shuffle,             # <<<<<<<<<<<<<<
 *             fletcher32=fletcher32,
 *             contiguous=contiguous,
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) __PYX_ERR(0, 281, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":285
 *             complevel=complevel,
 *             shuffle=shuffle,
 *             fletcher32=fletcher32,             # <<<<<<<<<<<<<<
 *             contiguous=contiguous,
 *             chunksizes=chunksizes,
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fletcher32, __pyx_v_fletcher32) < 0) __PYX_ERR(0, 281, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":286
 *             shuffle=shuffle,
 *             fletcher32=fletcher32,
 *             contiguous=contiguous,             # <<<<<<<<<<<<<<
 *             chunksizes=chunksizes,
 *             endian=endian,
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_contiguous, __pyx_v_contiguous) < 0) __PYX_ERR(0, 281, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":287
 *             fletcher32=fletcher32,
 *             contiguous=contiguous,
 *             chunksizes=chunksizes,             # <<<<<<<<<<<<<<
 *             endian=endian,
 *             least_significant_digit=least_significant_digit,
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_chunksizes, __pyx_v_chunksizes) < 0) __PYX_ERR(0, 281, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":288
 *             contiguous=contiguous,
 *             chunksizes=chunksizes,
 *             endian=endian,             # <<<<<<<<<<<<<<
 *             least_significant_digit=least_significant_digit,
 *             fill_value=fill_value,
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_endian, __pyx_v_endian) < 0) __PYX_ERR(0, 281, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":289
 *             chunksizes=chunksizes,
 *             endian=endian,
 *             least_significant_digit=least_significant_digit,             # <<<<<<<<<<<<<<
 *             fill_value=fill_value,
 *             chunk_cache=chunk_cache
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_least_significant_digit, __pyx_v_least_significant_digit) < 0) __PYX_ERR(0, 281, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":290
 *             endian=endian,
 *             least_significant_digit=least_significant_digit,
 *             fill_value=fill_value,             # <<<<<<<<<<<<<<
 *             chunk_cache=chunk_cache
 *         )
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fill_value, __pyx_v_fill_value) < 0) __PYX_ERR(0, 281, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":291
 *             least_significant_digit=least_significant_digit,
 *             fill_value=fill_value,
 *             chunk_cache=chunk_cache             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_chunk_cache, __pyx_v_chunk_cache) < 0) __PYX_ERR(0, 281, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":278
 * 
 *         # Initialise the base class
 *         self._nc_var = nc_parent.createVariable(             # <<<<<<<<<<<<<<
 *             name,
 *             datatype,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __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_7); __pyx_t_7 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2, __pyx_t_4) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":167
 *             return None
 * 
 *     def create(self, parent, name, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *             complevel=4, shuffle=True, fletcher32=False, contiguous=False,
 *             chunksizes=None, endian='native', least_significant_digit=None,
 */

  /* 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_8);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nc_dimensions);
  __Pyx_XDECREF(__pyx_v_s3_dataset);
  __Pyx_XDECREF(__pyx_v_nc_parent);
  __Pyx_XDECREF(__pyx_v_ncd);
  __Pyx_XDECREF(__pyx_v_cfa_root_group);
  __Pyx_XDECREF(__pyx_v_pm_dimensions);
  __Pyx_XDECREF(__pyx_v_pm_shape);
  __Pyx_XDECREF(__pyx_v_cfa_version);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":295
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         """Override the shape parameter."""
 *         if hasattr(self, "_cfa_var"):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_7shape(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_6shape[] = "Override the shape parameter.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_7shape = {"shape", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_7shape, METH_O, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_6shape};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_7shape(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shape (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_6shape(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_6shape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("shape", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":297
 *     def shape(self):
 *         """Override the shape parameter."""
 *         if hasattr(self, "_cfa_var"):             # <<<<<<<<<<<<<<
 *             return self._cfa_var.shape()
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 297, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "S3netCDF4/_s3netCDF4.pyx":298
 *         """Override the shape parameter."""
 *         if hasattr(self, "_cfa_var"):
 *             return self._cfa_var.shape()             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_var.shape
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":297
 *     def shape(self):
 *         """Override the shape parameter."""
 *         if hasattr(self, "_cfa_var"):             # <<<<<<<<<<<<<<
 *             return self._cfa_var.shape()
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":300
 *             return self._cfa_var.shape()
 *         else:
 *             return self._nc_var.shape             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":295
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         """Override the shape parameter."""
 *         if hasattr(self, "_cfa_var"):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.shape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":303
 * 
 *     @property
 *     def dtype(self):             # <<<<<<<<<<<<<<
 *         """Override the dtype parameter."""
 *         if hasattr(self, "_cfa_var"):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_9dtype(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_8dtype[] = "Override the dtype parameter.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_9dtype = {"dtype", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_9dtype, METH_O, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_8dtype};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_9dtype(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dtype (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_8dtype(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_8dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("dtype", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":305
 *     def dtype(self):
 *         """Override the dtype parameter."""
 *         if hasattr(self, "_cfa_var"):             # <<<<<<<<<<<<<<
 *             return self._cfa_var.getType()
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 305, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "S3netCDF4/_s3netCDF4.pyx":306
 *         """Override the dtype parameter."""
 *         if hasattr(self, "_cfa_var"):
 *             return self._cfa_var.getType()             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_var.dtype
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":305
 *     def dtype(self):
 *         """Override the dtype parameter."""
 *         if hasattr(self, "_cfa_var"):             # <<<<<<<<<<<<<<
 *             return self._cfa_var.getType()
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":308
 *             return self._cfa_var.getType()
 *         else:
 *             return self._nc_var.dtype             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":303
 * 
 *     @property
 *     def dtype(self):             # <<<<<<<<<<<<<<
 *         """Override the dtype parameter."""
 *         if hasattr(self, "_cfa_var"):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":311
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_var"):
 *             return tuple(self._cfa_var.getDimensions())
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_11dimensions(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_11dimensions = {"dimensions", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_11dimensions, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_11dimensions(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dimensions (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_10dimensions(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_10dimensions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("dimensions", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":312
 *     @property
 *     def dimensions(self):
 *         if hasattr(self, "_cfa_var"):             # <<<<<<<<<<<<<<
 *             return tuple(self._cfa_var.getDimensions())
 *         else:
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 312, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "S3netCDF4/_s3netCDF4.pyx":313
 *     def dimensions(self):
 *         if hasattr(self, "_cfa_var"):
 *             return tuple(self._cfa_var.getDimensions())             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_var.dimensions
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getDimensions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && 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_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":312
 *     @property
 *     def dimensions(self):
 *         if hasattr(self, "_cfa_var"):             # <<<<<<<<<<<<<<
 *             return tuple(self._cfa_var.getDimensions())
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":315
 *             return tuple(self._cfa_var.getDimensions())
 *         else:
 *             return self._nc_var.dimensions             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":311
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_var"):
 *             return tuple(self._cfa_var.getDimensions())
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":318
 * 
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Variable so as to return its
 *         private variables."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_13__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_12__getattr__[] = "Override the __getattr__ for the Variable so as to return its\n        private variables.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_13__getattr__ = {"__getattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_13__getattr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_12__getattr__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_13__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, 1); __PYX_ERR(0, 318, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattr__") < 0)) __PYX_ERR(0, 318, __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_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 318, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_12__getattr__(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_12__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  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_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":321
 *         """Override the __getattr__ for the Variable so as to return its
 *         private variables."""
 *         try:             # <<<<<<<<<<<<<<
 *             if name in s3Variable._private_atts:
 *                 return self.__dict__[name]
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "S3netCDF4/_s3netCDF4.pyx":322
 *         private variables."""
 *         try:
 *             if name in s3Variable._private_atts:             # <<<<<<<<<<<<<<
 *                 return self.__dict__[name]
 *             elif name in netCDF4._private_atts:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_s3Variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 322, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = (__pyx_t_6 != 0);
      if (__pyx_t_7) {

        /* "S3netCDF4/_s3netCDF4.pyx":323
 *         try:
 *             if name in s3Variable._private_atts:
 *                 return self.__dict__[name]             # <<<<<<<<<<<<<<
 *             elif name in netCDF4._private_atts:
 *                 return self._nc_var.__getattr__(name)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L3_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_L7_try_return;

        /* "S3netCDF4/_s3netCDF4.pyx":322
 *         private variables."""
 *         try:
 *             if name in s3Variable._private_atts:             # <<<<<<<<<<<<<<
 *                 return self.__dict__[name]
 *             elif name in netCDF4._private_atts:
 */
      }

      /* "S3netCDF4/_s3netCDF4.pyx":324
 *             if name in s3Variable._private_atts:
 *                 return self.__dict__[name]
 *             elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *                 return self._nc_var.__getattr__(name)
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 324, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = (__pyx_t_7 != 0);
      if (__pyx_t_6) {

        /* "S3netCDF4/_s3netCDF4.pyx":325
 *                 return self.__dict__[name]
 *             elif name in netCDF4._private_atts:
 *                 return self._nc_var.__getattr__(name)             # <<<<<<<<<<<<<<
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 *                 return self._cfa_var.metadata[name]
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getattr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 325, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && 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);
          }
        }
        __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 325, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L7_try_return;

        /* "S3netCDF4/_s3netCDF4.pyx":324
 *             if name in s3Variable._private_atts:
 *                 return self.__dict__[name]
 *             elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *                 return self._nc_var.__getattr__(name)
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 */
      }

      /* "S3netCDF4/_s3netCDF4.pyx":326
 *             elif name in netCDF4._private_atts:
 *                 return self._nc_var.__getattr__(name)
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *                 return self._cfa_var.metadata[name]
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
      __pyx_t_7 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 326, __pyx_L3_error)
      __pyx_t_9 = (__pyx_t_7 != 0);
      if (__pyx_t_9) {
      } else {
        __pyx_t_6 = __pyx_t_9;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 326, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __pyx_t_9;
      __pyx_L10_bool_binop_done:;
      if (__pyx_t_6) {

        /* "S3netCDF4/_s3netCDF4.pyx":327
 *                 return self._nc_var.__getattr__(name)
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 *                 return self._cfa_var.metadata[name]             # <<<<<<<<<<<<<<
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *                 return self._cfa_dim.metadata[name]
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_metadata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L7_try_return;

        /* "S3netCDF4/_s3netCDF4.pyx":326
 *             elif name in netCDF4._private_atts:
 *                 return self._nc_var.__getattr__(name)
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *                 return self._cfa_var.metadata[name]
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
      }

      /* "S3netCDF4/_s3netCDF4.pyx":328
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 *                 return self._cfa_var.metadata[name]
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *                 return self._cfa_dim.metadata[name]
 *         except KeyError:
 */
      __pyx_t_9 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dim_2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L3_error)
      __pyx_t_7 = (__pyx_t_9 != 0);
      if (__pyx_t_7) {
      } else {
        __pyx_t_6 = __pyx_t_7;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 328, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __pyx_t_7;
      __pyx_L12_bool_binop_done:;
      if (__pyx_t_6) {

        /* "S3netCDF4/_s3netCDF4.pyx":329
 *                 return self._cfa_var.metadata[name]
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *                 return self._cfa_dim.metadata[name]             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             return self._nc_var.__getattr__(name)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_metadata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 329, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L7_try_return;

        /* "S3netCDF4/_s3netCDF4.pyx":328
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 *                 return self._cfa_var.metadata[name]
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *                 return self._cfa_dim.metadata[name]
 *         except KeyError:
 */
      }

      /* "S3netCDF4/_s3netCDF4.pyx":321
 *         """Override the __getattr__ for the Variable so as to return its
 *         private variables."""
 *         try:             # <<<<<<<<<<<<<<
 *             if name in s3Variable._private_atts:
 *                 return self.__dict__[name]
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":330
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *                 return self._cfa_dim.metadata[name]
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             return self._nc_var.__getattr__(name)
 * 
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_10) {
      __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_8, &__pyx_t_4) < 0) __PYX_ERR(0, 330, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_4);

      /* "S3netCDF4/_s3netCDF4.pyx":331
 *                 return self._cfa_dim.metadata[name]
 *         except KeyError:
 *             return self._nc_var.__getattr__(name)             # <<<<<<<<<<<<<<
 * 
 *     def __setattr__(self, name, value):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 331, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_getattr); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 331, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
        }
      }
      __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_name);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 331, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_r = __pyx_t_11;
      __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "S3netCDF4/_s3netCDF4.pyx":321
 *         """Override the __getattr__ for the Variable so as to return its
 *         private variables."""
 *         try:             # <<<<<<<<<<<<<<
 *             if name in s3Variable._private_atts:
 *                 return self.__dict__[name]
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":318
 * 
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Variable so as to return its
 *         private variables."""
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":333
 *             return self._nc_var.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Variable so as to assign its
 *         private variables."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_15__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_14__setattr__[] = "Override the __setattr__ for the Variable so as to assign its\n        private variables.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_15__setattr__ = {"__setattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_15__setattr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_14__setattr__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_15__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 1); __PYX_ERR(0, 333, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 2); __PYX_ERR(0, 333, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setattr__") < 0)) __PYX_ERR(0, 333, __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_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 333, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_14__setattr__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_14__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  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_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setattr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":336
 *         """Override the __setattr__ for the Variable so as to assign its
 *         private variables."""
 *         try:             # <<<<<<<<<<<<<<
 *             if name in s3Variable._private_atts:
 *                 self.__dict__[name] = value
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "S3netCDF4/_s3netCDF4.pyx":337
 *         private variables."""
 *         try:
 *             if name in s3Variable._private_atts:             # <<<<<<<<<<<<<<
 *                 self.__dict__[name] = value
 *             elif name in netCDF4._private_atts:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_s3Variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = (__pyx_t_6 != 0);
      if (__pyx_t_7) {

        /* "S3netCDF4/_s3netCDF4.pyx":338
 *         try:
 *             if name in s3Variable._private_atts:
 *                 self.__dict__[name] = value             # <<<<<<<<<<<<<<
 *             elif name in netCDF4._private_atts:
 *                 self._nc_var.__setattr__(name, value)
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 338, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":337
 *         private variables."""
 *         try:
 *             if name in s3Variable._private_atts:             # <<<<<<<<<<<<<<
 *                 self.__dict__[name] = value
 *             elif name in netCDF4._private_atts:
 */
        goto __pyx_L9;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":339
 *             if name in s3Variable._private_atts:
 *                 self.__dict__[name] = value
 *             elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *                 self._nc_var.__setattr__(name, value)
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 339, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = (__pyx_t_7 != 0);
      if (__pyx_t_6) {

        /* "S3netCDF4/_s3netCDF4.pyx":340
 *                 self.__dict__[name] = value
 *             elif name in netCDF4._private_atts:
 *                 self._nc_var.__setattr__(name, value)             # <<<<<<<<<<<<<<
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 *                 self._cfa_var.metadata[name] = value
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_setattr); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_9 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
            __pyx_t_9 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_name, __pyx_v_value};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_name, __pyx_v_value};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L3_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        {
          __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 340, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(__pyx_v_name);
          __Pyx_GIVEREF(__pyx_v_name);
          PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_name);
          __Pyx_INCREF(__pyx_v_value);
          __Pyx_GIVEREF(__pyx_v_value);
          PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_value);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":339
 *             if name in s3Variable._private_atts:
 *                 self.__dict__[name] = value
 *             elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *                 self._nc_var.__setattr__(name, value)
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 */
        goto __pyx_L9;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":341
 *             elif name in netCDF4._private_atts:
 *                 self._nc_var.__setattr__(name, value)
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *                 self._cfa_var.metadata[name] = value
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
      __pyx_t_7 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 341, __pyx_L3_error)
      __pyx_t_11 = (__pyx_t_7 != 0);
      if (__pyx_t_11) {
      } else {
        __pyx_t_6 = __pyx_t_11;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 341, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __pyx_t_11;
      __pyx_L10_bool_binop_done:;
      if (__pyx_t_6) {

        /* "S3netCDF4/_s3netCDF4.pyx":342
 *                 self._nc_var.__setattr__(name, value)
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 *                 self._cfa_var.metadata[name] = value             # <<<<<<<<<<<<<<
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *                 self._cfa_dim.metadata[name] = value
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_metadata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 342, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 342, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":341
 *             elif name in netCDF4._private_atts:
 *                 self._nc_var.__setattr__(name, value)
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *                 self._cfa_var.metadata[name] = value
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
        goto __pyx_L9;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":343
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 *                 self._cfa_var.metadata[name] = value
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *                 self._cfa_dim.metadata[name] = value
 *         except KeyError:
 */
      __pyx_t_11 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dim_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 343, __pyx_L3_error)
      __pyx_t_7 = (__pyx_t_11 != 0);
      if (__pyx_t_7) {
      } else {
        __pyx_t_6 = __pyx_t_7;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 343, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_6 = __pyx_t_7;
      __pyx_L12_bool_binop_done:;
      if (__pyx_t_6) {

        /* "S3netCDF4/_s3netCDF4.pyx":344
 *                 self._cfa_var.metadata[name] = value
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *                 self._cfa_dim.metadata[name] = value             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             self._nc_var.__setattr__(name, value)
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 344, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":343
 *             elif hasattr(self, "_cfa_var") and self._cfa_var:
 *                 self._cfa_var.metadata[name] = value
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *                 self._cfa_dim.metadata[name] = value
 *         except KeyError:
 */
      }
      __pyx_L9:;

      /* "S3netCDF4/_s3netCDF4.pyx":336
 *         """Override the __setattr__ for the Variable so as to assign its
 *         private variables."""
 *         try:             # <<<<<<<<<<<<<<
 *             if name in s3Variable._private_atts:
 *                 self.__dict__[name] = value
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":345
 *             elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *                 self._cfa_dim.metadata[name] = value
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             self._nc_var.__setattr__(name, value)
 * 
 */
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_10) < 0) __PYX_ERR(0, 345, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_10);

      /* "S3netCDF4/_s3netCDF4.pyx":346
 *                 self._cfa_dim.metadata[name] = value
 *         except KeyError:
 *             self._nc_var.__setattr__(name, value)             # <<<<<<<<<<<<<<
 * 
 *     def delncattr(self, name):
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 346, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_setattr); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 346, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
          __pyx_t_9 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_13)) {
        PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_name, __pyx_v_value};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 346, __pyx_L5_except_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
        PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_name, __pyx_v_value};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 346, __pyx_L5_except_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_14 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 346, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        if (__pyx_t_12) {
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
        }
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_9, __pyx_v_name);
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_9, __pyx_v_value);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 346, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "S3netCDF4/_s3netCDF4.pyx":336
 *         """Override the __setattr__ for the Variable so as to assign its
 *         private variables."""
 *         try:             # <<<<<<<<<<<<<<
 *             if name in s3Variable._private_atts:
 *                 self.__dict__[name] = value
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":333
 *             return self._nc_var.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Variable so as to assign its
 *         private variables."""
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":348
 *             self._nc_var.__setattr__(name, value)
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_17delncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_16delncattr[] = "Override delncattr function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_17delncattr = {"delncattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_17delncattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_16delncattr};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_17delncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delncattr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("delncattr", 1, 2, 2, 1); __PYX_ERR(0, 348, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delncattr") < 0)) __PYX_ERR(0, 348, __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_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delncattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 348, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_16delncattr(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_16delncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delncattr", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":352
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._cfa_var.metadata.pop(name)
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 352, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":353
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_var.metadata.pop(name)
 *             except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "S3netCDF4/_s3netCDF4.pyx":354
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             try:
 *                 self._cfa_var.metadata.pop(name)             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 raise APIException(
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 354, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 354, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pop); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 354, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":353
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_var.metadata.pop(name)
 *             except KeyError:
 */
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":355
 *             try:
 *                 self._cfa_var.metadata.pop(name)
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 raise APIException(
 *                     "Attribute {} not found in variable {}".format(
 */
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_10) {
        __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 355, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_9);

        /* "S3netCDF4/_s3netCDF4.pyx":356
 *                 self._cfa_var.metadata.pop(name)
 *             except KeyError:
 *                 raise APIException(             # <<<<<<<<<<<<<<
 *                     "Attribute {} not found in variable {}".format(
 *                     name, self.name
 */
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_APIException); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 356, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_12);

        /* "S3netCDF4/_s3netCDF4.pyx":357
 *             except KeyError:
 *                 raise APIException(
 *                     "Attribute {} not found in variable {}".format(             # <<<<<<<<<<<<<<
 *                     name, self.name
 *                 ))
 */
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Attribute_not_found_in_variable, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 357, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_14);

        /* "S3netCDF4/_s3netCDF4.pyx":358
 *                 raise APIException(
 *                     "Attribute {} not found in variable {}".format(
 *                     name, self.name             # <<<<<<<<<<<<<<
 *                 ))
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 358, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_16 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_16)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_16);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
            __pyx_t_10 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_14)) {
          PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_name, __pyx_t_15};
          __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 357, __pyx_L8_except_error)
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
          PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_name, __pyx_t_15};
          __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 357, __pyx_L8_except_error)
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        } else
        #endif
        {
          __pyx_t_17 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 357, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_17);
          if (__pyx_t_16) {
            __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __pyx_t_16 = NULL;
          }
          __Pyx_INCREF(__pyx_v_name);
          __Pyx_GIVEREF(__pyx_v_name);
          PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_10, __pyx_v_name);
          __Pyx_GIVEREF(__pyx_t_15);
          PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_10, __pyx_t_15);
          __pyx_t_15 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 357, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        }
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_11 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_14, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 356, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_Raise(__pyx_t_11, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(0, 356, __pyx_L8_except_error)
      }
      goto __pyx_L8_except_error;
      __pyx_L8_except_error:;

      /* "S3netCDF4/_s3netCDF4.pyx":353
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_var.metadata.pop(name)
 *             except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L11_try_end:;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":352
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._cfa_var.metadata.pop(name)
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":360
 *                     name, self.name
 *                 ))
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._cfa_dim.metadata.pop(name)
 */
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dim_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 360, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":361
 *                 ))
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_dim.metadata.pop(name)
 *             except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "S3netCDF4/_s3netCDF4.pyx":362
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             try:
 *                 self._cfa_dim.metadata.pop(name)             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 raise APIException(
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 362, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pop); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 362, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && 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);
          }
        }
        __pyx_t_9 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 362, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":361
 *                 ))
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_dim.metadata.pop(name)
 *             except KeyError:
 */
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L21_try_end;
      __pyx_L16_error:;
      __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;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":363
 *             try:
 *                 self._cfa_dim.metadata.pop(name)
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 raise APIException(
 *                     "Attribute {} not found in variable {}".format(
 */
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_10) {
        __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_4) < 0) __PYX_ERR(0, 363, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_4);

        /* "S3netCDF4/_s3netCDF4.pyx":364
 *                 self._cfa_dim.metadata.pop(name)
 *             except KeyError:
 *                 raise APIException(             # <<<<<<<<<<<<<<
 *                     "Attribute {} not found in variable {}".format(
 *                     name, self.name
 */
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_APIException); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 364, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_12);

        /* "S3netCDF4/_s3netCDF4.pyx":365
 *             except KeyError:
 *                 raise APIException(
 *                     "Attribute {} not found in variable {}".format(             # <<<<<<<<<<<<<<
 *                     name, self.name
 *                 ))
 */
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Attribute_not_found_in_variable, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 365, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_14);

        /* "S3netCDF4/_s3netCDF4.pyx":366
 *                 raise APIException(
 *                     "Attribute {} not found in variable {}".format(
 *                     name, self.name             # <<<<<<<<<<<<<<
 *                 ))
 *         else:
 */
        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 366, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_17);
        __pyx_t_15 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
            __pyx_t_10 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_14)) {
          PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_name, __pyx_t_17};
          __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 365, __pyx_L18_except_error)
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
          PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_v_name, __pyx_t_17};
          __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 365, __pyx_L18_except_error)
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        } else
        #endif
        {
          __pyx_t_16 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 365, __pyx_L18_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          if (__pyx_t_15) {
            __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
          }
          __Pyx_INCREF(__pyx_v_name);
          __Pyx_GIVEREF(__pyx_v_name);
          PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_10, __pyx_v_name);
          __Pyx_GIVEREF(__pyx_t_17);
          PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_10, __pyx_t_17);
          __pyx_t_17 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 365, __pyx_L18_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        }
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_11 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_14, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 364, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_Raise(__pyx_t_11, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(0, 364, __pyx_L18_except_error)
      }
      goto __pyx_L18_except_error;
      __pyx_L18_except_error:;

      /* "S3netCDF4/_s3netCDF4.pyx":361
 *                 ))
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_dim.metadata.pop(name)
 *             except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L21_try_end:;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":360
 *                     name, self.name
 *                 ))
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._cfa_dim.metadata.pop(name)
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":369
 *                 ))
 *         else:
 *             self._nc_var.delncattr(name)             # <<<<<<<<<<<<<<
 * 
 *     def getncattr(self, name):
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_delncattr); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":348
 *             self._nc_var.__setattr__(name, value)
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":371
 *             self._nc_var.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_19getncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_18getncattr[] = "Override getncattr function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_19getncattr = {"getncattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_19getncattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_18getncattr};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_19getncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getncattr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getncattr", 1, 2, 2, 1); __PYX_ERR(0, 371, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getncattr") < 0)) __PYX_ERR(0, 371, __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_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getncattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 371, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_18getncattr(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_18getncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getncattr", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":375
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             try:
 *                 return self._cfa_var.metadata[name]
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 375, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 375, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":376
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_var.metadata[name]
 *             except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "S3netCDF4/_s3netCDF4.pyx":377
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             try:
 *                 return self._cfa_var.metadata[name]             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 return self._nc_var.getncattr(name)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_metadata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 377, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L10_try_return;

        /* "S3netCDF4/_s3netCDF4.pyx":376
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_var.metadata[name]
 *             except KeyError:
 */
      }
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":378
 *             try:
 *                 return self._cfa_var.metadata[name]
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 return self._nc_var.getncattr(name)
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_10) < 0) __PYX_ERR(0, 378, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_10);

        /* "S3netCDF4/_s3netCDF4.pyx":379
 *                 return self._cfa_var.metadata[name]
 *             except KeyError:
 *                 return self._nc_var.getncattr(name)             # <<<<<<<<<<<<<<
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             try:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 379, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_getncattr); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 379, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_name);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 379, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_r = __pyx_t_11;
        __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L9_except_return;
      }
      goto __pyx_L8_except_error;
      __pyx_L8_except_error:;

      /* "S3netCDF4/_s3netCDF4.pyx":376
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_var.metadata[name]
 *             except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L10_try_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
      __pyx_L9_except_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":375
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             try:
 *                 return self._cfa_var.metadata[name]
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":380
 *             except KeyError:
 *                 return self._nc_var.getncattr(name)
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             try:
 *                 return self._cfa_dim.metadata[name]
 */
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dim_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 380, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":381
 *                 return self._nc_var.getncattr(name)
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_dim.metadata[name]
 *             except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "S3netCDF4/_s3netCDF4.pyx":382
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             try:
 *                 return self._cfa_dim.metadata[name]             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 return self._nc_var.getncattr(name)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 382, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_metadata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 382, __pyx_L16_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_10;
        __pyx_t_10 = 0;
        goto __pyx_L20_try_return;

        /* "S3netCDF4/_s3netCDF4.pyx":381
 *                 return self._nc_var.getncattr(name)
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_dim.metadata[name]
 *             except KeyError:
 */
      }
      __pyx_L16_error:;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __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;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":383
 *             try:
 *                 return self._cfa_dim.metadata[name]
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 return self._nc_var.getncattr(name)
 *         else:
 */
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_8, &__pyx_t_4) < 0) __PYX_ERR(0, 383, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_4);

        /* "S3netCDF4/_s3netCDF4.pyx":384
 *                 return self._cfa_dim.metadata[name]
 *             except KeyError:
 *                 return self._nc_var.getncattr(name)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_var.getncattr(name)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 384, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_getncattr); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 384, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_name);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 384, __pyx_L18_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_r = __pyx_t_11;
        __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L19_except_return;
      }
      goto __pyx_L18_except_error;
      __pyx_L18_except_error:;

      /* "S3netCDF4/_s3netCDF4.pyx":381
 *                 return self._nc_var.getncattr(name)
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_dim.metadata[name]
 *             except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L20_try_return:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
      goto __pyx_L0;
      __pyx_L19_except_return:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
      goto __pyx_L0;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":380
 *             except KeyError:
 *                 return self._nc_var.getncattr(name)
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             try:
 *                 return self._cfa_dim.metadata[name]
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":386
 *                 return self._nc_var.getncattr(name)
 *         else:
 *             return self._nc_var.getncattr(name)             # <<<<<<<<<<<<<<
 * 
 *     def ncattrs(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_getncattr); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_8, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":371
 *             self._nc_var.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":388
 *             return self._nc_var.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_21ncattrs(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_20ncattrs[] = "Override ncattrs function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_21ncattrs = {"ncattrs", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_21ncattrs, METH_O, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_20ncattrs};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_21ncattrs(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ncattrs (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_20ncattrs(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_20ncattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ncattrs", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":392
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             return self._cfa_var.metadata.keys()
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 392, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 392, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":393
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             return self._cfa_var.metadata.keys()             # <<<<<<<<<<<<<<
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             return self._cfa_dim.metadata.keys()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_metadata); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __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_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __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;

    /* "S3netCDF4/_s3netCDF4.pyx":392
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             return self._cfa_var.metadata.keys()
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":394
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             return self._cfa_var.metadata.keys()
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             return self._cfa_dim.metadata.keys()
 *         else:
 */
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dim_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 394, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":395
 *             return self._cfa_var.metadata.keys()
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             return self._cfa_dim.metadata.keys()             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_var.ncattrs()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_metadata); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __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_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __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;

    /* "S3netCDF4/_s3netCDF4.pyx":394
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             return self._cfa_var.metadata.keys()
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             return self._cfa_dim.metadata.keys()
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":397
 *             return self._cfa_dim.metadata.keys()
 *         else:
 *             return self._nc_var.ncattrs()             # <<<<<<<<<<<<<<
 * 
 *     def setncattr(self, name, value):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ncattrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":388
 *             return self._nc_var.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.ncattrs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":399
 *             return self._nc_var.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_23setncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_22setncattr[] = "Override setncattr function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_23setncattr = {"setncattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_23setncattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_22setncattr};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_23setncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setncattr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr", 1, 3, 3, 1); __PYX_ERR(0, 399, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr", 1, 3, 3, 2); __PYX_ERR(0, 399, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr") < 0)) __PYX_ERR(0, 399, __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_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setncattr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 399, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.setncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_22setncattr(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_22setncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setncattr", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":403
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             self._cfa_var.metadata[name] = value
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 403, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":404
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             self._cfa_var.metadata[name] = value             # <<<<<<<<<<<<<<
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             self._cfa_dim.metadata[name] = value
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 404, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":403
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             self._cfa_var.metadata[name] = value
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":405
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             self._cfa_var.metadata[name] = value
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             self._cfa_dim.metadata[name] = value
 *         else:
 */
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dim_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 405, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":406
 *             self._cfa_var.metadata[name] = value
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             self._cfa_dim.metadata[name] = value             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_var.setncattr(name, value)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 406, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":405
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             self._cfa_var.metadata[name] = value
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             self._cfa_dim.metadata[name] = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":408
 *             self._cfa_dim.metadata[name] = value
 *         else:
 *             self._nc_var.setncattr(name, value)             # <<<<<<<<<<<<<<
 * 
 *     def setncattr_string(self, name, value):
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_setncattr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_name, __pyx_v_value};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_name, __pyx_v_value};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":399
 *             return self._nc_var.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.setncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":410
 *             self._nc_var.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_25setncattr_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_24setncattr_string[] = "Override setncattr_string function to manipulate the metadata\n        dictionary, rather than the netCDF file.  The attributes are copied from\n        the metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_25setncattr_string = {"setncattr_string", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_25setncattr_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_24setncattr_string};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_25setncattr_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setncattr_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr_string", 1, 3, 3, 1); __PYX_ERR(0, 410, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr_string", 1, 3, 3, 2); __PYX_ERR(0, 410, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr_string") < 0)) __PYX_ERR(0, 410, __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_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setncattr_string", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 410, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.setncattr_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_24setncattr_string(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_24setncattr_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setncattr_string", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":414
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             self._cfa_var.metadata[name] = value
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 414, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 414, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":415
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             self._cfa_var.metadata[name] = value             # <<<<<<<<<<<<<<
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             self._cfa_dim.metadata[name] = value
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 415, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":414
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             self._cfa_var.metadata[name] = value
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":416
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             self._cfa_var.metadata[name] = value
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             self._cfa_dim.metadata[name] = value
 *         else:
 */
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dim_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 416, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":417
 *             self._cfa_var.metadata[name] = value
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             self._cfa_dim.metadata[name] = value             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_var.setncattr_string(name, value)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_metadata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 417, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":416
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             self._cfa_var.metadata[name] = value
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             self._cfa_dim.metadata[name] = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":419
 *             self._cfa_dim.metadata[name] = value
 *         else:
 *             self._nc_var.setncattr_string(name, value)             # <<<<<<<<<<<<<<
 * 
 *     def setncatts(self, attdict):
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_setncattr_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_name, __pyx_v_value};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_name, __pyx_v_value};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":410
 *             self._nc_var.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.setncattr_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":421
 *             self._nc_var.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_27setncatts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_26setncatts[] = "Override setncattrs function to manipulate the metadata\n        dictionary, rather than the netCDF file.  The attributes are copied from\n        the metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_27setncatts = {"setncatts", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_27setncatts, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_26setncatts};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_27setncatts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_attdict = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setncatts (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attdict,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attdict)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncatts", 1, 2, 2, 1); __PYX_ERR(0, 421, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncatts") < 0)) __PYX_ERR(0, 421, __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_self = values[0];
    __pyx_v_attdict = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setncatts", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 421, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.setncatts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_26setncatts(__pyx_self, __pyx_v_self, __pyx_v_attdict);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_26setncatts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attdict) {
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setncatts", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":425
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             for k in attdict:
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 425, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":426
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             for k in attdict:             # <<<<<<<<<<<<<<
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 *                     self._cfa_var.metadata[k] = attdict[k]
 */
    if (likely(PyList_CheckExact(__pyx_v_attdict)) || PyTuple_CheckExact(__pyx_v_attdict)) {
      __pyx_t_4 = __pyx_v_attdict; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_attdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 426, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 426, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 426, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":427
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             for k in attdict:
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):             # <<<<<<<<<<<<<<
 *                     self._cfa_var.metadata[k] = attdict[k]
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_t_8, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (!__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L9_bool_binop_done;
      }
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_s3Variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = (__pyx_t_2 != 0);
      __pyx_t_1 = __pyx_t_3;
      __pyx_L9_bool_binop_done:;
      __pyx_t_3 = ((!__pyx_t_1) != 0);
      if (__pyx_t_3) {

        /* "S3netCDF4/_s3netCDF4.pyx":428
 *             for k in attdict:
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 *                     self._cfa_var.metadata[k] = attdict[k]             # <<<<<<<<<<<<<<
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             for k in attdict:
 */
        __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_attdict, __pyx_v_k); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 428, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 428, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(PyObject_SetItem(__pyx_t_9, __pyx_v_k, __pyx_t_7) < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":427
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             for k in attdict:
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):             # <<<<<<<<<<<<<<
 *                     self._cfa_var.metadata[k] = attdict[k]
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 */
      }

      /* "S3netCDF4/_s3netCDF4.pyx":426
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             for k in attdict:             # <<<<<<<<<<<<<<
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 *                     self._cfa_var.metadata[k] = attdict[k]
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":425
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             for k in attdict:
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":429
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 *                     self._cfa_var.metadata[k] = attdict[k]
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             for k in attdict:
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dim_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 429, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L11_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __pyx_t_2;
  __pyx_L11_bool_binop_done:;
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":430
 *                     self._cfa_var.metadata[k] = attdict[k]
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             for k in attdict:             # <<<<<<<<<<<<<<
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 *                     self._cfa_dim.metadata[k] = attdict[k]
 */
    if (likely(PyList_CheckExact(__pyx_v_attdict)) || PyTuple_CheckExact(__pyx_v_attdict)) {
      __pyx_t_4 = __pyx_v_attdict; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_attdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 430, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 430, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 430, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":431
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             for k in attdict:
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):             # <<<<<<<<<<<<<<
 *                     self._cfa_dim.metadata[k] = attdict[k]
 *         else:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 431, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (!__pyx_t_1) {
      } else {
        __pyx_t_3 = __pyx_t_1;
        goto __pyx_L16_bool_binop_done;
      }
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_s3Variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 431, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = (__pyx_t_1 != 0);
      __pyx_t_3 = __pyx_t_2;
      __pyx_L16_bool_binop_done:;
      __pyx_t_2 = ((!__pyx_t_3) != 0);
      if (__pyx_t_2) {

        /* "S3netCDF4/_s3netCDF4.pyx":432
 *             for k in attdict:
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 *                     self._cfa_dim.metadata[k] = attdict[k]             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_var.setncatts(attdict)
 */
        __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_attdict, __pyx_v_k); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dim_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_metadata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_v_k, __pyx_t_7) < 0)) __PYX_ERR(0, 432, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":431
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             for k in attdict:
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):             # <<<<<<<<<<<<<<
 *                     self._cfa_dim.metadata[k] = attdict[k]
 *         else:
 */
      }

      /* "S3netCDF4/_s3netCDF4.pyx":430
 *                     self._cfa_var.metadata[k] = attdict[k]
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             for k in attdict:             # <<<<<<<<<<<<<<
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 *                     self._cfa_dim.metadata[k] = attdict[k]
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":429
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 *                     self._cfa_var.metadata[k] = attdict[k]
 *         elif hasattr(self, "_cfa_dim") and self._cfa_dim:             # <<<<<<<<<<<<<<
 *             for k in attdict:
 *                 if not(k in netCDF4._private_atts or k in s3Variable._private_atts):
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":434
 *                     self._cfa_dim.metadata[k] = attdict[k]
 *         else:
 *             self._nc_var.setncatts(attdict)             # <<<<<<<<<<<<<<
 * 
 *     def __open_subarray_ncfile(self, index, request_object,
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_setncatts); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_attdict) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_attdict);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":421
 *             self._nc_var.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.setncatts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":436
 *             self._nc_var.setncatts(attdict)
 * 
 *     def __open_subarray_ncfile(self, index, request_object,             # <<<<<<<<<<<<<<
 *                                in_memory=False, mode="r"):
 *         """Open a subarray file, either in memory or on disk"""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_29__open_subarray_ncfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_28__open_subarray_ncfile[] = "Open a subarray file, either in memory or on disk";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_29__open_subarray_ncfile = {"__open_subarray_ncfile", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_29__open_subarray_ncfile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_28__open_subarray_ncfile};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_29__open_subarray_ncfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_request_object = 0;
  PyObject *__pyx_v_in_memory = 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("__open_subarray_ncfile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_index,&__pyx_n_s_request_object,&__pyx_n_s_in_memory,&__pyx_n_s_mode,0};
    PyObject* values[5] = {0,0,0,0,0};

    /* "S3netCDF4/_s3netCDF4.pyx":437
 * 
 *     def __open_subarray_ncfile(self, index, request_object,
 *                                in_memory=False, mode="r"):             # <<<<<<<<<<<<<<
 *         """Open a subarray file, either in memory or on disk"""
 *         # get the parent dataset to get the information used in its creation,
 */
    values[3] = ((PyObject *)((PyObject *)Py_False));
    values[4] = ((PyObject *)((PyObject*)__pyx_n_u_r));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__open_subarray_ncfile", 0, 3, 5, 1); __PYX_ERR(0, 436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_request_object)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__open_subarray_ncfile", 0, 3, 5, 2); __PYX_ERR(0, 436, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_in_memory);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__open_subarray_ncfile") < 0)) __PYX_ERR(0, 436, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        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_self = values[0];
    __pyx_v_index = values[1];
    __pyx_v_request_object = values[2];
    __pyx_v_in_memory = values[3];
    __pyx_v_mode = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__open_subarray_ncfile", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 436, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__open_subarray_ncfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_28__open_subarray_ncfile(__pyx_self, __pyx_v_self, __pyx_v_index, __pyx_v_request_object, __pyx_v_in_memory, __pyx_v_mode);

  /* "S3netCDF4/_s3netCDF4.pyx":436
 *             self._nc_var.setncatts(attdict)
 * 
 *     def __open_subarray_ncfile(self, index, request_object,             # <<<<<<<<<<<<<<
 *                                in_memory=False, mode="r"):
 *         """Open a subarray file, either in memory or on disk"""
 */

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_28__open_subarray_ncfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_request_object, PyObject *__pyx_v_in_memory, PyObject *__pyx_v_mode) {
  PyObject *__pyx_v_s3d = NULL;
  PyObject *__pyx_v_diskless = NULL;
  PyObject *__pyx_v_memory = NULL;
  PyObject *__pyx_v_fname = NULL;
  PyObject *__pyx_v_nc_sa_dataset = 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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__open_subarray_ncfile", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":441
 *         # get the parent dataset to get the information used in its creation,
 *         # so that it can be mirrored in the creation of the sub-array files
 *         if hasattr(self.parent, "_nc_grp"):             # <<<<<<<<<<<<<<
 *             s3d = self.parent.parent
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_u_nc_grp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":442
 *         # so that it can be mirrored in the creation of the sub-array files
 *         if hasattr(self.parent, "_nc_grp"):
 *             s3d = self.parent.parent             # <<<<<<<<<<<<<<
 *         else:
 *             s3d = self.parent
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_s3d = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":441
 *         # get the parent dataset to get the information used in its creation,
 *         # so that it can be mirrored in the creation of the sub-array files
 *         if hasattr(self.parent, "_nc_grp"):             # <<<<<<<<<<<<<<
 *             s3d = self.parent.parent
 *         else:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":444
 *             s3d = self.parent.parent
 *         else:
 *             s3d = self.parent             # <<<<<<<<<<<<<<
 * 
 *         # if the subarray file is to be created entirely in memory then  it will
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_s3d = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":449
 *         # be diskless, otherwise take the parameters from the user supplied
 *         # creation parameters
 *         if in_memory:             # <<<<<<<<<<<<<<
 *             diskless = True
 *             # if "append" mode requested for in memory, then we have to open in
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_in_memory); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 449, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":450
 *         # creation parameters
 *         if in_memory:
 *             diskless = True             # <<<<<<<<<<<<<<
 *             # if "append" mode requested for in memory, then we have to open in
 *             # "write" mode as in memory isn't supported in "append" mode.  We'll
 */
    __Pyx_INCREF(Py_True);
    __pyx_v_diskless = Py_True;

    /* "S3netCDF4/_s3netCDF4.pyx":456
 *             # a writable netCDF4 Dataset, also in memory.  This is done in
 *             # __duplicate_subarray_ncfile
 *             if mode == "r":             # <<<<<<<<<<<<<<
 *                 # seek to the beginning then read
 *                 memory = request_object.file_object.read()
 */
    __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 456, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "S3netCDF4/_s3netCDF4.pyx":458
 *             if mode == "r":
 *                 # seek to the beginning then read
 *                 memory = request_object.file_object.read()             # <<<<<<<<<<<<<<
 *             else:
 *                 memory = 0
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_file_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_memory = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":456
 *             # a writable netCDF4 Dataset, also in memory.  This is done in
 *             # __duplicate_subarray_ncfile
 *             if mode == "r":             # <<<<<<<<<<<<<<
 *                 # seek to the beginning then read
 *                 memory = request_object.file_object.read()
 */
      goto __pyx_L5;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":460
 *                 memory = request_object.file_object.read()
 *             else:
 *                 memory = 0             # <<<<<<<<<<<<<<
 *             fname = "inmemory.nc"
 *         else:
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_int_0);
      __pyx_v_memory = __pyx_int_0;
    }
    __pyx_L5:;

    /* "S3netCDF4/_s3netCDF4.pyx":461
 *             else:
 *                 memory = 0
 *             fname = "inmemory.nc"             # <<<<<<<<<<<<<<
 *         else:
 *             diskless = s3d._creation_params["diskless"]
 */
    __Pyx_INCREF(__pyx_kp_u_inmemory_nc);
    __pyx_v_fname = __pyx_kp_u_inmemory_nc;

    /* "S3netCDF4/_s3netCDF4.pyx":449
 *         # be diskless, otherwise take the parameters from the user supplied
 *         # creation parameters
 *         if in_memory:             # <<<<<<<<<<<<<<
 *             diskless = True
 *             # if "append" mode requested for in memory, then we have to open in
 */
    goto __pyx_L4;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":463
 *             fname = "inmemory.nc"
 *         else:
 *             diskless = s3d._creation_params["diskless"]             # <<<<<<<<<<<<<<
 *             memory = s3d._creation_params["memory"]
 *             fname = index.partition.file
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s3d, __pyx_n_s_creation_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_u_diskless); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_diskless = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":464
 *         else:
 *             diskless = s3d._creation_params["diskless"]
 *             memory = s3d._creation_params["memory"]             # <<<<<<<<<<<<<<
 *             fname = index.partition.file
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s3d, __pyx_n_s_creation_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_u_memory); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_memory = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":465
 *             diskless = s3d._creation_params["diskless"]
 *             memory = s3d._creation_params["memory"]
 *             fname = index.partition.file             # <<<<<<<<<<<<<<
 * 
 *         # create the subarray dataset with the creation parameters from the
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_fname = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L4:;

  /* "S3netCDF4/_s3netCDF4.pyx":469
 *         # create the subarray dataset with the creation parameters from the
 *         # parameters determined above and the creation params
 *         nc_sa_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *             fname,
 *             mode=mode,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":470
 *         # parameters determined above and the creation params
 *         nc_sa_dataset = netCDF4.Dataset(
 *             fname,             # <<<<<<<<<<<<<<
 *             mode=mode,
 *             format=s3d._creation_params["format"],
 */
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_fname);
  __Pyx_GIVEREF(__pyx_v_fname);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fname);

  /* "S3netCDF4/_s3netCDF4.pyx":471
 *         nc_sa_dataset = netCDF4.Dataset(
 *             fname,
 *             mode=mode,             # <<<<<<<<<<<<<<
 *             format=s3d._creation_params["format"],
 *             clobber=s3d._creation_params["clobber"],
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mode, __pyx_v_mode) < 0) __PYX_ERR(0, 471, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":472
 *             fname,
 *             mode=mode,
 *             format=s3d._creation_params["format"],             # <<<<<<<<<<<<<<
 *             clobber=s3d._creation_params["clobber"],
 *             diskless=diskless,
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_s3d, __pyx_n_s_creation_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_u_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_format, __pyx_t_7) < 0) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":473
 *             mode=mode,
 *             format=s3d._creation_params["format"],
 *             clobber=s3d._creation_params["clobber"],             # <<<<<<<<<<<<<<
 *             diskless=diskless,
 *             persist=s3d._creation_params["persist"],
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_s3d, __pyx_n_s_creation_params); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_u_clobber); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_clobber, __pyx_t_6) < 0) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":474
 *             format=s3d._creation_params["format"],
 *             clobber=s3d._creation_params["clobber"],
 *             diskless=diskless,             # <<<<<<<<<<<<<<
 *             persist=s3d._creation_params["persist"],
 *             keepweakref=s3d._creation_params["keepweakref"],
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_diskless, __pyx_v_diskless) < 0) __PYX_ERR(0, 471, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":475
 *             clobber=s3d._creation_params["clobber"],
 *             diskless=diskless,
 *             persist=s3d._creation_params["persist"],             # <<<<<<<<<<<<<<
 *             keepweakref=s3d._creation_params["keepweakref"],
 *             memory=memory,
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_s3d, __pyx_n_s_creation_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_u_persist); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_persist, __pyx_t_7) < 0) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":476
 *             diskless=diskless,
 *             persist=s3d._creation_params["persist"],
 *             keepweakref=s3d._creation_params["keepweakref"],             # <<<<<<<<<<<<<<
 *             memory=memory,
 *             parallel=False
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_s3d, __pyx_n_s_creation_params); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_u_keepweakref); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_keepweakref, __pyx_t_6) < 0) __PYX_ERR(0, 471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":477
 *             persist=s3d._creation_params["persist"],
 *             keepweakref=s3d._creation_params["keepweakref"],
 *             memory=memory,             # <<<<<<<<<<<<<<
 *             parallel=False
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_memory, __pyx_v_memory) < 0) __PYX_ERR(0, 471, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":478
 *             keepweakref=s3d._creation_params["keepweakref"],
 *             memory=memory,
 *             parallel=False             # <<<<<<<<<<<<<<
 *         )
 *         return nc_sa_dataset
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_parallel, Py_False) < 0) __PYX_ERR(0, 471, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":469
 *         # create the subarray dataset with the creation parameters from the
 *         # parameters determined above and the creation params
 *         nc_sa_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *             fname,
 *             mode=mode,
 */
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nc_sa_dataset = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":480
 *             parallel=False
 *         )
 *         return nc_sa_dataset             # <<<<<<<<<<<<<<
 * 
 *     def __duplicate_subarray_ncfile(self, nc_in_dataset, nc_out_dataset):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_nc_sa_dataset);
  __pyx_r = __pyx_v_nc_sa_dataset;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":436
 *             self._nc_var.setncatts(attdict)
 * 
 *     def __open_subarray_ncfile(self, index, request_object,             # <<<<<<<<<<<<<<
 *                                in_memory=False, mode="r"):
 *         """Open a subarray file, either in memory or on disk"""
 */

  /* 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_7);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__open_subarray_ncfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s3d);
  __Pyx_XDECREF(__pyx_v_diskless);
  __Pyx_XDECREF(__pyx_v_memory);
  __Pyx_XDECREF(__pyx_v_fname);
  __Pyx_XDECREF(__pyx_v_nc_sa_dataset);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":482
 *         return nc_sa_dataset
 * 
 *     def __duplicate_subarray_ncfile(self, nc_in_dataset, nc_out_dataset):             # <<<<<<<<<<<<<<
 *         """Copy the contents of one subarray netCDF file into another subarray
 *         netCDF file.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_31__duplicate_subarray_ncfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_30__duplicate_subarray_ncfile[] = "Copy the contents of one subarray netCDF file into another subarray\n        netCDF file.\n        This function is necessary for appending to datasets in memory - they\n        have to be read in first, duplicated into a writable dataset and then\n        written out on close.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_31__duplicate_subarray_ncfile = {"__duplicate_subarray_ncfile", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_31__duplicate_subarray_ncfile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_30__duplicate_subarray_ncfile};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_31__duplicate_subarray_ncfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_nc_in_dataset = 0;
  PyObject *__pyx_v_nc_out_dataset = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__duplicate_subarray_ncfile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_nc_in_dataset,&__pyx_n_s_nc_out_dataset,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc_in_dataset)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__duplicate_subarray_ncfile", 1, 3, 3, 1); __PYX_ERR(0, 482, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc_out_dataset)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__duplicate_subarray_ncfile", 1, 3, 3, 2); __PYX_ERR(0, 482, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__duplicate_subarray_ncfile") < 0)) __PYX_ERR(0, 482, __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_self = values[0];
    __pyx_v_nc_in_dataset = values[1];
    __pyx_v_nc_out_dataset = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__duplicate_subarray_ncfile", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 482, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__duplicate_subarray_ncfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_30__duplicate_subarray_ncfile(__pyx_self, __pyx_v_self, __pyx_v_nc_in_dataset, __pyx_v_nc_out_dataset);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_30__duplicate_subarray_ncfile(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_nc_in_dataset, PyObject *__pyx_v_nc_out_dataset) {
  PyObject *__pyx_v_grp_name = NULL;
  PyObject *__pyx_v_grp = NULL;
  PyObject *__pyx_v_new_grp = NULL;
  PyObject *__pyx_v_dim_name = NULL;
  PyObject *__pyx_v_dim = NULL;
  PyObject *__pyx_v_dim_len = NULL;
  PyObject *__pyx_v_var_name = NULL;
  PyObject *__pyx_v_var = NULL;
  PyObject *__pyx_v_new_var = 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;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__duplicate_subarray_ncfile", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":490
 *         # note - assuming there are no groups in the subarray files
 *         # there shouldn't be, as it's not in the CFA 0.5 spec
 *         nc_out_dataset.setncatts(nc_in_dataset.__dict__)             # <<<<<<<<<<<<<<
 * 
 *         # copy the groups first
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_out_dataset, __pyx_n_s_setncatts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_in_dataset, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":493
 * 
 *         # copy the groups first
 *         for grp_name, grp in nc_in_dataset.groups.items():             # <<<<<<<<<<<<<<
 *             new_grp = nc_out_dataset.createGroup(grp_name)
 *             # copy group attributes
 */
  __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_in_dataset, __pyx_n_s_groups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 493, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_dict_iterator(__pyx_t_2, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_3, &__pyx_t_2, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_grp_name, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_grp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":494
 *         # copy the groups first
 *         for grp_name, grp in nc_in_dataset.groups.items():
 *             new_grp = nc_out_dataset.createGroup(grp_name)             # <<<<<<<<<<<<<<
 *             # copy group attributes
 *             new_grp.setncatts(grp.__dict__)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_out_dataset, __pyx_n_s_createGroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_grp_name) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_grp_name);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_grp, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":496
 *             new_grp = nc_out_dataset.createGroup(grp_name)
 *             # copy group attributes
 *             new_grp.setncatts(grp.__dict__)             # <<<<<<<<<<<<<<
 *             # copy dimensions in group
 *             for dim_name, dim in new_grp.dimensions.items():
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_grp, __pyx_n_s_setncatts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":498
 *             new_grp.setncatts(grp.__dict__)
 *             # copy dimensions in group
 *             for dim_name, dim in new_grp.dimensions.items():             # <<<<<<<<<<<<<<
 *                 # get the length of the dimension or unlimited
 *                 if dim.isunlimited():
 */
    __pyx_t_10 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_grp, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__pyx_t_3 == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 498, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_dict_iterator(__pyx_t_3, 0, __pyx_n_s_items, (&__pyx_t_11), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_4 = 0;
    while (1) {
      __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_11, &__pyx_t_10, &__pyx_t_4, &__pyx_t_3, NULL, __pyx_t_8);
      if (unlikely(__pyx_t_12 == 0)) break;
      if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_dim_name, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":500
 *             for dim_name, dim in new_grp.dimensions.items():
 *                 # get the length of the dimension or unlimited
 *                 if dim.isunlimited():             # <<<<<<<<<<<<<<
 *                     dim_len = None
 *                 else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dim, __pyx_n_s_isunlimited); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 500, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_13) {

        /* "S3netCDF4/_s3netCDF4.pyx":501
 *                 # get the length of the dimension or unlimited
 *                 if dim.isunlimited():
 *                     dim_len = None             # <<<<<<<<<<<<<<
 *                 else:
 *                     dim_len = len(dim)
 */
        __Pyx_INCREF(Py_None);
        __Pyx_XDECREF_SET(__pyx_v_dim_len, Py_None);

        /* "S3netCDF4/_s3netCDF4.pyx":500
 *             for dim_name, dim in new_grp.dimensions.items():
 *                 # get the length of the dimension or unlimited
 *                 if dim.isunlimited():             # <<<<<<<<<<<<<<
 *                     dim_len = None
 *                 else:
 */
        goto __pyx_L7;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":503
 *                     dim_len = None
 *                 else:
 *                     dim_len = len(dim)             # <<<<<<<<<<<<<<
 *                 new_grp.createDimension(dim_name, dim_len)
 * 
 */
      /*else*/ {
        __pyx_t_14 = PyObject_Length(__pyx_v_dim); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 503, __pyx_L1_error)
        __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_dim_len, __pyx_t_3);
        __pyx_t_3 = 0;
      }
      __pyx_L7:;

      /* "S3netCDF4/_s3netCDF4.pyx":504
 *                 else:
 *                     dim_len = len(dim)
 *                 new_grp.createDimension(dim_name, dim_len)             # <<<<<<<<<<<<<<
 * 
 *             # copy variables and data
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_grp, __pyx_n_s_createDimension); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_12 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_dim_name, __pyx_v_dim_len};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_dim_name, __pyx_v_dim_len};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_15 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 504, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_INCREF(__pyx_v_dim_name);
        __Pyx_GIVEREF(__pyx_v_dim_name);
        PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_12, __pyx_v_dim_name);
        __Pyx_INCREF(__pyx_v_dim_len);
        __Pyx_GIVEREF(__pyx_v_dim_len);
        PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_12, __pyx_v_dim_len);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      }
      __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;

    /* "S3netCDF4/_s3netCDF4.pyx":507
 * 
 *             # copy variables and data
 *             for var_name, var in new_grp.variables.items():             # <<<<<<<<<<<<<<
 *                 new_var = new_grp.createVariable(
 *                     var_name, var.datatype, var.dimensions
 */
    __pyx_t_11 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_grp, __pyx_n_s_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__pyx_t_3 == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 507, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_dict_iterator(__pyx_t_3, 0, __pyx_n_s_items, (&__pyx_t_10), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_4;
    __pyx_t_4 = 0;
    while (1) {
      __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_10, &__pyx_t_11, &__pyx_t_4, &__pyx_t_3, NULL, __pyx_t_8);
      if (unlikely(__pyx_t_12 == 0)) break;
      if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 507, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_var_name, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":508
 *             # copy variables and data
 *             for var_name, var in new_grp.variables.items():
 *                 new_var = new_grp.createVariable(             # <<<<<<<<<<<<<<
 *                     var_name, var.datatype, var.dimensions
 *                 )
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_grp, __pyx_n_s_createVariable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "S3netCDF4/_s3netCDF4.pyx":509
 *             for var_name, var in new_grp.variables.items():
 *                 new_var = new_grp.createVariable(
 *                     var_name, var.datatype, var.dimensions             # <<<<<<<<<<<<<<
 *                 )
 *                 # copy variable attributes all at once via dictionary
 */
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_datatype); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_16 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_16)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_16);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_12 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_16, __pyx_v_var_name, __pyx_t_15, __pyx_t_9};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_16, __pyx_v_var_name, __pyx_t_15, __pyx_t_9};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 3+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      {
        __pyx_t_17 = PyTuple_New(3+__pyx_t_12); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 508, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_17);
        if (__pyx_t_16) {
          __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __pyx_t_16 = NULL;
        }
        __Pyx_INCREF(__pyx_v_var_name);
        __Pyx_GIVEREF(__pyx_v_var_name);
        PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_12, __pyx_v_var_name);
        __Pyx_GIVEREF(__pyx_t_15);
        PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_12, __pyx_t_15);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_17, 2+__pyx_t_12, __pyx_t_9);
        __pyx_t_15 = 0;
        __pyx_t_9 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_new_var, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":512
 *                 )
 *                 # copy variable attributes all at once via dictionary
 *                 new_var.setncatts(grp[var_name].__dict__)             # <<<<<<<<<<<<<<
 *                 # copy all the data
 *                 new_var[:] = var[:]
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_var, __pyx_n_s_setncatts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_v_grp, __pyx_v_var_name); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_17)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_17);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_17, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9);
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __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;

      /* "S3netCDF4/_s3netCDF4.pyx":514
 *                 new_var.setncatts(grp[var_name].__dict__)
 *                 # copy all the data
 *                 new_var[:] = var[:]             # <<<<<<<<<<<<<<
 * 
 *         # copy dimensions
 */
      __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_var, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_PyObject_SetSlice(__pyx_v_new_var, __pyx_t_3, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1) < 0) __PYX_ERR(0, 514, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":517
 * 
 *         # copy dimensions
 *         for dim_name, dim in nc_in_dataset.dimensions.items():             # <<<<<<<<<<<<<<
 *             # get the length of the dimension or unlimited
 *             if dim.isunlimited():
 */
  __pyx_t_6 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_in_dataset, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 517, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_dict_iterator(__pyx_t_2, 0, __pyx_n_s_items, (&__pyx_t_5), (&__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_6, &__pyx_t_3, &__pyx_t_2, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_dim_name, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":519
 *         for dim_name, dim in nc_in_dataset.dimensions.items():
 *             # get the length of the dimension or unlimited
 *             if dim.isunlimited():             # <<<<<<<<<<<<<<
 *                 dim_len = None
 *             else:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dim, __pyx_n_s_isunlimited); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 519, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "S3netCDF4/_s3netCDF4.pyx":520
 *             # get the length of the dimension or unlimited
 *             if dim.isunlimited():
 *                 dim_len = None             # <<<<<<<<<<<<<<
 *             else:
 *                 dim_len = len(dim)
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_dim_len, Py_None);

      /* "S3netCDF4/_s3netCDF4.pyx":519
 *         for dim_name, dim in nc_in_dataset.dimensions.items():
 *             # get the length of the dimension or unlimited
 *             if dim.isunlimited():             # <<<<<<<<<<<<<<
 *                 dim_len = None
 *             else:
 */
      goto __pyx_L12;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":522
 *                 dim_len = None
 *             else:
 *                 dim_len = len(dim)             # <<<<<<<<<<<<<<
 *             nc_out_dataset.createDimension(dim_name, dim_len)
 * 
 */
    /*else*/ {
      __pyx_t_10 = PyObject_Length(__pyx_v_dim); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 522, __pyx_L1_error)
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_dim_len, __pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L12:;

    /* "S3netCDF4/_s3netCDF4.pyx":523
 *             else:
 *                 dim_len = len(dim)
 *             nc_out_dataset.createDimension(dim_name, dim_len)             # <<<<<<<<<<<<<<
 * 
 *         # copy variables and data
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_out_dataset, __pyx_n_s_createDimension); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_dim_name, __pyx_v_dim_len};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_dim_name, __pyx_v_dim_len};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_dim_name);
      __Pyx_GIVEREF(__pyx_v_dim_name);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_dim_name);
      __Pyx_INCREF(__pyx_v_dim_len);
      __Pyx_GIVEREF(__pyx_v_dim_len);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_dim_len);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":526
 * 
 *         # copy variables and data
 *         for var_name, var in nc_in_dataset.variables.items():             # <<<<<<<<<<<<<<
 *             new_var = nc_out_dataset.createVariable(
 *                 var_name, var.datatype, var.dimensions
 */
  __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_in_dataset, __pyx_n_s_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 526, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_dict_iterator(__pyx_t_2, 0, __pyx_n_s_items, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_3, &__pyx_t_2, NULL, __pyx_t_7);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_var_name, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":527
 *         # copy variables and data
 *         for var_name, var in nc_in_dataset.variables.items():
 *             new_var = nc_out_dataset.createVariable(             # <<<<<<<<<<<<<<
 *                 var_name, var.datatype, var.dimensions
 *             )
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_out_dataset, __pyx_n_s_createVariable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "S3netCDF4/_s3netCDF4.pyx":528
 *         for var_name, var in nc_in_dataset.variables.items():
 *             new_var = nc_out_dataset.createVariable(
 *                 var_name, var.datatype, var.dimensions             # <<<<<<<<<<<<<<
 *             )
 *             # copy variable attributes all at once via dictionary
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_datatype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_17 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_17)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_17);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_17, __pyx_v_var_name, __pyx_t_9, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_17, __pyx_v_var_name, __pyx_t_9, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_15 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (__pyx_t_17) {
        __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_17); __pyx_t_17 = NULL;
      }
      __Pyx_INCREF(__pyx_v_var_name);
      __Pyx_GIVEREF(__pyx_v_var_name);
      PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_8, __pyx_v_var_name);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_8, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_8, __pyx_t_4);
      __pyx_t_9 = 0;
      __pyx_t_4 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_var, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":531
 *             )
 *             # copy variable attributes all at once via dictionary
 *             new_var.setncatts(var.__dict__)             # <<<<<<<<<<<<<<
 *             # copy all the data
 *             new_var[:] = var[:]
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_var, __pyx_n_s_setncatts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_dict); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_15) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_15);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":533
 *             new_var.setncatts(var.__dict__)
 *             # copy all the data
 *             new_var[:] = var[:]             # <<<<<<<<<<<<<<
 *         return nc_out_dataset
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_var, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetSlice(__pyx_v_new_var, __pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1) < 0) __PYX_ERR(0, 533, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":534
 *             # copy all the data
 *             new_var[:] = var[:]
 *         return nc_out_dataset             # <<<<<<<<<<<<<<
 * 
 *     def __create_subarray_ncfile(self, index, in_memory=True, mode="w"):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_nc_out_dataset);
  __pyx_r = __pyx_v_nc_out_dataset;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":482
 *         return nc_sa_dataset
 * 
 *     def __duplicate_subarray_ncfile(self, nc_in_dataset, nc_out_dataset):             # <<<<<<<<<<<<<<
 *         """Copy the contents of one subarray netCDF file into another subarray
 *         netCDF file.
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__duplicate_subarray_ncfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_grp_name);
  __Pyx_XDECREF(__pyx_v_grp);
  __Pyx_XDECREF(__pyx_v_new_grp);
  __Pyx_XDECREF(__pyx_v_dim_name);
  __Pyx_XDECREF(__pyx_v_dim);
  __Pyx_XDECREF(__pyx_v_dim_len);
  __Pyx_XDECREF(__pyx_v_var_name);
  __Pyx_XDECREF(__pyx_v_var);
  __Pyx_XDECREF(__pyx_v_new_var);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":536
 *         return nc_out_dataset
 * 
 *     def __create_subarray_ncfile(self, index, in_memory=True, mode="w"):             # <<<<<<<<<<<<<<
 *         """Create the subarray file, either in memory or on disk."""
 *         nc_sa_dataset = self.__open_subarray_ncfile(
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_33__create_subarray_ncfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_32__create_subarray_ncfile[] = "Create the subarray file, either in memory or on disk.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_33__create_subarray_ncfile = {"__create_subarray_ncfile", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_33__create_subarray_ncfile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_32__create_subarray_ncfile};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_33__create_subarray_ncfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_in_memory = 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_subarray_ncfile (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_index,&__pyx_n_s_in_memory,&__pyx_n_s_mode,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_True));
    values[3] = ((PyObject *)((PyObject*)__pyx_n_u_w));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__create_subarray_ncfile", 0, 2, 4, 1); __PYX_ERR(0, 536, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_in_memory);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__create_subarray_ncfile") < 0)) __PYX_ERR(0, 536, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_index = values[1];
    __pyx_v_in_memory = values[2];
    __pyx_v_mode = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__create_subarray_ncfile", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 536, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__create_subarray_ncfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_32__create_subarray_ncfile(__pyx_self, __pyx_v_self, __pyx_v_index, __pyx_v_in_memory, __pyx_v_mode);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_32__create_subarray_ncfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_in_memory, PyObject *__pyx_v_mode) {
  PyObject *__pyx_v_nc_sa_dataset = NULL;
  PyObject *__pyx_v_cfa_grp = NULL;
  PyObject *__pyx_v_nc_sa_grp = NULL;
  PyObject *__pyx_v_nc_grp = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_dim_name = NULL;
  PyObject *__pyx_v_cfa_dim = NULL;
  PyObject *__pyx_v_dtype = NULL;
  PyObject *__pyx_v_nc_sa_dim_var = NULL;
  PyObject *__pyx_v_nc_sa_fld_var = 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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__create_subarray_ncfile", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":538
 *     def __create_subarray_ncfile(self, index, in_memory=True, mode="w"):
 *         """Create the subarray file, either in memory or on disk."""
 *         nc_sa_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                             index, None, in_memory, mode
 *                         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__open_subarray_ncfil); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "S3netCDF4/_s3netCDF4.pyx":539
 *         """Create the subarray file, either in memory or on disk."""
 *         nc_sa_dataset = self.__open_subarray_ncfile(
 *                             index, None, in_memory, mode             # <<<<<<<<<<<<<<
 *                         )
 *         # create the group if this variable is a member of a group
 */
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_index, Py_None, __pyx_v_in_memory, __pyx_v_mode};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_index, Py_None, __pyx_v_in_memory, __pyx_v_mode};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_index);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, Py_None);
    __Pyx_INCREF(__pyx_v_in_memory);
    __Pyx_GIVEREF(__pyx_v_in_memory);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_in_memory);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_mode);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __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_v_nc_sa_dataset = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":542
 *                         )
 *         # create the group if this variable is a member of a group
 *         cfa_grp = self._cfa_var.getGroup()             # <<<<<<<<<<<<<<
 *         if (cfa_grp is not None and cfa_grp.getName() is not "root"):
 *             nc_sa_grp = nc_sa_dataset.createGroup(cfa_grp.getName())
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getGroup); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_cfa_grp = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":543
 *         # create the group if this variable is a member of a group
 *         cfa_grp = self._cfa_var.getGroup()
 *         if (cfa_grp is not None and cfa_grp.getName() is not "root"):             # <<<<<<<<<<<<<<
 *             nc_sa_grp = nc_sa_dataset.createGroup(cfa_grp.getName())
 *             # set the metadata
 */
  __pyx_t_7 = (__pyx_v_cfa_grp != Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_grp, __pyx_n_s_getName); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = (__pyx_t_1 != __pyx_n_u_root);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (__pyx_t_8 != 0);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_6) {

    /* "S3netCDF4/_s3netCDF4.pyx":544
 *         cfa_grp = self._cfa_var.getGroup()
 *         if (cfa_grp is not None and cfa_grp.getName() is not "root"):
 *             nc_sa_grp = nc_sa_dataset.createGroup(cfa_grp.getName())             # <<<<<<<<<<<<<<
 *             # set the metadata
 *             nc_sa_grp.setncatts(cfa_grp.getMetadata())
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_sa_dataset, __pyx_n_s_createGroup); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_grp, __pyx_n_s_getName); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_nc_sa_grp = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":546
 *             nc_sa_grp = nc_sa_dataset.createGroup(cfa_grp.getName())
 *             # set the metadata
 *             nc_sa_grp.setncatts(cfa_grp.getMetadata())             # <<<<<<<<<<<<<<
 *             nc_grp = self.parent._nc_grp
 *         else:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_sa_grp, __pyx_n_s_setncatts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_grp, __pyx_n_s_getMetadata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":547
 *             # set the metadata
 *             nc_sa_grp.setncatts(cfa_grp.getMetadata())
 *             nc_grp = self.parent._nc_grp             # <<<<<<<<<<<<<<
 *         else:
 *             # otherwise just assign to the dataset to create the dimensions
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_nc_grp = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":543
 *         # create the group if this variable is a member of a group
 *         cfa_grp = self._cfa_var.getGroup()
 *         if (cfa_grp is not None and cfa_grp.getName() is not "root"):             # <<<<<<<<<<<<<<
 *             nc_sa_grp = nc_sa_dataset.createGroup(cfa_grp.getName())
 *             # set the metadata
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":551
 *             # otherwise just assign to the dataset to create the dimensions
 *             # and variables
 *             nc_sa_grp = nc_sa_dataset             # <<<<<<<<<<<<<<
 *             nc_grp = self.parent._nc_dataset
 * 
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_nc_sa_dataset);
    __pyx_v_nc_sa_grp = __pyx_v_nc_sa_dataset;

    /* "S3netCDF4/_s3netCDF4.pyx":552
 *             # and variables
 *             nc_sa_grp = nc_sa_dataset
 *             nc_grp = self.parent._nc_dataset             # <<<<<<<<<<<<<<
 * 
 *         # nc_grp is the input group (from the parent master array file)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_nc_grp = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":558
 *         # create the dimensions - however the size of the dimension is the size
 *         # of the subarray
 *         d = 0             # <<<<<<<<<<<<<<
 *         for dim_name in self._cfa_var.getDimensions():
 *             # it is safe to use an integer to iterate the partition.shape
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_d = __pyx_int_0;

  /* "S3netCDF4/_s3netCDF4.pyx":559
 *         # of the subarray
 *         d = 0
 *         for dim_name in self._cfa_var.getDimensions():             # <<<<<<<<<<<<<<
 *             # it is safe to use an integer to iterate the partition.shape
 *             # array as nc_grp.dimensions is an OrderedDict
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getDimensions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 559, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 559, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 559, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_11(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 559, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_dim_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":562
 *             # it is safe to use an integer to iterate the partition.shape
 *             # array as nc_grp.dimensions is an OrderedDict
 *             nc_sa_grp.createDimension(dim_name, index.partition.shape[d])             # <<<<<<<<<<<<<<
 *             d += 1
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_sa_grp, __pyx_n_s_createDimension); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_dim_name, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_dim_name, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_v_dim_name);
      __Pyx_GIVEREF(__pyx_v_dim_name);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_4, __pyx_v_dim_name);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_4, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":563
 *             # array as nc_grp.dimensions is an OrderedDict
 *             nc_sa_grp.createDimension(dim_name, index.partition.shape[d])
 *             d += 1             # <<<<<<<<<<<<<<
 * 
 *         # write the dimension variables
 */
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_d, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":559
 *         # of the subarray
 *         d = 0
 *         for dim_name in self._cfa_var.getDimensions():             # <<<<<<<<<<<<<<
 *             # it is safe to use an integer to iterate the partition.shape
 *             # array as nc_grp.dimensions is an OrderedDict
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":568
 *         # getDimenions() might return an empty list - this is fine for scalars,
 *         # as it will just skip over the code block
 *         d = 0             # <<<<<<<<<<<<<<
 *         for dim_name in self._cfa_var.getDimensions():
 *             if cfa_grp is not None:
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_DECREF_SET(__pyx_v_d, __pyx_int_0);

  /* "S3netCDF4/_s3netCDF4.pyx":569
 *         # as it will just skip over the code block
 *         d = 0
 *         for dim_name in self._cfa_var.getDimensions():             # <<<<<<<<<<<<<<
 *             if cfa_grp is not None:
 *                 cfa_dim = cfa_grp.getDimension(dim_name)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getDimensions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 569, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 569, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 569, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_11(__pyx_t_5);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 569, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_dim_name, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":570
 *         d = 0
 *         for dim_name in self._cfa_var.getDimensions():
 *             if cfa_grp is not None:             # <<<<<<<<<<<<<<
 *                 cfa_dim = cfa_grp.getDimension(dim_name)
 *                 dtype = cfa_dim.getType()
 */
    __pyx_t_6 = (__pyx_v_cfa_grp != Py_None);
    __pyx_t_7 = (__pyx_t_6 != 0);
    if (__pyx_t_7) {

      /* "S3netCDF4/_s3netCDF4.pyx":571
 *         for dim_name in self._cfa_var.getDimensions():
 *             if cfa_grp is not None:
 *                 cfa_dim = cfa_grp.getDimension(dim_name)             # <<<<<<<<<<<<<<
 *                 dtype = cfa_dim.getType()
 *                 nc_sa_dim_var = nc_sa_grp.createVariable(
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_grp, __pyx_n_s_getDimension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_12, __pyx_v_dim_name) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dim_name);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cfa_dim, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":572
 *             if cfa_grp is not None:
 *                 cfa_dim = cfa_grp.getDimension(dim_name)
 *                 dtype = cfa_dim.getType()             # <<<<<<<<<<<<<<
 *                 nc_sa_dim_var = nc_sa_grp.createVariable(
 *                     dim_name,
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_dim, __pyx_n_s_getType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":573
 *                 cfa_dim = cfa_grp.getDimension(dim_name)
 *                 dtype = cfa_dim.getType()
 *                 nc_sa_dim_var = nc_sa_grp.createVariable(             # <<<<<<<<<<<<<<
 *                     dim_name,
 *                     dtype,
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_sa_grp, __pyx_n_s_createVariable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "S3netCDF4/_s3netCDF4.pyx":576
 *                     dim_name,
 *                     dtype,
 *                     (dim_name,)             # <<<<<<<<<<<<<<
 *                 )
 *                 # add the metadata
 */
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_v_dim_name);
      __Pyx_GIVEREF(__pyx_v_dim_name);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_dim_name);
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_4 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_dim_name, __pyx_v_dtype, __pyx_t_12};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_dim_name, __pyx_v_dtype, __pyx_t_12};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (__pyx_t_3) {
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
        }
        __Pyx_INCREF(__pyx_v_dim_name);
        __Pyx_GIVEREF(__pyx_v_dim_name);
        PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_v_dim_name);
        __Pyx_INCREF(__pyx_v_dtype);
        __Pyx_GIVEREF(__pyx_v_dtype);
        PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_v_dtype);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_4, __pyx_t_12);
        __pyx_t_12 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_nc_sa_dim_var, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":579
 *                 )
 *                 # add the metadata
 *                 nc_sa_dim_var.setncatts(cfa_dim.getMetadata())             # <<<<<<<<<<<<<<
 * 
 *                 # add the dimension variable data - i.e. the domain
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_sa_dim_var, __pyx_n_s_setncatts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_dim, __pyx_n_s_getMetadata); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 579, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 579, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_2 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_12, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __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;

      /* "S3netCDF4/_s3netCDF4.pyx":584
 *                 # this is a subslice of the dimension variable from same named
 *                 # variable in the master array dataset / group
 *                 if (dim_name in nc_grp.variables):             # <<<<<<<<<<<<<<
 *                     nc_sa_dim_var[:] = (nc_grp.variables[dim_name][
 *                   index.partition.location[d][0]:index.partition.location[d][1]
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_grp, __pyx_n_s_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_dim_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 584, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = (__pyx_t_7 != 0);
      if (__pyx_t_6) {

        /* "S3netCDF4/_s3netCDF4.pyx":585
 *                 # variable in the master array dataset / group
 *                 if (dim_name in nc_grp.variables):
 *                     nc_sa_dim_var[:] = (nc_grp.variables[dim_name][             # <<<<<<<<<<<<<<
 *                   index.partition.location[d][0]:index.partition.location[d][1]
 *                   ])
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_grp, __pyx_n_s_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_dim_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":586
 *                 if (dim_name in nc_grp.variables):
 *                     nc_sa_dim_var[:] = (nc_grp.variables[dim_name][
 *                   index.partition.location[d][0]:index.partition.location[d][1]             # <<<<<<<<<<<<<<
 *                   ])
 *                 d += 1
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_location); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_location); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 586, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":585
 *                 # variable in the master array dataset / group
 *                 if (dim_name in nc_grp.variables):
 *                     nc_sa_dim_var[:] = (nc_grp.variables[dim_name][             # <<<<<<<<<<<<<<
 *                   index.partition.location[d][0]:index.partition.location[d][1]
 *                   ])
 */
        __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, &__pyx_t_9, &__pyx_t_12, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (__Pyx_PyObject_SetSlice(__pyx_v_nc_sa_dim_var, __pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1) < 0) __PYX_ERR(0, 585, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":584
 *                 # this is a subslice of the dimension variable from same named
 *                 # variable in the master array dataset / group
 *                 if (dim_name in nc_grp.variables):             # <<<<<<<<<<<<<<
 *                     nc_sa_dim_var[:] = (nc_grp.variables[dim_name][
 *                   index.partition.location[d][0]:index.partition.location[d][1]
 */
      }

      /* "S3netCDF4/_s3netCDF4.pyx":588
 *                   index.partition.location[d][0]:index.partition.location[d][1]
 *                   ])
 *                 d += 1             # <<<<<<<<<<<<<<
 * 
 *         # create the field variable
 */
      __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_d, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":570
 *         d = 0
 *         for dim_name in self._cfa_var.getDimensions():
 *             if cfa_grp is not None:             # <<<<<<<<<<<<<<
 *                 cfa_dim = cfa_grp.getDimension(dim_name)
 *                 dtype = cfa_dim.getType()
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":569
 *         # as it will just skip over the code block
 *         d = 0
 *         for dim_name in self._cfa_var.getDimensions():             # <<<<<<<<<<<<<<
 *             if cfa_grp is not None:
 *                 cfa_dim = cfa_grp.getDimension(dim_name)
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":591
 * 
 *         # create the field variable
 *         nc_sa_fld_var = nc_sa_grp.createVariable(             # <<<<<<<<<<<<<<
 *                             self._cfa_var.getName(),
 *                             self._cfa_var.getType(),
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_sa_grp, __pyx_n_s_createVariable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "S3netCDF4/_s3netCDF4.pyx":592
 *         # create the field variable
 *         nc_sa_fld_var = nc_sa_grp.createVariable(
 *                             self._cfa_var.getName(),             # <<<<<<<<<<<<<<
 *                             self._cfa_var.getType(),
 *                             self._cfa_var.getDimensions()
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_getName); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_12 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":593
 *         nc_sa_fld_var = nc_sa_grp.createVariable(
 *                             self._cfa_var.getName(),
 *                             self._cfa_var.getType(),             # <<<<<<<<<<<<<<
 *                             self._cfa_var.getDimensions()
 *                         )
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_getType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":594
 *                             self._cfa_var.getName(),
 *                             self._cfa_var.getType(),
 *                             self._cfa_var.getDimensions()             # <<<<<<<<<<<<<<
 *                         )
 *         # set the metadata
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_getDimensions); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_13, function);
    }
  }
  __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_13)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_t_12, __pyx_t_1, __pyx_t_3};
    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_t_12, __pyx_t_1, __pyx_t_3};
    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_13) {
      __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_13); __pyx_t_13 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_4, __pyx_t_3);
    __pyx_t_12 = 0;
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __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_v_nc_sa_fld_var = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":597
 *                         )
 *         # set the metadata
 *         nc_sa_fld_var.setncatts(self._cfa_var.getMetadata())             # <<<<<<<<<<<<<<
 * 
 *         # finished creating the file - can now write some data into it
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_sa_fld_var, __pyx_n_s_setncatts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getMetadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":601
 *         # finished creating the file - can now write some data into it
 *         # this will be done in __setitem__ but we need the nc_var to do it
 *         return nc_sa_dataset             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, elem, data):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_nc_sa_dataset);
  __pyx_r = __pyx_v_nc_sa_dataset;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":536
 *         return nc_out_dataset
 * 
 *     def __create_subarray_ncfile(self, index, in_memory=True, mode="w"):             # <<<<<<<<<<<<<<
 *         """Create the subarray file, either in memory or on disk."""
 *         nc_sa_dataset = self.__open_subarray_ncfile(
 */

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__create_subarray_ncfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nc_sa_dataset);
  __Pyx_XDECREF(__pyx_v_cfa_grp);
  __Pyx_XDECREF(__pyx_v_nc_sa_grp);
  __Pyx_XDECREF(__pyx_v_nc_grp);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_dim_name);
  __Pyx_XDECREF(__pyx_v_cfa_dim);
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XDECREF(__pyx_v_nc_sa_dim_var);
  __Pyx_XDECREF(__pyx_v_nc_sa_fld_var);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":603
 *         return nc_sa_dataset
 * 
 *     def __setitem__(self, elem, data):             # <<<<<<<<<<<<<<
 *         """Override the netCDF4.Variable __setitem__ method to assign data to
 *         the correct subarray file.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_35__setitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_34__setitem__[] = "Override the netCDF4.Variable __setitem__ method to assign data to\n        the correct subarray file.\n        The CFAVariable class has a method which will determine:\n            1. The path of the subarray file(s)\n            2. The slice in the subarray(s) to write into\n            3. The slice from the input data to read from, when transferring\n            data from the input data to the subarray\n        ";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_35__setitem__ = {"__setitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_35__setitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_34__setitem__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_35__setitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_elem = 0;
  PyObject *__pyx_v_data = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_elem,&__pyx_n_s_data,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elem)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 603, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 603, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setitem__") < 0)) __PYX_ERR(0, 603, __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_self = values[0];
    __pyx_v_elem = values[1];
    __pyx_v_data = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 603, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_34__setitem__(__pyx_self, __pyx_v_self, __pyx_v_elem, __pyx_v_data);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_34__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elem, PyObject *__pyx_v_data) {
  PyObject *__pyx_v_index_list = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_open_state = NULL;
  PyObject *__pyx_v_orig_mode = NULL;
  PyObject *__pyx_v_open_mode = NULL;
  PyObject *__pyx_v_request_object = NULL;
  PyObject *__pyx_v_nc_sa_dataset = NULL;
  PyObject *__pyx_v_nc_in_dataset = NULL;
  PyObject *__pyx_v_cfa_grp = NULL;
  PyObject *__pyx_v_nc_sa_grp = NULL;
  PyObject *__pyx_v_nc_sa_fld_var = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":612
 *             data from the input data to the subarray
 *         """
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             # get the above details from the CFA variable, details are returned as:
 *             # (filename, varname, source_slice, target_slice)
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 612, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":615
 *             # get the above details from the CFA variable, details are returned as:
 *             # (filename, varname, source_slice, target_slice)
 *             index_list = self._cfa_var[elem]             # <<<<<<<<<<<<<<
 *             for index in index_list:
 *                 size = (np.prod(index.partition.shape) *
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_elem); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_index_list = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":616
 *             # (filename, varname, source_slice, target_slice)
 *             index_list = self._cfa_var[elem]
 *             for index in index_list:             # <<<<<<<<<<<<<<
 *                 size = (np.prod(index.partition.shape) *
 *                         self._cfa_var.getType().itemsize)
 */
    if (likely(PyList_CheckExact(__pyx_v_index_list)) || PyTuple_CheckExact(__pyx_v_index_list)) {
      __pyx_t_5 = __pyx_v_index_list; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_index_list); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 616, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 616, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 616, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 616, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":617
 *             index_list = self._cfa_var[elem]
 *             for index in index_list:
 *                 size = (np.prod(index.partition.shape) *             # <<<<<<<<<<<<<<
 *                         self._cfa_var.getType().itemsize)
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_prod); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_shape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && 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);
        }
      }
      __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":618
 *             for index in index_list:
 *                 size = (np.prod(index.partition.shape) *
 *                         self._cfa_var.getType().itemsize)             # <<<<<<<<<<<<<<
 * 
 *                 # get the state of the request object from the manager
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_getType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":617
 *             index_list = self._cfa_var[elem]
 *             for index in index_list:
 *                 size = (np.prod(index.partition.shape) *             # <<<<<<<<<<<<<<
 *                         self._cfa_var.getType().itemsize)
 * 
 */
      __pyx_t_9 = PyNumber_Multiply(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_size, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":621
 * 
 *                 # get the state of the request object from the manager
 *                 open_state, orig_mode = self.file_manager.get_file_open_state(             # <<<<<<<<<<<<<<
 *                                 url = index.partition.file
 *                             )
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_get_file_open_state); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":622
 *                 # get the state of the request object from the manager
 *                 open_state, orig_mode = self.file_manager.get_file_open_state(
 *                                 url = index.partition.file             # <<<<<<<<<<<<<<
 *                             )
 *                 # if the state is KNOWN_EXISTS_ON_STORAGE we want to read the
 */
      __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_url, __pyx_t_10) < 0) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":621
 * 
 *                 # get the state of the request object from the manager
 *                 open_state, orig_mode = self.file_manager.get_file_open_state(             # <<<<<<<<<<<<<<
 *                                 url = index.partition.file
 *                             )
 */
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
        PyObject* sequence = __pyx_t_10;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 621, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_8);
        #else
        __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_4 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext;
        index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_4), 2) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 621, __pyx_L1_error)
        __pyx_L9_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_open_state, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_orig_mode, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":629
 *                 # if the state is OPEN_EXISTS_IN_MEMORY but it is in read mode
 *                 # then we want to do the same, read the file, duplicate, write
 *                 if (open_state == OpenFileRecord.KNOWN_EXISTS_ON_STORAGE or             # <<<<<<<<<<<<<<
 *                     (open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY and
 *                      orig_mode == "r")):
 */
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_KNOWN_EXISTS_ON_STORAGE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_RichCompare(__pyx_v_open_state, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 629, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (!__pyx_t_3) {
      } else {
        __pyx_t_1 = __pyx_t_3;
        goto __pyx_L11_bool_binop_done;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":630
 *                 # then we want to do the same, read the file, duplicate, write
 *                 if (open_state == OpenFileRecord.KNOWN_EXISTS_ON_STORAGE or
 *                     (open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY and             # <<<<<<<<<<<<<<
 *                      orig_mode == "r")):
 *                     open_mode = "r"
 */
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 630, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_OPEN_EXISTS_IN_MEMORY); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_RichCompare(__pyx_v_open_state, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 630, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 630, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_3) {
      } else {
        __pyx_t_1 = __pyx_t_3;
        goto __pyx_L11_bool_binop_done;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":631
 *                 if (open_state == OpenFileRecord.KNOWN_EXISTS_ON_STORAGE or
 *                     (open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY and
 *                      orig_mode == "r")):             # <<<<<<<<<<<<<<
 *                     open_mode = "r"
 *                 else:
 */
      __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_orig_mode, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 631, __pyx_L1_error)
      __pyx_t_1 = __pyx_t_3;
      __pyx_L11_bool_binop_done:;

      /* "S3netCDF4/_s3netCDF4.pyx":629
 *                 # if the state is OPEN_EXISTS_IN_MEMORY but it is in read mode
 *                 # then we want to do the same, read the file, duplicate, write
 *                 if (open_state == OpenFileRecord.KNOWN_EXISTS_ON_STORAGE or             # <<<<<<<<<<<<<<
 *                     (open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY and
 *                      orig_mode == "r")):
 */
      if (__pyx_t_1) {

        /* "S3netCDF4/_s3netCDF4.pyx":632
 *                     (open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY and
 *                      orig_mode == "r")):
 *                     open_mode = "r"             # <<<<<<<<<<<<<<
 *                 else:
 *                     open_mode = "w"
 */
        __Pyx_INCREF(__pyx_n_u_r);
        __Pyx_XDECREF_SET(__pyx_v_open_mode, __pyx_n_u_r);

        /* "S3netCDF4/_s3netCDF4.pyx":629
 *                 # if the state is OPEN_EXISTS_IN_MEMORY but it is in read mode
 *                 # then we want to do the same, read the file, duplicate, write
 *                 if (open_state == OpenFileRecord.KNOWN_EXISTS_ON_STORAGE or             # <<<<<<<<<<<<<<
 *                     (open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY and
 *                      orig_mode == "r")):
 */
        goto __pyx_L10;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":634
 *                     open_mode = "r"
 *                 else:
 *                     open_mode = "w"             # <<<<<<<<<<<<<<
 *                 # request the file from the filemanager
 *                 request_object = self.file_manager.request_file(
 */
      /*else*/ {
        __Pyx_INCREF(__pyx_n_u_w);
        __Pyx_XDECREF_SET(__pyx_v_open_mode, __pyx_n_u_w);
      }
      __pyx_L10:;

      /* "S3netCDF4/_s3netCDF4.pyx":636
 *                     open_mode = "w"
 *                 # request the file from the filemanager
 *                 request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                     index.partition.file, size,
 *                                     mode=open_mode
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_request_file); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":637
 *                 # request the file from the filemanager
 *                 request_object = self.file_manager.request_file(
 *                                     index.partition.file, size,             # <<<<<<<<<<<<<<
 *                                     mode=open_mode
 *                                 )
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 637, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_file); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 637, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":636
 *                     open_mode = "w"
 *                 # request the file from the filemanager
 *                 request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                     index.partition.file, size,
 *                                     mode=open_mode
 */
      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
      __Pyx_INCREF(__pyx_v_size);
      __Pyx_GIVEREF(__pyx_v_size);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_size);
      __pyx_t_9 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":638
 *                 request_object = self.file_manager.request_file(
 *                                     index.partition.file, size,
 *                                     mode=open_mode             # <<<<<<<<<<<<<<
 *                                 )
 *                 # re-get the open state as it can be altered by the request_file
 */
      __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 638, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_mode, __pyx_v_open_mode) < 0) __PYX_ERR(0, 638, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":636
 *                     open_mode = "w"
 *                 # request the file from the filemanager
 *                 request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                     index.partition.file, size,
 *                                     mode=open_mode
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_request_object, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":642
 *                 # re-get the open state as it can be altered by the request_file
 *                 # method
 *                 open_state = request_object.open_state             # <<<<<<<<<<<<<<
 *                 if (open_state == OpenFileRecord.OPEN_NEW_IN_MEMORY):
 *                     # create a netCDF file in memory if it has not been created
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_open_state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 642, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_open_state, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":643
 *                 # method
 *                 open_state = request_object.open_state
 *                 if (open_state == OpenFileRecord.OPEN_NEW_IN_MEMORY):             # <<<<<<<<<<<<<<
 *                     # create a netCDF file in memory if it has not been created
 *                     # previously
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OPEN_NEW_IN_MEMORY); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_open_state, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_1) {

        /* "S3netCDF4/_s3netCDF4.pyx":646
 *                     # create a netCDF file in memory if it has not been created
 *                     # previously
 *                     nc_sa_dataset = self.__create_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                         index, in_memory=True, mode=request_object.open_mode
 *                     )
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__create_subarray_ncf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);

        /* "S3netCDF4/_s3netCDF4.pyx":647
 *                     # previously
 *                     nc_sa_dataset = self.__create_subarray_ncfile(
 *                         index, in_memory=True, mode=request_object.open_mode             # <<<<<<<<<<<<<<
 *                     )
 *                     # attach to the request_object (OpenFileRecord)
 */
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 646, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_v_index);
        __Pyx_GIVEREF(__pyx_v_index);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_index);
        __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 647, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_in_memory, Py_True) < 0) __PYX_ERR(0, 647, __pyx_L1_error)
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_open_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 647, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_mode, __pyx_t_8) < 0) __PYX_ERR(0, 647, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":646
 *                     # create a netCDF file in memory if it has not been created
 *                     # previously
 *                     nc_sa_dataset = self.__create_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                         index, in_memory=True, mode=request_object.open_mode
 *                     )
 */
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 646, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF_SET(__pyx_v_nc_sa_dataset, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":650
 *                     )
 *                     # attach to the request_object (OpenFileRecord)
 *                     request_object.data_object = nc_sa_dataset             # <<<<<<<<<<<<<<
 *                     # write the partition information to the master array var
 *                     self._cfa_var.writePartition(index.partition)
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_request_object, __pyx_n_s_data_object, __pyx_v_nc_sa_dataset) < 0) __PYX_ERR(0, 650, __pyx_L1_error)

        /* "S3netCDF4/_s3netCDF4.pyx":652
 *                     request_object.data_object = nc_sa_dataset
 *                     # write the partition information to the master array var
 *                     self._cfa_var.writePartition(index.partition)             # <<<<<<<<<<<<<<
 *                 elif (open_state == OpenFileRecord.OPEN_NEW_ON_DISK):
 *                     nc_sa_dataset = self.__create_subarray_ncfile(
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 652, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_writePartition); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 652, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 652, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_4, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 652, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":643
 *                 # method
 *                 open_state = request_object.open_state
 *                 if (open_state == OpenFileRecord.OPEN_NEW_IN_MEMORY):             # <<<<<<<<<<<<<<
 *                     # create a netCDF file in memory if it has not been created
 *                     # previously
 */
        goto __pyx_L14;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":653
 *                     # write the partition information to the master array var
 *                     self._cfa_var.writePartition(index.partition)
 *                 elif (open_state == OpenFileRecord.OPEN_NEW_ON_DISK):             # <<<<<<<<<<<<<<
 *                     nc_sa_dataset = self.__create_subarray_ncfile(
 *                         index, in_memory=False, mode=request_object.open_mode
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_OPEN_NEW_ON_DISK); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_RichCompare(__pyx_v_open_state, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 653, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 653, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_1) {

        /* "S3netCDF4/_s3netCDF4.pyx":654
 *                     self._cfa_var.writePartition(index.partition)
 *                 elif (open_state == OpenFileRecord.OPEN_NEW_ON_DISK):
 *                     nc_sa_dataset = self.__create_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                         index, in_memory=False, mode=request_object.open_mode
 *                     )
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__create_subarray_ncf); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);

        /* "S3netCDF4/_s3netCDF4.pyx":655
 *                 elif (open_state == OpenFileRecord.OPEN_NEW_ON_DISK):
 *                     nc_sa_dataset = self.__create_subarray_ncfile(
 *                         index, in_memory=False, mode=request_object.open_mode             # <<<<<<<<<<<<<<
 *                     )
 *                     request_object.data_object = nc_sa_dataset
 */
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 654, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_v_index);
        __Pyx_GIVEREF(__pyx_v_index);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_index);
        __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 655, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_in_memory, Py_False) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_open_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_mode, __pyx_t_4) < 0) __PYX_ERR(0, 655, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":654
 *                     self._cfa_var.writePartition(index.partition)
 *                 elif (open_state == OpenFileRecord.OPEN_NEW_ON_DISK):
 *                     nc_sa_dataset = self.__create_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                         index, in_memory=False, mode=request_object.open_mode
 *                     )
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF_SET(__pyx_v_nc_sa_dataset, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":657
 *                         index, in_memory=False, mode=request_object.open_mode
 *                     )
 *                     request_object.data_object = nc_sa_dataset             # <<<<<<<<<<<<<<
 *                     # close the file object if not a remote system as we don't
 *                     # need it - the data_object is in effect the file object
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_request_object, __pyx_n_s_data_object, __pyx_v_nc_sa_dataset) < 0) __PYX_ERR(0, 657, __pyx_L1_error)

        /* "S3netCDF4/_s3netCDF4.pyx":660
 *                     # close the file object if not a remote system as we don't
 *                     # need it - the data_object is in effect the file object
 *                     request_object.file_object.close()             # <<<<<<<<<<<<<<
 *                     # write the partition information to the master array
 *                     self._cfa_var.writePartition(index.partition)
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_file_object); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 660, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_close); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 660, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":662
 *                     request_object.file_object.close()
 *                     # write the partition information to the master array
 *                     self._cfa_var.writePartition(index.partition)             # <<<<<<<<<<<<<<
 *                 # if it has been created before then use the previously created
 *                 # file
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_writePartition); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":653
 *                     # write the partition information to the master array var
 *                     self._cfa_var.writePartition(index.partition)
 *                 elif (open_state == OpenFileRecord.OPEN_NEW_ON_DISK):             # <<<<<<<<<<<<<<
 *                     nc_sa_dataset = self.__create_subarray_ncfile(
 *                         index, in_memory=False, mode=request_object.open_mode
 */
        goto __pyx_L14;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":665
 *                 # if it has been created before then use the previously created
 *                 # file
 *                 elif (open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY):             # <<<<<<<<<<<<<<
 *                     # get the already opened dataset from the request_object
 *                     # this will be a Dataset in memory
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OPEN_EXISTS_IN_MEMORY); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 665, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_open_state, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 665, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_1) {

        /* "S3netCDF4/_s3netCDF4.pyx":671
 *                     # it and write it back to another dataset and file object
 *                     # in write mode.  Just like KNOWN_EXISTS_ON_STORAGE below
 *                     if orig_mode == "r":             # <<<<<<<<<<<<<<
 *                         nc_in_dataset = self.__open_subarray_ncfile(
 *                             index, request_object, in_memory=True, mode="r"
 */
        __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_orig_mode, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 671, __pyx_L1_error)
        if (__pyx_t_1) {

          /* "S3netCDF4/_s3netCDF4.pyx":672
 *                     # in write mode.  Just like KNOWN_EXISTS_ON_STORAGE below
 *                     if orig_mode == "r":
 *                         nc_in_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                             index, request_object, in_memory=True, mode="r"
 *                         )
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__open_subarray_ncfil); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 672, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);

          /* "S3netCDF4/_s3netCDF4.pyx":673
 *                     if orig_mode == "r":
 *                         nc_in_dataset = self.__open_subarray_ncfile(
 *                             index, request_object, in_memory=True, mode="r"             # <<<<<<<<<<<<<<
 *                         )
 *                         # re-open the file in write mode, this will close and
 */
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 672, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_v_index);
          __Pyx_GIVEREF(__pyx_v_index);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_index);
          __Pyx_INCREF(__pyx_v_request_object);
          __Pyx_GIVEREF(__pyx_v_request_object);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_request_object);
          __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 673, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_in_memory, Py_True) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
          if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 673, __pyx_L1_error)

          /* "S3netCDF4/_s3netCDF4.pyx":672
 *                     # in write mode.  Just like KNOWN_EXISTS_ON_STORAGE below
 *                     if orig_mode == "r":
 *                         nc_in_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                             index, request_object, in_memory=True, mode="r"
 *                         )
 */
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 672, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF_SET(__pyx_v_nc_in_dataset, __pyx_t_8);
          __pyx_t_8 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":677
 *                         # re-open the file in write mode, this will close and
 *                         # reopen the file (which is currently in read mode)
 *                         request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                             index.partition.file, size, mode="w"
 *                                         )
 */
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 677, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_request_file); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 677, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":678
 *                         # reopen the file (which is currently in read mode)
 *                         request_object = self.file_manager.request_file(
 *                                             index.partition.file, size, mode="w"             # <<<<<<<<<<<<<<
 *                                         )
 *                         nc_sa_dataset = self.__open_subarray_ncfile(
 */
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 678, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_file); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 678, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":677
 *                         # re-open the file in write mode, this will close and
 *                         # reopen the file (which is currently in read mode)
 *                         request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                             index.partition.file, size, mode="w"
 *                                         )
 */
          __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 677, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_10);
          PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
          __Pyx_INCREF(__pyx_v_size);
          __Pyx_GIVEREF(__pyx_v_size);
          PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_size);
          __pyx_t_10 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":678
 *                         # reopen the file (which is currently in read mode)
 *                         request_object = self.file_manager.request_file(
 *                                             index.partition.file, size, mode="w"             # <<<<<<<<<<<<<<
 *                                         )
 *                         nc_sa_dataset = self.__open_subarray_ncfile(
 */
          __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 678, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_mode, __pyx_n_u_w) < 0) __PYX_ERR(0, 678, __pyx_L1_error)

          /* "S3netCDF4/_s3netCDF4.pyx":677
 *                         # re-open the file in write mode, this will close and
 *                         # reopen the file (which is currently in read mode)
 *                         request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                             index.partition.file, size, mode="w"
 *                                         )
 */
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF_SET(__pyx_v_request_object, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":680
 *                                             index.partition.file, size, mode="w"
 *                                         )
 *                         nc_sa_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                             index, request_object, in_memory=True, mode="w"
 *                         )
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__open_subarray_ncfil); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);

          /* "S3netCDF4/_s3netCDF4.pyx":681
 *                                         )
 *                         nc_sa_dataset = self.__open_subarray_ncfile(
 *                             index, request_object, in_memory=True, mode="w"             # <<<<<<<<<<<<<<
 *                         )
 *                         # duplicate the data
 */
          __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 680, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_v_index);
          __Pyx_GIVEREF(__pyx_v_index);
          PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_index);
          __Pyx_INCREF(__pyx_v_request_object);
          __Pyx_GIVEREF(__pyx_v_request_object);
          PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_request_object);
          __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 681, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_in_memory, Py_True) < 0) __PYX_ERR(0, 681, __pyx_L1_error)
          if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_mode, __pyx_n_u_w) < 0) __PYX_ERR(0, 681, __pyx_L1_error)

          /* "S3netCDF4/_s3netCDF4.pyx":680
 *                                             index.partition.file, size, mode="w"
 *                                         )
 *                         nc_sa_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                             index, request_object, in_memory=True, mode="w"
 *                         )
 */
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 680, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_nc_sa_dataset, __pyx_t_9);
          __pyx_t_9 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":684
 *                         )
 *                         # duplicate the data
 *                         self.__duplicate_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                             nc_in_dataset, nc_sa_dataset
 *                         )
 */
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__duplicate_subarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 684, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);

          /* "S3netCDF4/_s3netCDF4.pyx":685
 *                         # duplicate the data
 *                         self.__duplicate_subarray_ncfile(
 *                             nc_in_dataset, nc_sa_dataset             # <<<<<<<<<<<<<<
 *                         )
 *                         # attach to the request_object (OpenFileRecord)
 */
          __pyx_t_10 = NULL;
          __pyx_t_12 = 0;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
            if (likely(__pyx_t_10)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_10);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_8, function);
              __pyx_t_12 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_nc_in_dataset, __pyx_v_nc_sa_dataset};
            __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 684, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
            PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_nc_in_dataset, __pyx_v_nc_sa_dataset};
            __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 684, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_9);
          } else
          #endif
          {
            __pyx_t_4 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            if (__pyx_t_10) {
              __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __pyx_t_10 = NULL;
            }
            __Pyx_INCREF(__pyx_v_nc_in_dataset);
            __Pyx_GIVEREF(__pyx_v_nc_in_dataset);
            PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_12, __pyx_v_nc_in_dataset);
            __Pyx_INCREF(__pyx_v_nc_sa_dataset);
            __Pyx_GIVEREF(__pyx_v_nc_sa_dataset);
            PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_12, __pyx_v_nc_sa_dataset);
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 684, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":688
 *                         )
 *                         # attach to the request_object (OpenFileRecord)
 *                         request_object.data_object = nc_sa_dataset             # <<<<<<<<<<<<<<
 *                     else:
 *                         nc_sa_dataset = request_object.data_object
 */
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_request_object, __pyx_n_s_data_object, __pyx_v_nc_sa_dataset) < 0) __PYX_ERR(0, 688, __pyx_L1_error)

          /* "S3netCDF4/_s3netCDF4.pyx":671
 *                     # it and write it back to another dataset and file object
 *                     # in write mode.  Just like KNOWN_EXISTS_ON_STORAGE below
 *                     if orig_mode == "r":             # <<<<<<<<<<<<<<
 *                         nc_in_dataset = self.__open_subarray_ncfile(
 *                             index, request_object, in_memory=True, mode="r"
 */
          goto __pyx_L15;
        }

        /* "S3netCDF4/_s3netCDF4.pyx":690
 *                         request_object.data_object = nc_sa_dataset
 *                     else:
 *                         nc_sa_dataset = request_object.data_object             # <<<<<<<<<<<<<<
 * 
 *                 elif (open_state == OpenFileRecord.OPEN_EXISTS_ON_DISK):
 */
        /*else*/ {
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_data_object); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 690, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_XDECREF_SET(__pyx_v_nc_sa_dataset, __pyx_t_9);
          __pyx_t_9 = 0;
        }
        __pyx_L15:;

        /* "S3netCDF4/_s3netCDF4.pyx":665
 *                 # if it has been created before then use the previously created
 *                 # file
 *                 elif (open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY):             # <<<<<<<<<<<<<<
 *                     # get the already opened dataset from the request_object
 *                     # this will be a Dataset in memory
 */
        goto __pyx_L14;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":692
 *                         nc_sa_dataset = request_object.data_object
 * 
 *                 elif (open_state == OpenFileRecord.OPEN_EXISTS_ON_DISK):             # <<<<<<<<<<<<<<
 *                     # get the already opened dataset from the request_object
 *                     # this will be a Dataset on disk
 */
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_OPEN_EXISTS_ON_DISK); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_RichCompare(__pyx_v_open_state, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_1) {

        /* "S3netCDF4/_s3netCDF4.pyx":695
 *                     # get the already opened dataset from the request_object
 *                     # this will be a Dataset on disk
 *                     nc_sa_dataset = request_object.data_object             # <<<<<<<<<<<<<<
 * 
 *                 # if it has been created then shuffled off to storage or disk
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_data_object); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 695, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_nc_sa_dataset, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":692
 *                         nc_sa_dataset = request_object.data_object
 * 
 *                 elif (open_state == OpenFileRecord.OPEN_EXISTS_ON_DISK):             # <<<<<<<<<<<<<<
 *                     # get the already opened dataset from the request_object
 *                     # this will be a Dataset on disk
 */
        goto __pyx_L14;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":699
 *                 # if it has been created then shuffled off to storage or disk
 *                 # before then open in append mode
 *                 elif (open_state == OpenFileRecord.KNOWN_EXISTS_ON_STORAGE):             # <<<<<<<<<<<<<<
 *                     # A special case for files already known on storage:
 *                     # 1. Open the file in read mode, read the dataset into
 */
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_KNOWN_EXISTS_ON_STORAGE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_RichCompare(__pyx_v_open_state, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 699, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 699, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_1) {

        /* "S3netCDF4/_s3netCDF4.pyx":708
 *                     #    write dataset
 *                     # 5. Return the write dataset
 *                     nc_in_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                         index, request_object, in_memory=True, mode="r"
 *                     )
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__open_subarray_ncfil); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 708, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);

        /* "S3netCDF4/_s3netCDF4.pyx":709
 *                     # 5. Return the write dataset
 *                     nc_in_dataset = self.__open_subarray_ncfile(
 *                         index, request_object, in_memory=True, mode="r"             # <<<<<<<<<<<<<<
 *                     )
 *                     # re-open the file in write mode, this will close and reopen
 */
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 708, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_index);
        __Pyx_GIVEREF(__pyx_v_index);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_index);
        __Pyx_INCREF(__pyx_v_request_object);
        __Pyx_GIVEREF(__pyx_v_request_object);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_request_object);
        __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_in_memory, Py_True) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 709, __pyx_L1_error)

        /* "S3netCDF4/_s3netCDF4.pyx":708
 *                     #    write dataset
 *                     # 5. Return the write dataset
 *                     nc_in_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                         index, request_object, in_memory=True, mode="r"
 *                     )
 */
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 708, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_nc_in_dataset, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":713
 *                     # re-open the file in write mode, this will close and reopen
 *                     # the file (which is currently in read mode)
 *                     request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                         index.partition.file, size, mode="w"
 *                                     )
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 713, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_request_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":714
 *                     # the file (which is currently in read mode)
 *                     request_object = self.file_manager.request_file(
 *                                         index.partition.file, size, mode="w"             # <<<<<<<<<<<<<<
 *                                     )
 *                     nc_sa_dataset = self.__open_subarray_ncfile(
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_file); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":713
 *                     # re-open the file in write mode, this will close and reopen
 *                     # the file (which is currently in read mode)
 *                     request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                         index.partition.file, size, mode="w"
 *                                     )
 */
        __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 713, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8);
        __Pyx_INCREF(__pyx_v_size);
        __Pyx_GIVEREF(__pyx_v_size);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_size);
        __pyx_t_8 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":714
 *                     # the file (which is currently in read mode)
 *                     request_object = self.file_manager.request_file(
 *                                         index.partition.file, size, mode="w"             # <<<<<<<<<<<<<<
 *                                     )
 *                     nc_sa_dataset = self.__open_subarray_ncfile(
 */
        __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 714, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_mode, __pyx_n_u_w) < 0) __PYX_ERR(0, 714, __pyx_L1_error)

        /* "S3netCDF4/_s3netCDF4.pyx":713
 *                     # re-open the file in write mode, this will close and reopen
 *                     # the file (which is currently in read mode)
 *                     request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                         index.partition.file, size, mode="w"
 *                                     )
 */
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 713, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF_SET(__pyx_v_request_object, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":716
 *                                         index.partition.file, size, mode="w"
 *                                     )
 *                     nc_sa_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                         index, request_object, in_memory=True, mode="w"
 *                     )
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__open_subarray_ncfil); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 716, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);

        /* "S3netCDF4/_s3netCDF4.pyx":717
 *                                     )
 *                     nc_sa_dataset = self.__open_subarray_ncfile(
 *                         index, request_object, in_memory=True, mode="w"             # <<<<<<<<<<<<<<
 *                     )
 *                     # duplicate the data
 */
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 716, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_index);
        __Pyx_GIVEREF(__pyx_v_index);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_index);
        __Pyx_INCREF(__pyx_v_request_object);
        __Pyx_GIVEREF(__pyx_v_request_object);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_request_object);
        __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 717, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_in_memory, Py_True) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_mode, __pyx_n_u_w) < 0) __PYX_ERR(0, 717, __pyx_L1_error)

        /* "S3netCDF4/_s3netCDF4.pyx":716
 *                                         index.partition.file, size, mode="w"
 *                                     )
 *                     nc_sa_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                         index, request_object, in_memory=True, mode="w"
 *                     )
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF_SET(__pyx_v_nc_sa_dataset, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":720
 *                     )
 *                     # duplicate the data
 *                     self.__duplicate_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                         nc_in_dataset, nc_sa_dataset
 *                     )
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__duplicate_subarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 720, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);

        /* "S3netCDF4/_s3netCDF4.pyx":721
 *                     # duplicate the data
 *                     self.__duplicate_subarray_ncfile(
 *                         nc_in_dataset, nc_sa_dataset             # <<<<<<<<<<<<<<
 *                     )
 *                     # attach to the request_object (OpenFileRecord)
 */
        __pyx_t_8 = NULL;
        __pyx_t_12 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_12 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_10)) {
          PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_nc_in_dataset, __pyx_v_nc_sa_dataset};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
          PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_nc_in_dataset, __pyx_v_nc_sa_dataset};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        {
          __pyx_t_9 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 720, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (__pyx_t_8) {
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
          }
          __Pyx_INCREF(__pyx_v_nc_in_dataset);
          __Pyx_GIVEREF(__pyx_v_nc_in_dataset);
          PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_12, __pyx_v_nc_in_dataset);
          __Pyx_INCREF(__pyx_v_nc_sa_dataset);
          __Pyx_GIVEREF(__pyx_v_nc_sa_dataset);
          PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_12, __pyx_v_nc_sa_dataset);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":724
 *                     )
 *                     # attach to the request_object (OpenFileRecord)
 *                     request_object.data_object = nc_sa_dataset             # <<<<<<<<<<<<<<
 * 
 *                 elif (open_state == OpenFileRecord.KNOWN_EXISTS_ON_DISK):
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_request_object, __pyx_n_s_data_object, __pyx_v_nc_sa_dataset) < 0) __PYX_ERR(0, 724, __pyx_L1_error)

        /* "S3netCDF4/_s3netCDF4.pyx":699
 *                 # if it has been created then shuffled off to storage or disk
 *                 # before then open in append mode
 *                 elif (open_state == OpenFileRecord.KNOWN_EXISTS_ON_STORAGE):             # <<<<<<<<<<<<<<
 *                     # A special case for files already known on storage:
 *                     # 1. Open the file in read mode, read the dataset into
 */
        goto __pyx_L14;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":726
 *                     request_object.data_object = nc_sa_dataset
 * 
 *                 elif (open_state == OpenFileRecord.KNOWN_EXISTS_ON_DISK):             # <<<<<<<<<<<<<<
 *                     # open in append mode for files already known on disk
 *                     nc_sa_dataset = self.__open_subarray_ncfile(
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_KNOWN_EXISTS_ON_DISK); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 726, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_open_state, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 726, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_1) {

        /* "S3netCDF4/_s3netCDF4.pyx":728
 *                 elif (open_state == OpenFileRecord.KNOWN_EXISTS_ON_DISK):
 *                     # open in append mode for files already known on disk
 *                     nc_sa_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                         index, request_object, in_memory=False,
 *                         mode=request_object.open_mode
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__open_subarray_ncfil); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);

        /* "S3netCDF4/_s3netCDF4.pyx":729
 *                     # open in append mode for files already known on disk
 *                     nc_sa_dataset = self.__open_subarray_ncfile(
 *                         index, request_object, in_memory=False,             # <<<<<<<<<<<<<<
 *                         mode=request_object.open_mode
 *                     )
 */
        __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 728, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_index);
        __Pyx_GIVEREF(__pyx_v_index);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_index);
        __Pyx_INCREF(__pyx_v_request_object);
        __Pyx_GIVEREF(__pyx_v_request_object);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_request_object);
        __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 729, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_in_memory, Py_False) < 0) __PYX_ERR(0, 729, __pyx_L1_error)

        /* "S3netCDF4/_s3netCDF4.pyx":730
 *                     nc_sa_dataset = self.__open_subarray_ncfile(
 *                         index, request_object, in_memory=False,
 *                         mode=request_object.open_mode             # <<<<<<<<<<<<<<
 *                     )
 *                     request_object.data_object = nc_sa_dataset
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_open_mode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 730, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_mode, __pyx_t_8) < 0) __PYX_ERR(0, 729, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":728
 *                 elif (open_state == OpenFileRecord.KNOWN_EXISTS_ON_DISK):
 *                     # open in append mode for files already known on disk
 *                     nc_sa_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                         index, request_object, in_memory=False,
 *                         mode=request_object.open_mode
 */
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 728, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF_SET(__pyx_v_nc_sa_dataset, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":732
 *                         mode=request_object.open_mode
 *                     )
 *                     request_object.data_object = nc_sa_dataset             # <<<<<<<<<<<<<<
 *                     request_object.file_object.close()
 * 
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_request_object, __pyx_n_s_data_object, __pyx_v_nc_sa_dataset) < 0) __PYX_ERR(0, 732, __pyx_L1_error)

        /* "S3netCDF4/_s3netCDF4.pyx":733
 *                     )
 *                     request_object.data_object = nc_sa_dataset
 *                     request_object.file_object.close()             # <<<<<<<<<<<<<<
 * 
 *                 # tell the file manager we have opened the file successfully
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_file_object); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 733, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_close); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 733, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 733, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":726
 *                     request_object.data_object = nc_sa_dataset
 * 
 *                 elif (open_state == OpenFileRecord.KNOWN_EXISTS_ON_DISK):             # <<<<<<<<<<<<<<
 *                     # open in append mode for files already known on disk
 *                     nc_sa_dataset = self.__open_subarray_ncfile(
 */
      }
      __pyx_L14:;

      /* "S3netCDF4/_s3netCDF4.pyx":736
 * 
 *                 # tell the file manager we have opened the file successfully
 *                 self.file_manager.open_success(index.partition.file)             # <<<<<<<<<<<<<<
 * 
 *                 # get the group if this variable is a member of a group
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 736, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_open_success); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 736, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 736, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 736, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":739
 * 
 *                 # get the group if this variable is a member of a group
 *                 cfa_grp = self._cfa_var.getGroup()             # <<<<<<<<<<<<<<
 *                 if (cfa_grp is not None and cfa_grp.getName() is not "root"):
 *                     nc_sa_grp = nc_sa_dataset[cfa_grp.getName()]
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_getGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cfa_grp, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":740
 *                 # get the group if this variable is a member of a group
 *                 cfa_grp = self._cfa_var.getGroup()
 *                 if (cfa_grp is not None and cfa_grp.getName() is not "root"):             # <<<<<<<<<<<<<<
 *                     nc_sa_grp = nc_sa_dataset[cfa_grp.getName()]
 *                 else:
 */
      __pyx_t_3 = (__pyx_v_cfa_grp != Py_None);
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L17_bool_binop_done;
      }
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_grp, __pyx_n_s_getName); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = (__pyx_t_8 != __pyx_n_u_root);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_3 = (__pyx_t_2 != 0);
      __pyx_t_1 = __pyx_t_3;
      __pyx_L17_bool_binop_done:;
      if (__pyx_t_1) {

        /* "S3netCDF4/_s3netCDF4.pyx":741
 *                 cfa_grp = self._cfa_var.getGroup()
 *                 if (cfa_grp is not None and cfa_grp.getName() is not "root"):
 *                     nc_sa_grp = nc_sa_dataset[cfa_grp.getName()]             # <<<<<<<<<<<<<<
 *                 else:
 *                     # not a member of a group so the group is the Dataset
 */
        if (unlikely(!__pyx_v_nc_sa_dataset)) { __Pyx_RaiseUnboundLocalError("nc_sa_dataset"); __PYX_ERR(0, 741, __pyx_L1_error) }
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_grp, __pyx_n_s_getName); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_nc_sa_dataset, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF_SET(__pyx_v_nc_sa_grp, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":740
 *                 # get the group if this variable is a member of a group
 *                 cfa_grp = self._cfa_var.getGroup()
 *                 if (cfa_grp is not None and cfa_grp.getName() is not "root"):             # <<<<<<<<<<<<<<
 *                     nc_sa_grp = nc_sa_dataset[cfa_grp.getName()]
 *                 else:
 */
        goto __pyx_L16;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":744
 *                 else:
 *                     # not a member of a group so the group is the Dataset
 *                     nc_sa_grp = nc_sa_dataset             # <<<<<<<<<<<<<<
 * 
 *                 # get the variable from the group
 */
      /*else*/ {
        if (unlikely(!__pyx_v_nc_sa_dataset)) { __Pyx_RaiseUnboundLocalError("nc_sa_dataset"); __PYX_ERR(0, 744, __pyx_L1_error) }
        __Pyx_INCREF(__pyx_v_nc_sa_dataset);
        __Pyx_XDECREF_SET(__pyx_v_nc_sa_grp, __pyx_v_nc_sa_dataset);
      }
      __pyx_L16:;

      /* "S3netCDF4/_s3netCDF4.pyx":747
 * 
 *                 # get the variable from the group
 *                 nc_sa_fld_var = nc_sa_grp[self._cfa_var.getName()]             # <<<<<<<<<<<<<<
 *                 # set the data using the slice from the partition
 *                 nc_sa_fld_var[index.source] = data
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_getName); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(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);
        }
      }
      __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_nc_sa_grp, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_nc_sa_fld_var, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":749
 *                 nc_sa_fld_var = nc_sa_grp[self._cfa_var.getName()]
 *                 # set the data using the slice from the partition
 *                 nc_sa_fld_var[index.source] = data             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_var.__setitem__(elem, data)
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_source); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(PyObject_SetItem(__pyx_v_nc_sa_fld_var, __pyx_t_9, __pyx_v_data) < 0)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":616
 *             # (filename, varname, source_slice, target_slice)
 *             index_list = self._cfa_var[elem]
 *             for index in index_list:             # <<<<<<<<<<<<<<
 *                 size = (np.prod(index.partition.shape) *
 *                         self._cfa_var.getType().itemsize)
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":612
 *             data from the input data to the subarray
 *         """
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             # get the above details from the CFA variable, details are returned as:
 *             # (filename, varname, source_slice, target_slice)
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":751
 *                 nc_sa_fld_var[index.source] = data
 *         else:
 *             self._nc_var.__setitem__(elem, data)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, elem):
 */
  /*else*/ {
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_setitem); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_12 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_12 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_elem, __pyx_v_data};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_elem, __pyx_v_data};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_v_elem);
      __Pyx_GIVEREF(__pyx_v_elem);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_12, __pyx_v_elem);
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_12, __pyx_v_data);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":603
 *         return nc_sa_dataset
 * 
 *     def __setitem__(self, elem, data):             # <<<<<<<<<<<<<<
 *         """Override the netCDF4.Variable __setitem__ method to assign data to
 *         the correct subarray file.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index_list);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_open_state);
  __Pyx_XDECREF(__pyx_v_orig_mode);
  __Pyx_XDECREF(__pyx_v_open_mode);
  __Pyx_XDECREF(__pyx_v_request_object);
  __Pyx_XDECREF(__pyx_v_nc_sa_dataset);
  __Pyx_XDECREF(__pyx_v_nc_in_dataset);
  __Pyx_XDECREF(__pyx_v_cfa_grp);
  __Pyx_XDECREF(__pyx_v_nc_sa_grp);
  __Pyx_XDECREF(__pyx_v_nc_sa_fld_var);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":753
 *             self._nc_var.__setitem__(elem, data)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the netCDF4.Variable __getitem__ method to assign data to
 *         the correct subarray file.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_37__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_36__getitem__[] = "Override the netCDF4.Variable __getitem__ method to assign data to\n        the correct subarray file.\n        The CFAVariable class has a method which will determine:\n            1. The path of the subarray file(s)\n            2. The slice in the subarray(s) to read from\n            3. The slice in the output array to write to\n        ";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_37__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_37__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_10s3Variable_36__getitem__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_37__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_elem = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_elem,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elem)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 753, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 753, __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_self = values[0];
    __pyx_v_elem = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 753, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_36__getitem__(__pyx_self, __pyx_v_self, __pyx_v_elem);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_36__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elem) {
  CYTHON_UNUSED PyObject *__pyx_v_s3d = NULL;
  PyObject *__pyx_v_index_list = NULL;
  PyObject *__pyx_v_target_array = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_size = NULL;
  PyObject *__pyx_v_request_object = NULL;
  PyObject *__pyx_v_nc_sa_dataset = NULL;
  PyObject *__pyx_v_cfa_grp = NULL;
  PyObject *__pyx_v_nc_sa_grp = NULL;
  PyObject *__pyx_v_nc_sa_fld_var = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":761
 *             3. The slice in the output array to write to
 *         """
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             # get parent s3Dataset for the creation parameters
 *             if hasattr(self.parent, "_nc_grp"):
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 761, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":763
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             # get parent s3Dataset for the creation parameters
 *             if hasattr(self.parent, "_nc_grp"):             # <<<<<<<<<<<<<<
 *                 s3d = self.parent.parent
 *             else:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_HasAttr(__pyx_t_4, __pyx_n_u_nc_grp); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 763, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__pyx_t_1 != 0);
    if (__pyx_t_3) {

      /* "S3netCDF4/_s3netCDF4.pyx":764
 *             # get parent s3Dataset for the creation parameters
 *             if hasattr(self.parent, "_nc_grp"):
 *                 s3d = self.parent.parent             # <<<<<<<<<<<<<<
 *             else:
 *                 s3d = self.parent
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_parent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_s3d = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":763
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             # get parent s3Dataset for the creation parameters
 *             if hasattr(self.parent, "_nc_grp"):             # <<<<<<<<<<<<<<
 *                 s3d = self.parent.parent
 *             else:
 */
      goto __pyx_L6;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":766
 *                 s3d = self.parent.parent
 *             else:
 *                 s3d = self.parent             # <<<<<<<<<<<<<<
 * 
 *             # get the details from the CFA variable, details are returned as:
 */
    /*else*/ {
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_v_s3d = __pyx_t_5;
      __pyx_t_5 = 0;
    }
    __pyx_L6:;

    /* "S3netCDF4/_s3netCDF4.pyx":770
 *             # get the details from the CFA variable, details are returned as:
 *             # list of (CFAPartition, source_slice, target_slice)
 *             index_list = self._cfa_var[elem]             # <<<<<<<<<<<<<<
 *             # create the target array
 *             target_array = self.file_manager.request_array(
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_elem); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_index_list = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":772
 *             index_list = self._cfa_var[elem]
 *             # create the target array
 *             target_array = self.file_manager.request_array(             # <<<<<<<<<<<<<<
 *                 index_list, self._cfa_var.getType(), self._cfa_var.getBaseFilename()
 *             )
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_request_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":773
 *             # create the target array
 *             target_array = self.file_manager.request_array(
 *                 index_list, self._cfa_var.getType(), self._cfa_var.getBaseFilename()             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_getType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_getBaseFilename); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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);
      }
    }
    __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_10 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_index_list, __pyx_t_5, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_index_list, __pyx_t_5, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 772, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_INCREF(__pyx_v_index_list);
      __Pyx_GIVEREF(__pyx_v_index_list);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_v_index_list);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_10, __pyx_t_8);
      __pyx_t_5 = 0;
      __pyx_t_8 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_target_array = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":776
 *             )
 * 
 *             for index in index_list:             # <<<<<<<<<<<<<<
 *                 # when the file is streamed into memory, the whole file is read
 *                 # in - i.e. it is opened in memory by netCDF.
 */
    if (likely(PyList_CheckExact(__pyx_v_index_list)) || PyTuple_CheckExact(__pyx_v_index_list)) {
      __pyx_t_4 = __pyx_v_index_list; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_index_list); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 776, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 776, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 776, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 776, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 776, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_12(__pyx_t_4);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 776, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":780
 *                 # in - i.e. it is opened in memory by netCDF.
 *                 # We need to reserve the full amount of space
 *                 size = (np.prod(index.partition.shape) *             # <<<<<<<<<<<<<<
 *                         self._cfa_var.getType().itemsize)
 *                 request_object = self.file_manager.request_file(
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_prod); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":781
 *                 # We need to reserve the full amount of space
 *                 size = (np.prod(index.partition.shape) *
 *                         self._cfa_var.getType().itemsize)             # <<<<<<<<<<<<<<
 *                 request_object = self.file_manager.request_file(
 *                                     index.partition.file, size, mode="r"
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_8 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":780
 *                 # in - i.e. it is opened in memory by netCDF.
 *                 # We need to reserve the full amount of space
 *                 size = (np.prod(index.partition.shape) *             # <<<<<<<<<<<<<<
 *                         self._cfa_var.getType().itemsize)
 *                 request_object = self.file_manager.request_file(
 */
      __pyx_t_8 = PyNumber_Multiply(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_size, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":782
 *                 size = (np.prod(index.partition.shape) *
 *                         self._cfa_var.getType().itemsize)
 *                 request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                     index.partition.file, size, mode="r"
 *                                 )
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 782, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_request_file); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 782, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":783
 *                         self._cfa_var.getType().itemsize)
 *                 request_object = self.file_manager.request_file(
 *                                     index.partition.file, size, mode="r"             # <<<<<<<<<<<<<<
 *                                 )
 *                 # if the file does not exist, but is within the array domain
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_file); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":782
 *                 size = (np.prod(index.partition.shape) *
 *                         self._cfa_var.getType().itemsize)
 *                 request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                     index.partition.file, size, mode="r"
 *                                 )
 */
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 782, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
      __Pyx_INCREF(__pyx_v_size);
      __Pyx_GIVEREF(__pyx_v_size);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_size);
      __pyx_t_6 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":783
 *                         self._cfa_var.getType().itemsize)
 *                 request_object = self.file_manager.request_file(
 *                                     index.partition.file, size, mode="r"             # <<<<<<<<<<<<<<
 *                                 )
 *                 # if the file does not exist, but is within the array domain
 */
      __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 783, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":782
 *                 size = (np.prod(index.partition.shape) *
 *                         self._cfa_var.getType().itemsize)
 *                 request_object = self.file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                     index.partition.file, size, mode="r"
 *                                 )
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 782, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_request_object, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":788
 *                 # (if it has reached this point then it is), then return the
 *                 # target array full of missing values
 *                 if (request_object.open_state == OpenFileRecord.DOES_NOT_EXIST):             # <<<<<<<<<<<<<<
 *                     target_array[index.target] = self._nc_var._FillValue
 *                 else:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_open_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_DOES_NOT_EXIST); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 788, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 788, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_3) {

        /* "S3netCDF4/_s3netCDF4.pyx":789
 *                 # target array full of missing values
 *                 if (request_object.open_state == OpenFileRecord.DOES_NOT_EXIST):
 *                     target_array[index.target] = self._nc_var._FillValue             # <<<<<<<<<<<<<<
 *                 else:
 *                     # get the netCDF
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_FillValue); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_target); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(PyObject_SetItem(__pyx_v_target_array, __pyx_t_6, __pyx_t_8) < 0)) __PYX_ERR(0, 789, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":788
 *                 # (if it has reached this point then it is), then return the
 *                 # target array full of missing values
 *                 if (request_object.open_state == OpenFileRecord.DOES_NOT_EXIST):             # <<<<<<<<<<<<<<
 *                     target_array[index.target] = self._nc_var._FillValue
 *                 else:
 */
        goto __pyx_L9;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":792
 *                 else:
 *                     # get the netCDF
 *                     if (request_object.open_state == OpenFileRecord.OPEN_NEW_IN_MEMORY or             # <<<<<<<<<<<<<<
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_STORAGE):
 */
      /*else*/ {
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_open_state); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_OPEN_NEW_IN_MEMORY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_8, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 792, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!__pyx_t_1) {
        } else {
          __pyx_t_3 = __pyx_t_1;
          goto __pyx_L11_bool_binop_done;
        }

        /* "S3netCDF4/_s3netCDF4.pyx":793
 *                     # get the netCDF
 *                     if (request_object.open_state == OpenFileRecord.OPEN_NEW_IN_MEMORY or
 *                     request_object.open_state ==             # <<<<<<<<<<<<<<
 *                     OpenFileRecord.KNOWN_EXISTS_ON_STORAGE):
 *                         nc_sa_dataset = self.__open_subarray_ncfile(
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_open_state); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 793, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "S3netCDF4/_s3netCDF4.pyx":794
 *                     if (request_object.open_state == OpenFileRecord.OPEN_NEW_IN_MEMORY or
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_STORAGE):             # <<<<<<<<<<<<<<
 *                         nc_sa_dataset = self.__open_subarray_ncfile(
 *                             index, request_object, in_memory=True, mode="r"
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_KNOWN_EXISTS_ON_STORAGE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 794, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":793
 *                     # get the netCDF
 *                     if (request_object.open_state == OpenFileRecord.OPEN_NEW_IN_MEMORY or
 *                     request_object.open_state ==             # <<<<<<<<<<<<<<
 *                     OpenFileRecord.KNOWN_EXISTS_ON_STORAGE):
 *                         nc_sa_dataset = self.__open_subarray_ncfile(
 */
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 793, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_3 = __pyx_t_1;
        __pyx_L11_bool_binop_done:;

        /* "S3netCDF4/_s3netCDF4.pyx":792
 *                 else:
 *                     # get the netCDF
 *                     if (request_object.open_state == OpenFileRecord.OPEN_NEW_IN_MEMORY or             # <<<<<<<<<<<<<<
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_STORAGE):
 */
        if (__pyx_t_3) {

          /* "S3netCDF4/_s3netCDF4.pyx":795
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_STORAGE):
 *                         nc_sa_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                             index, request_object, in_memory=True, mode="r"
 *                         )
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__open_subarray_ncfil); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);

          /* "S3netCDF4/_s3netCDF4.pyx":796
 *                     OpenFileRecord.KNOWN_EXISTS_ON_STORAGE):
 *                         nc_sa_dataset = self.__open_subarray_ncfile(
 *                             index, request_object, in_memory=True, mode="r"             # <<<<<<<<<<<<<<
 *                         )
 *                         # cache the data object
 */
          __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 795, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_INCREF(__pyx_v_index);
          __Pyx_GIVEREF(__pyx_v_index);
          PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_index);
          __Pyx_INCREF(__pyx_v_request_object);
          __Pyx_GIVEREF(__pyx_v_request_object);
          PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_request_object);
          __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 796, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_in_memory, Py_True) < 0) __PYX_ERR(0, 796, __pyx_L1_error)
          if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 796, __pyx_L1_error)

          /* "S3netCDF4/_s3netCDF4.pyx":795
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_STORAGE):
 *                         nc_sa_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                             index, request_object, in_memory=True, mode="r"
 *                         )
 */
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF_SET(__pyx_v_nc_sa_dataset, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":799
 *                         )
 *                         # cache the data object
 *                         request_object.data_object = nc_sa_dataset             # <<<<<<<<<<<<<<
 *                         # indicate successfully open
 *                         self.file_manager.open_success(index.partition.file)
 */
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_request_object, __pyx_n_s_data_object, __pyx_v_nc_sa_dataset) < 0) __PYX_ERR(0, 799, __pyx_L1_error)

          /* "S3netCDF4/_s3netCDF4.pyx":801
 *                         request_object.data_object = nc_sa_dataset
 *                         # indicate successfully open
 *                         self.file_manager.open_success(index.partition.file)             # <<<<<<<<<<<<<<
 *                     elif (request_object.open_state == OpenFileRecord.OPEN_NEW_ON_DISK or
 *                     request_object.open_state ==
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_open_success); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 801, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 801, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_file); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 801, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_8, function);
            }
          }
          __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 801, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":792
 *                 else:
 *                     # get the netCDF
 *                     if (request_object.open_state == OpenFileRecord.OPEN_NEW_IN_MEMORY or             # <<<<<<<<<<<<<<
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_STORAGE):
 */
          goto __pyx_L10;
        }

        /* "S3netCDF4/_s3netCDF4.pyx":802
 *                         # indicate successfully open
 *                         self.file_manager.open_success(index.partition.file)
 *                     elif (request_object.open_state == OpenFileRecord.OPEN_NEW_ON_DISK or             # <<<<<<<<<<<<<<
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_DISK):
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_open_state); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 802, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 802, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_OPEN_NEW_ON_DISK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 802, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 802, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 802, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (!__pyx_t_1) {
        } else {
          __pyx_t_3 = __pyx_t_1;
          goto __pyx_L13_bool_binop_done;
        }

        /* "S3netCDF4/_s3netCDF4.pyx":803
 *                         self.file_manager.open_success(index.partition.file)
 *                     elif (request_object.open_state == OpenFileRecord.OPEN_NEW_ON_DISK or
 *                     request_object.open_state ==             # <<<<<<<<<<<<<<
 *                     OpenFileRecord.KNOWN_EXISTS_ON_DISK):
 *                         nc_sa_dataset = self.__open_subarray_ncfile(
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_open_state); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 803, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);

        /* "S3netCDF4/_s3netCDF4.pyx":804
 *                     elif (request_object.open_state == OpenFileRecord.OPEN_NEW_ON_DISK or
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_DISK):             # <<<<<<<<<<<<<<
 *                         nc_sa_dataset = self.__open_subarray_ncfile(
 *                             index, request_object, in_memory=False, mode="r"
 */
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 804, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_KNOWN_EXISTS_ON_DISK); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 804, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 803, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":803
 *                         self.file_manager.open_success(index.partition.file)
 *                     elif (request_object.open_state == OpenFileRecord.OPEN_NEW_ON_DISK or
 *                     request_object.open_state ==             # <<<<<<<<<<<<<<
 *                     OpenFileRecord.KNOWN_EXISTS_ON_DISK):
 *                         nc_sa_dataset = self.__open_subarray_ncfile(
 */
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 803, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_3 = __pyx_t_1;
        __pyx_L13_bool_binop_done:;

        /* "S3netCDF4/_s3netCDF4.pyx":802
 *                         # indicate successfully open
 *                         self.file_manager.open_success(index.partition.file)
 *                     elif (request_object.open_state == OpenFileRecord.OPEN_NEW_ON_DISK or             # <<<<<<<<<<<<<<
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_DISK):
 */
        if (__pyx_t_3) {

          /* "S3netCDF4/_s3netCDF4.pyx":805
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_DISK):
 *                         nc_sa_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                             index, request_object, in_memory=False, mode="r"
 *                         )
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3Variable__open_subarray_ncfil); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);

          /* "S3netCDF4/_s3netCDF4.pyx":806
 *                     OpenFileRecord.KNOWN_EXISTS_ON_DISK):
 *                         nc_sa_dataset = self.__open_subarray_ncfile(
 *                             index, request_object, in_memory=False, mode="r"             # <<<<<<<<<<<<<<
 *                         )
 *                         # cache the data object
 */
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_v_index);
          __Pyx_GIVEREF(__pyx_v_index);
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_index);
          __Pyx_INCREF(__pyx_v_request_object);
          __Pyx_GIVEREF(__pyx_v_request_object);
          PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_request_object);
          __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 806, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_in_memory, Py_False) < 0) __PYX_ERR(0, 806, __pyx_L1_error)
          if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_mode, __pyx_n_u_r) < 0) __PYX_ERR(0, 806, __pyx_L1_error)

          /* "S3netCDF4/_s3netCDF4.pyx":805
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_DISK):
 *                         nc_sa_dataset = self.__open_subarray_ncfile(             # <<<<<<<<<<<<<<
 *                             index, request_object, in_memory=False, mode="r"
 *                         )
 */
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_nc_sa_dataset, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":809
 *                         )
 *                         # cache the data object
 *                         request_object.data_object = nc_sa_dataset             # <<<<<<<<<<<<<<
 *                         request_object.file_object.close()
 *                         # indicate successfully open
 */
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_request_object, __pyx_n_s_data_object, __pyx_v_nc_sa_dataset) < 0) __PYX_ERR(0, 809, __pyx_L1_error)

          /* "S3netCDF4/_s3netCDF4.pyx":810
 *                         # cache the data object
 *                         request_object.data_object = nc_sa_dataset
 *                         request_object.file_object.close()             # <<<<<<<<<<<<<<
 *                         # indicate successfully open
 *                         self.file_manager.open_success(index.partition.file)
 */
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_file_object); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 810, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_close); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 810, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_8)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 810, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":812
 *                         request_object.file_object.close()
 *                         # indicate successfully open
 *                         self.file_manager.open_success(index.partition.file)             # <<<<<<<<<<<<<<
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY:
 *                         nc_sa_dataset = request_object.data_object
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 812, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_open_success); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 812, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_partition); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 812, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_file); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
            if (likely(__pyx_t_7)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_7);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_8, function);
            }
          }
          __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 812, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":802
 *                         # indicate successfully open
 *                         self.file_manager.open_success(index.partition.file)
 *                     elif (request_object.open_state == OpenFileRecord.OPEN_NEW_ON_DISK or             # <<<<<<<<<<<<<<
 *                     request_object.open_state ==
 *                     OpenFileRecord.KNOWN_EXISTS_ON_DISK):
 */
          goto __pyx_L10;
        }

        /* "S3netCDF4/_s3netCDF4.pyx":813
 *                         # indicate successfully open
 *                         self.file_manager.open_success(index.partition.file)
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY:             # <<<<<<<<<<<<<<
 *                         nc_sa_dataset = request_object.data_object
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_ON_DISK:
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_open_state); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 813, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_OPEN_EXISTS_IN_MEMORY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 813, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 813, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 813, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (__pyx_t_3) {

          /* "S3netCDF4/_s3netCDF4.pyx":814
 *                         self.file_manager.open_success(index.partition.file)
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY:
 *                         nc_sa_dataset = request_object.data_object             # <<<<<<<<<<<<<<
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_ON_DISK:
 *                         nc_sa_dataset = request_object.data_object
 */
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_data_object); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 814, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_XDECREF_SET(__pyx_v_nc_sa_dataset, __pyx_t_8);
          __pyx_t_8 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":813
 *                         # indicate successfully open
 *                         self.file_manager.open_success(index.partition.file)
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY:             # <<<<<<<<<<<<<<
 *                         nc_sa_dataset = request_object.data_object
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_ON_DISK:
 */
          goto __pyx_L10;
        }

        /* "S3netCDF4/_s3netCDF4.pyx":815
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY:
 *                         nc_sa_dataset = request_object.data_object
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_ON_DISK:             # <<<<<<<<<<<<<<
 *                         nc_sa_dataset = request_object.data_object
 *                         request_object.file_object.close()
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_open_state); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 815, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 815, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_OPEN_EXISTS_ON_DISK); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 815, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_RichCompare(__pyx_t_8, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 815, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 815, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (__pyx_t_3) {

          /* "S3netCDF4/_s3netCDF4.pyx":816
 *                         nc_sa_dataset = request_object.data_object
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_ON_DISK:
 *                         nc_sa_dataset = request_object.data_object             # <<<<<<<<<<<<<<
 *                         request_object.file_object.close()
 * 
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_data_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 816, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_XDECREF_SET(__pyx_v_nc_sa_dataset, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":817
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_ON_DISK:
 *                         nc_sa_dataset = request_object.data_object
 *                         request_object.file_object.close()             # <<<<<<<<<<<<<<
 * 
 *                     # get the group if this variable is a member of a group
 */
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_request_object, __pyx_n_s_file_object); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 817, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_close); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 817, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_8, function);
            }
          }
          __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":815
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_IN_MEMORY:
 *                         nc_sa_dataset = request_object.data_object
 *                     elif request_object.open_state == OpenFileRecord.OPEN_EXISTS_ON_DISK:             # <<<<<<<<<<<<<<
 *                         nc_sa_dataset = request_object.data_object
 *                         request_object.file_object.close()
 */
        }
        __pyx_L10:;

        /* "S3netCDF4/_s3netCDF4.pyx":820
 * 
 *                     # get the group if this variable is a member of a group
 *                     cfa_grp = self._cfa_var.getGroup()             # <<<<<<<<<<<<<<
 *                     if (cfa_grp is not None and cfa_grp.getName() is not "root"):
 *                         nc_sa_grp = nc_sa_dataset[cfa_grp.getName()]
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 820, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_getGroup); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 820, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF_SET(__pyx_v_cfa_grp, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":821
 *                     # get the group if this variable is a member of a group
 *                     cfa_grp = self._cfa_var.getGroup()
 *                     if (cfa_grp is not None and cfa_grp.getName() is not "root"):             # <<<<<<<<<<<<<<
 *                         nc_sa_grp = nc_sa_dataset[cfa_grp.getName()]
 *                     else:
 */
        __pyx_t_1 = (__pyx_v_cfa_grp != Py_None);
        __pyx_t_2 = (__pyx_t_1 != 0);
        if (__pyx_t_2) {
        } else {
          __pyx_t_3 = __pyx_t_2;
          goto __pyx_L16_bool_binop_done;
        }
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_grp, __pyx_n_s_getName); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 821, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 821, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_2 = (__pyx_t_5 != __pyx_n_u_root);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_1 = (__pyx_t_2 != 0);
        __pyx_t_3 = __pyx_t_1;
        __pyx_L16_bool_binop_done:;
        if (__pyx_t_3) {

          /* "S3netCDF4/_s3netCDF4.pyx":822
 *                     cfa_grp = self._cfa_var.getGroup()
 *                     if (cfa_grp is not None and cfa_grp.getName() is not "root"):
 *                         nc_sa_grp = nc_sa_dataset[cfa_grp.getName()]             # <<<<<<<<<<<<<<
 *                     else:
 *                         # not a member of a group so the group is the Dataset
 */
          if (unlikely(!__pyx_v_nc_sa_dataset)) { __Pyx_RaiseUnboundLocalError("nc_sa_dataset"); __PYX_ERR(0, 822, __pyx_L1_error) }
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_grp, __pyx_n_s_getName); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 822, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_8 = NULL;
          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_8)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 822, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_nc_sa_dataset, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 822, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF_SET(__pyx_v_nc_sa_grp, __pyx_t_6);
          __pyx_t_6 = 0;

          /* "S3netCDF4/_s3netCDF4.pyx":821
 *                     # get the group if this variable is a member of a group
 *                     cfa_grp = self._cfa_var.getGroup()
 *                     if (cfa_grp is not None and cfa_grp.getName() is not "root"):             # <<<<<<<<<<<<<<
 *                         nc_sa_grp = nc_sa_dataset[cfa_grp.getName()]
 *                     else:
 */
          goto __pyx_L15;
        }

        /* "S3netCDF4/_s3netCDF4.pyx":825
 *                     else:
 *                         # not a member of a group so the group is the Dataset
 *                         nc_sa_grp = nc_sa_dataset             # <<<<<<<<<<<<<<
 * 
 *                     # get the variable from the group
 */
        /*else*/ {
          if (unlikely(!__pyx_v_nc_sa_dataset)) { __Pyx_RaiseUnboundLocalError("nc_sa_dataset"); __PYX_ERR(0, 825, __pyx_L1_error) }
          __Pyx_INCREF(__pyx_v_nc_sa_dataset);
          __Pyx_XDECREF_SET(__pyx_v_nc_sa_grp, __pyx_v_nc_sa_dataset);
        }
        __pyx_L15:;

        /* "S3netCDF4/_s3netCDF4.pyx":828
 * 
 *                     # get the variable from the group
 *                     nc_sa_fld_var = nc_sa_grp[self._cfa_var.getName()]             # <<<<<<<<<<<<<<
 *                     # set the data using the slice from the partition
 *                     target_array[index.target] = nc_sa_fld_var[index.source]
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getName); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 828, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 828, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_nc_sa_grp, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 828, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF_SET(__pyx_v_nc_sa_fld_var, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":830
 *                     nc_sa_fld_var = nc_sa_grp[self._cfa_var.getName()]
 *                     # set the data using the slice from the partition
 *                     target_array[index.target] = nc_sa_fld_var[index.source]             # <<<<<<<<<<<<<<
 *             return target_array
 *         else:
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_source); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_nc_sa_fld_var, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_target); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (unlikely(PyObject_SetItem(__pyx_v_target_array, __pyx_t_8, __pyx_t_6) < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_L9:;

      /* "S3netCDF4/_s3netCDF4.pyx":776
 *             )
 * 
 *             for index in index_list:             # <<<<<<<<<<<<<<
 *                 # when the file is streamed into memory, the whole file is read
 *                 # in - i.e. it is opened in memory by netCDF.
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":831
 *                     # set the data using the slice from the partition
 *                     target_array[index.target] = nc_sa_fld_var[index.source]
 *             return target_array             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_var[elem]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_target_array);
    __pyx_r = __pyx_v_target_array;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":761
 *             3. The slice in the output array to write to
 *         """
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             # get parent s3Dataset for the creation parameters
 *             if hasattr(self.parent, "_nc_grp"):
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":833
 *             return target_array
 *         else:
 *             return self._nc_var[elem]             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_elem); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":753
 *             self._nc_var.__setitem__(elem, data)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the netCDF4.Variable __getitem__ method to assign data to
 *         the correct subarray file.
 */

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s3d);
  __Pyx_XDECREF(__pyx_v_index_list);
  __Pyx_XDECREF(__pyx_v_target_array);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_size);
  __Pyx_XDECREF(__pyx_v_request_object);
  __Pyx_XDECREF(__pyx_v_nc_sa_dataset);
  __Pyx_XDECREF(__pyx_v_cfa_grp);
  __Pyx_XDECREF(__pyx_v_nc_sa_grp);
  __Pyx_XDECREF(__pyx_v_nc_sa_fld_var);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":835
 *             return self._nc_var[elem]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             if sys_version_info[0] > 2:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_39__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_39__repr__ = {"__repr__", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_39__repr__, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_39__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_38__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_38__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":836
 * 
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_var_2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 836, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 836, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":837
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             if sys_version_info[0] > 2:             # <<<<<<<<<<<<<<
 *                 return self.__unicode__()
 *             else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys_version_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 837, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "S3netCDF4/_s3netCDF4.pyx":838
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()             # <<<<<<<<<<<<<<
 *             else:
 *                 return unicode(self).encode('utf-8')
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __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;

      /* "S3netCDF4/_s3netCDF4.pyx":837
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             if sys_version_info[0] > 2:             # <<<<<<<<<<<<<<
 *                 return self.__unicode__()
 *             else:
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":840
 *                 return self.__unicode__()
 *             else:
 *                 return unicode(self).encode('utf-8')             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_var.__repr__()
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 840, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":836
 * 
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_var") and self._cfa_var:             # <<<<<<<<<<<<<<
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":842
 *                 return unicode(self).encode('utf-8')
 *         else:
 *             return self._nc_var.__repr__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_var_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_repr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":835
 *             return self._nc_var[elem]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             if sys_version_info[0] > 2:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":845
 * 
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_var = self._cfa_var
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_41__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_41__unicode__ = {"__unicode__", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_41__unicode__, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_10s3Variable_41__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_40__unicode__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10s3Variable_40__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ncdump = NULL;
  PyObject *__pyx_v_cfa_var = NULL;
  PyObject *__pyx_v_cfa_meta = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_unlimdims = NULL;
  PyObject *__pyx_v_dimname = NULL;
  PyObject *__pyx_v_dim = NULL;
  PyObject *__pyx_7genexpr__pyx_v_x = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_x = 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;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__unicode__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":846
 * 
 *     def __unicode__(self):
 *         ncdump = ['{}\n'.format(type(self))]             # <<<<<<<<<<<<<<
 *         cfa_var = self._cfa_var
 *         # write the variable type, name and dimensions
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)Py_TYPE(__pyx_v_self))) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)Py_TYPE(__pyx_v_self)));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_ncdump = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":847
 *     def __unicode__(self):
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_var = self._cfa_var             # <<<<<<<<<<<<<<
 *         # write the variable type, name and dimensions
 *         ncdump.append("{} {}({})\n".format(
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_var_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_cfa_var = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":849
 *         cfa_var = self._cfa_var
 *         # write the variable type, name and dimensions
 *         ncdump.append("{} {}({})\n".format(             # <<<<<<<<<<<<<<
 *                 cfa_var.getType(),
 *                 cfa_var.getName(),
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__5, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "S3netCDF4/_s3netCDF4.pyx":850
 *         # write the variable type, name and dimensions
 *         ncdump.append("{} {}({})\n".format(
 *                 cfa_var.getType(),             # <<<<<<<<<<<<<<
 *                 cfa_var.getName(),
 *                 ",".join(cfa_var.getDimensions())
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_var, __pyx_n_s_getType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":851
 *         ncdump.append("{} {}({})\n".format(
 *                 cfa_var.getType(),
 *                 cfa_var.getName(),             # <<<<<<<<<<<<<<
 *                 ",".join(cfa_var.getDimensions())
 *             )
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_var, __pyx_n_s_getName); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":852
 *                 cfa_var.getType(),
 *                 cfa_var.getName(),
 *                 ",".join(cfa_var.getDimensions())             # <<<<<<<<<<<<<<
 *             )
 *         )
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_var, __pyx_n_s_getDimensions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__6, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __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_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __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_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 849, __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_8, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_6);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":849
 *         cfa_var = self._cfa_var
 *         # write the variable type, name and dimensions
 *         ncdump.append("{} {}({})\n".format(             # <<<<<<<<<<<<<<
 *                 cfa_var.getType(),
 *                 cfa_var.getName(),
 */
  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":856
 *         )
 *         # add the metadata
 *         cfa_meta = cfa_var.getMetadata()             # <<<<<<<<<<<<<<
 *         for m in cfa_meta:
 *             ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_var, __pyx_n_s_getMetadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cfa_meta = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":857
 *         # add the metadata
 *         cfa_meta = cfa_var.getMetadata()
 *         for m in cfa_meta:             # <<<<<<<<<<<<<<
 *             ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))
 *         # get the unlimited dimensions
 */
  if (likely(PyList_CheckExact(__pyx_v_cfa_meta)) || PyTuple_CheckExact(__pyx_v_cfa_meta)) {
    __pyx_t_2 = __pyx_v_cfa_meta; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_cfa_meta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 857, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 857, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 857, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_11(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 857, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":858
 *         cfa_meta = cfa_var.getMetadata()
 *         for m in cfa_meta:
 *             ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))             # <<<<<<<<<<<<<<
 *         # get the unlimited dimensions
 *         unlimdims = []
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__2, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_cfa_meta, __pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && 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);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_m, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_m, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_m);
      __Pyx_GIVEREF(__pyx_v_m);
      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_v_m);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 858, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":857
 *         # add the metadata
 *         cfa_meta = cfa_var.getMetadata()
 *         for m in cfa_meta:             # <<<<<<<<<<<<<<
 *             ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))
 *         # get the unlimited dimensions
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":860
 *             ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))
 *         # get the unlimited dimensions
 *         unlimdims = []             # <<<<<<<<<<<<<<
 *         for dimname in cfa_var.getDimensions():
 *             dim = self.parent.dimensions[dimname]
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_unlimdims = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":861
 *         # get the unlimited dimensions
 *         unlimdims = []
 *         for dimname in cfa_var.getDimensions():             # <<<<<<<<<<<<<<
 *             dim = self.parent.dimensions[dimname]
 *             if dim._nc_dim.isunlimited():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_var, __pyx_n_s_getDimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 861, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 861, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 861, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_11(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 861, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":862
 *         unlimdims = []
 *         for dimname in cfa_var.getDimensions():
 *             dim = self.parent.dimensions[dimname]             # <<<<<<<<<<<<<<
 *             if dim._nc_dim.isunlimited():
 *                 unlimdims.append(dimname)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_dimname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":863
 *         for dimname in cfa_var.getDimensions():
 *             dim = self.parent.dimensions[dimname]
 *             if dim._nc_dim.isunlimited():             # <<<<<<<<<<<<<<
 *                 unlimdims.append(dimname)
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_dim, __pyx_n_s_nc_dim_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_isunlimited); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 863, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_12) {

      /* "S3netCDF4/_s3netCDF4.pyx":864
 *             dim = self.parent.dimensions[dimname]
 *             if dim._nc_dim.isunlimited():
 *                 unlimdims.append(dimname)             # <<<<<<<<<<<<<<
 * 
 *         ncdump.append("unlimited dimensions: {}\n".format(
 */
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_unlimdims, __pyx_v_dimname); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 864, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":863
 *         for dimname in cfa_var.getDimensions():
 *             dim = self.parent.dimensions[dimname]
 *             if dim._nc_dim.isunlimited():             # <<<<<<<<<<<<<<
 *                 unlimdims.append(dimname)
 * 
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":861
 *         # get the unlimited dimensions
 *         unlimdims = []
 *         for dimname in cfa_var.getDimensions():             # <<<<<<<<<<<<<<
 *             dim = self.parent.dimensions[dimname]
 *             if dim._nc_dim.isunlimited():
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":866
 *                 unlimdims.append(dimname)
 * 
 *         ncdump.append("unlimited dimensions: {}\n".format(             # <<<<<<<<<<<<<<
 *             ",".join(unlimdims))
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_unlimited_dimensions, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "S3netCDF4/_s3netCDF4.pyx":867
 * 
 *         ncdump.append("unlimited dimensions: {}\n".format(
 *             ",".join(unlimdims))             # <<<<<<<<<<<<<<
 *         )
 *         # get the current shape
 */
  __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__6, __pyx_v_unlimdims); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":866
 *                 unlimdims.append(dimname)
 * 
 *         ncdump.append("unlimited dimensions: {}\n".format(             # <<<<<<<<<<<<<<
 *             ",".join(unlimdims))
 *         )
 */
  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":870
 *         )
 *         # get the current shape
 *         ncdump.append("current shape = ({})\n".format(             # <<<<<<<<<<<<<<
 *                 ",".join([str(x) for x in cfa_var.shape()])
 *             )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_current_shape, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "S3netCDF4/_s3netCDF4.pyx":871
 *         # get the current shape
 *         ncdump.append("current shape = ({})\n".format(
 *                 ",".join([str(x) for x in cfa_var.shape()])             # <<<<<<<<<<<<<<
 *             )
 *         )
 */
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L10_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_var, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 871, __pyx_L10_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 871, __pyx_L10_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
      __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 871, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 871, __pyx_L10_error)
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 871, __pyx_L10_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 871, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 871, __pyx_L10_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 871, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_11(__pyx_t_6);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 871, __pyx_L10_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_7genexpr__pyx_v_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 871, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 871, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
    goto __pyx_L13_exit_scope;
    __pyx_L10_error:;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L13_exit_scope:;
  } /* exit inner scope */
  __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__6, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":870
 *         )
 *         # get the current shape
 *         ncdump.append("current shape = ({})\n".format(             # <<<<<<<<<<<<<<
 *                 ",".join([str(x) for x in cfa_var.shape()])
 *             )
 */
  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":875
 *         )
 *         # add the fillvalue
 *         if "_FillValue" in cfa_meta:             # <<<<<<<<<<<<<<
 *             ncdump.append("filling on, _FillValue of {} used\n".format(
 *                 cfa_meta["_FillValue"])
 */
  __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_FillValue, __pyx_v_cfa_meta, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 875, __pyx_L1_error)
  __pyx_t_13 = (__pyx_t_12 != 0);
  if (__pyx_t_13) {

    /* "S3netCDF4/_s3netCDF4.pyx":876
 *         # add the fillvalue
 *         if "_FillValue" in cfa_meta:
 *             ncdump.append("filling on, _FillValue of {} used\n".format(             # <<<<<<<<<<<<<<
 *                 cfa_meta["_FillValue"])
 *             )
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_filling_on__FillValue_of_used, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "S3netCDF4/_s3netCDF4.pyx":877
 *         if "_FillValue" in cfa_meta:
 *             ncdump.append("filling on, _FillValue of {} used\n".format(
 *                 cfa_meta["_FillValue"])             # <<<<<<<<<<<<<<
 *             )
 *         else:
 */
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_cfa_meta, __pyx_n_u_FillValue); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 877, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":876
 *         # add the fillvalue
 *         if "_FillValue" in cfa_meta:
 *             ncdump.append("filling on, _FillValue of {} used\n".format(             # <<<<<<<<<<<<<<
 *                 cfa_meta["_FillValue"])
 *             )
 */
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 876, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":875
 *         )
 *         # add the fillvalue
 *         if "_FillValue" in cfa_meta:             # <<<<<<<<<<<<<<
 *             ncdump.append("filling on, _FillValue of {} used\n".format(
 *                 cfa_meta["_FillValue"])
 */
    goto __pyx_L14;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":880
 *             )
 *         else:
 *             ncdump.append("filling off\n")             # <<<<<<<<<<<<<<
 *         # add the partition information
 *         ncdump.append("partition matrix shape: ({})\n".format(
 */
  /*else*/ {
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_kp_u_filling_off); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 880, __pyx_L1_error)
  }
  __pyx_L14:;

  /* "S3netCDF4/_s3netCDF4.pyx":882
 *             ncdump.append("filling off\n")
 *         # add the partition information
 *         ncdump.append("partition matrix shape: ({})\n".format(             # <<<<<<<<<<<<<<
 *             ",".join([str(x) for x in cfa_var.getPartitionMatrixShape()]))
 *         )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_partition_matrix_shape, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "S3netCDF4/_s3netCDF4.pyx":883
 *         # add the partition information
 *         ncdump.append("partition matrix shape: ({})\n".format(
 *             ",".join([str(x) for x in cfa_var.getPartitionMatrixShape()]))             # <<<<<<<<<<<<<<
 *         )
 *         ncdump.append("partition matrix dimensions: ({})".format(
 */
  { /* enter inner scope */
    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 883, __pyx_L17_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_var, __pyx_n_s_getPartitionMatrixShape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 883, __pyx_L17_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L17_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 883, __pyx_L17_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 883, __pyx_L17_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 883, __pyx_L17_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 883, __pyx_L17_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_11(__pyx_t_7);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 883, __pyx_L17_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_x, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_8genexpr1__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L17_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 883, __pyx_L17_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
    goto __pyx_L20_exit_scope;
    __pyx_L17_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L20_exit_scope:;
  } /* exit inner scope */
  __pyx_t_7 = PyUnicode_Join(__pyx_kp_u__6, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":882
 *             ncdump.append("filling off\n")
 *         # add the partition information
 *         ncdump.append("partition matrix shape: ({})\n".format(             # <<<<<<<<<<<<<<
 *             ",".join([str(x) for x in cfa_var.getPartitionMatrixShape()]))
 *         )
 */
  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":885
 *             ",".join([str(x) for x in cfa_var.getPartitionMatrixShape()]))
 *         )
 *         ncdump.append("partition matrix dimensions: ({})".format(             # <<<<<<<<<<<<<<
 *             ",".join(cfa_var.getPartitionMatrixDimensions())
 *         ))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_partition_matrix_dimensions, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "S3netCDF4/_s3netCDF4.pyx":886
 *         )
 *         ncdump.append("partition matrix dimensions: ({})".format(
 *             ",".join(cfa_var.getPartitionMatrixDimensions())             # <<<<<<<<<<<<<<
 *         ))
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_var, __pyx_n_s_getPartitionMatrixDimensions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__6, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":885
 *             ",".join([str(x) for x in cfa_var.getPartitionMatrixShape()]))
 *         )
 *         ncdump.append("partition matrix dimensions: ({})".format(             # <<<<<<<<<<<<<<
 *             ",".join(cfa_var.getPartitionMatrixDimensions())
 *         ))
 */
  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":889
 *         ))
 * 
 *         return "".join(ncdump)             # <<<<<<<<<<<<<<
 * 
 * # Function below is for s3Group and s3Dataset classes
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__3, __pyx_v_ncdump); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":845
 * 
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_var = self._cfa_var
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Variable.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ncdump);
  __Pyx_XDECREF(__pyx_v_cfa_var);
  __Pyx_XDECREF(__pyx_v_cfa_meta);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_unlimdims);
  __Pyx_XDECREF(__pyx_v_dimname);
  __Pyx_XDECREF(__pyx_v_dim);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":892
 * 
 * # Function below is for s3Group and s3Dataset classes
 * def _group_and_dataset_repr(ncdump, cfa_obj, nc_obj):             # <<<<<<<<<<<<<<
 *     """This is a generalised function to generate a list to be used in the
 *     __repr__ strings for both s3Groups and s3Datasets, as the code is largely
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_1_group_and_dataset_repr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4__group_and_dataset_repr[] = "This is a generalised function to generate a list to be used in the\n    __repr__ strings for both s3Groups and s3Datasets, as the code is largely\n    identical between them.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_1_group_and_dataset_repr = {"_group_and_dataset_repr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_1_group_and_dataset_repr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4__group_and_dataset_repr};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_1_group_and_dataset_repr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ncdump = 0;
  PyObject *__pyx_v_cfa_obj = 0;
  PyObject *__pyx_v_nc_obj = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_group_and_dataset_repr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ncdump,&__pyx_n_s_cfa_obj,&__pyx_n_s_nc_obj,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ncdump)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfa_obj)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_group_and_dataset_repr", 1, 3, 3, 1); __PYX_ERR(0, 892, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc_obj)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_group_and_dataset_repr", 1, 3, 3, 2); __PYX_ERR(0, 892, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_group_and_dataset_repr") < 0)) __PYX_ERR(0, 892, __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_ncdump = values[0];
    __pyx_v_cfa_obj = values[1];
    __pyx_v_nc_obj = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_group_and_dataset_repr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 892, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4._group_and_dataset_repr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4__group_and_dataset_repr(__pyx_self, __pyx_v_ncdump, __pyx_v_cfa_obj, __pyx_v_nc_obj);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4__group_and_dataset_repr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ncdump, PyObject *__pyx_v_cfa_obj, PyObject *__pyx_v_nc_obj) {
  PyObject *__pyx_v_cfa_meta = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_grp = NULL;
  PyObject *__pyx_v_var_names_dims = NULL;
  PyObject *__pyx_v_dim_names_sizes = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_cfa_dim = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_cfa_var = NULL;
  PyObject *__pyx_v_group_names = NULL;
  PyObject *__pyx_v_cfa_group_names = NULL;
  PyObject *__pyx_v_g = 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_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_group_and_dataset_repr", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":897
 *     identical between them."""
 *     # add the metadata
 *     cfa_meta = cfa_obj.getMetadata()             # <<<<<<<<<<<<<<
 *     for m in cfa_meta:
 *         ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_obj, __pyx_n_s_getMetadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cfa_meta = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":898
 *     # add the metadata
 *     cfa_meta = cfa_obj.getMetadata()
 *     for m in cfa_meta:             # <<<<<<<<<<<<<<
 *         ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_cfa_meta)) || PyTuple_CheckExact(__pyx_v_cfa_meta)) {
    __pyx_t_1 = __pyx_v_cfa_meta; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_cfa_meta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 898, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 898, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 898, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":899
 *     cfa_meta = cfa_obj.getMetadata()
 *     for m in cfa_meta:
 *         ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))             # <<<<<<<<<<<<<<
 * 
 *     # The dimensions and variables for the dataset are in the root group
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__2, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_cfa_meta, __pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_m, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_m, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 899, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_v_m);
      __Pyx_GIVEREF(__pyx_v_m);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_m);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_ncdump, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 899, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":898
 *     # add the metadata
 *     cfa_meta = cfa_obj.getMetadata()
 *     for m in cfa_meta:             # <<<<<<<<<<<<<<
 *         ncdump.append("    {}: {} \n".format(m, cfa_meta[m]))
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":904
 *     # for the s3Dataset.  If the cfa_obj has no getGroup method then itself is
 *     # a group
 *     if (hasattr(cfa_obj, "getGroup")):             # <<<<<<<<<<<<<<
 *         grp = cfa_obj.getGroup("root")
 *     else:
 */
  __pyx_t_11 = __Pyx_HasAttr(__pyx_v_cfa_obj, __pyx_n_u_getGroup); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 904, __pyx_L1_error)
  __pyx_t_12 = (__pyx_t_11 != 0);
  if (__pyx_t_12) {

    /* "S3netCDF4/_s3netCDF4.pyx":905
 *     # a group
 *     if (hasattr(cfa_obj, "getGroup")):
 *         grp = cfa_obj.getGroup("root")             # <<<<<<<<<<<<<<
 *     else:
 *         grp = cfa_obj
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_obj, __pyx_n_s_getGroup); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_u_root) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_root);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_grp = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":904
 *     # for the s3Dataset.  If the cfa_obj has no getGroup method then itself is
 *     # a group
 *     if (hasattr(cfa_obj, "getGroup")):             # <<<<<<<<<<<<<<
 *         grp = cfa_obj.getGroup("root")
 *     else:
 */
    goto __pyx_L5;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":907
 *         grp = cfa_obj.getGroup("root")
 *     else:
 *         grp = cfa_obj             # <<<<<<<<<<<<<<
 *     # Variables
 *     var_names_dims = ["    variables(dimensions): "]
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_cfa_obj);
    __pyx_v_grp = __pyx_v_cfa_obj;
  }
  __pyx_L5:;

  /* "S3netCDF4/_s3netCDF4.pyx":909
 *         grp = cfa_obj
 *     # Variables
 *     var_names_dims = ["    variables(dimensions): "]             # <<<<<<<<<<<<<<
 *     # Dimensions
 *     dim_names_sizes = ["    dimensions(sizes): "]
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_kp_u_variables_dimensions);
  __Pyx_GIVEREF(__pyx_kp_u_variables_dimensions);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_variables_dimensions);
  __pyx_v_var_names_dims = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":911
 *     var_names_dims = ["    variables(dimensions): "]
 *     # Dimensions
 *     dim_names_sizes = ["    dimensions(sizes): "]             # <<<<<<<<<<<<<<
 *     for d in grp.getDimensions():
 *         cfa_dim = grp.getDimension(d)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_kp_u_dimensions_sizes);
  __Pyx_GIVEREF(__pyx_kp_u_dimensions_sizes);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_dimensions_sizes);
  __pyx_v_dim_names_sizes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":912
 *     # Dimensions
 *     dim_names_sizes = ["    dimensions(sizes): "]
 *     for d in grp.getDimensions():             # <<<<<<<<<<<<<<
 *         cfa_dim = grp.getDimension(d)
 *         dim_names_sizes.append("{}({}), ".format(d, cfa_dim.getLen()))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_getDimensions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 912, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 912, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 912, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":913
 *     dim_names_sizes = ["    dimensions(sizes): "]
 *     for d in grp.getDimensions():
 *         cfa_dim = grp.getDimension(d)             # <<<<<<<<<<<<<<
 *         dim_names_sizes.append("{}({}), ".format(d, cfa_dim.getLen()))
 *         # we have to add the dimension variables as well (to the
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_getDimension); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_v_d) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_d);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cfa_dim, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":914
 *     for d in grp.getDimensions():
 *         cfa_dim = grp.getDimension(d)
 *         dim_names_sizes.append("{}({}), ".format(d, cfa_dim.getLen()))             # <<<<<<<<<<<<<<
 *         # we have to add the dimension variables as well (to the
 *         # var_names_dims) as they are only stored as Dimensions in CFA
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__7, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_dim, __pyx_n_s_getLen); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_9 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_d, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_d, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_d);
      __Pyx_GIVEREF(__pyx_v_d);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_d);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __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_t_10 = __Pyx_PyList_Append(__pyx_v_dim_names_sizes, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 914, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":917
 *         # we have to add the dimension variables as well (to the
 *         # var_names_dims) as they are only stored as Dimensions in CFA
 *         if cfa_dim.getType():             # <<<<<<<<<<<<<<
 *             var_names_dims.append("{} {}({}), ". format(
 *                 cfa_dim.getType(), d, d
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_dim, __pyx_n_s_getType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 917, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_12) {

      /* "S3netCDF4/_s3netCDF4.pyx":918
 *         # var_names_dims) as they are only stored as Dimensions in CFA
 *         if cfa_dim.getType():
 *             var_names_dims.append("{} {}({}), ". format(             # <<<<<<<<<<<<<<
 *                 cfa_dim.getType(), d, d
 *             )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__8, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 918, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "S3netCDF4/_s3netCDF4.pyx":919
 *         if cfa_dim.getType():
 *             var_names_dims.append("{} {}({}), ". format(
 *                 cfa_dim.getType(), d, d             # <<<<<<<<<<<<<<
 *             )
 *     )
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_dim, __pyx_n_s_getType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 919, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_8 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_7, __pyx_v_d, __pyx_v_d};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 918, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_7, __pyx_v_d, __pyx_v_d};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 918, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 918, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_t_7);
        __Pyx_INCREF(__pyx_v_d);
        __Pyx_GIVEREF(__pyx_v_d);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_v_d);
        __Pyx_INCREF(__pyx_v_d);
        __Pyx_GIVEREF(__pyx_v_d);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_d);
        __pyx_t_7 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 918, __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;

      /* "S3netCDF4/_s3netCDF4.pyx":918
 *         # var_names_dims) as they are only stored as Dimensions in CFA
 *         if cfa_dim.getType():
 *             var_names_dims.append("{} {}({}), ". format(             # <<<<<<<<<<<<<<
 *                 cfa_dim.getType(), d, d
 *             )
 */
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_var_names_dims, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 918, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":917
 *         # we have to add the dimension variables as well (to the
 *         # var_names_dims) as they are only stored as Dimensions in CFA
 *         if cfa_dim.getType():             # <<<<<<<<<<<<<<
 *             var_names_dims.append("{} {}({}), ". format(
 *                 cfa_dim.getType(), d, d
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":912
 *     # Dimensions
 *     dim_names_sizes = ["    dimensions(sizes): "]
 *     for d in grp.getDimensions():             # <<<<<<<<<<<<<<
 *         cfa_dim = grp.getDimension(d)
 *         dim_names_sizes.append("{}({}), ".format(d, cfa_dim.getLen()))
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":923
 *     )
 *     # trim the comma, add a line break
 *     if len(dim_names_sizes) > 1:             # <<<<<<<<<<<<<<
 *         dim_names_sizes[-1] = dim_names_sizes[-1][0:-2]
 *     dim_names_sizes.append("\n")
 */
  __pyx_t_4 = PyList_GET_SIZE(__pyx_v_dim_names_sizes); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 923, __pyx_L1_error)
  __pyx_t_12 = ((__pyx_t_4 > 1) != 0);
  if (__pyx_t_12) {

    /* "S3netCDF4/_s3netCDF4.pyx":924
 *     # trim the comma, add a line break
 *     if len(dim_names_sizes) > 1:
 *         dim_names_sizes[-1] = dim_names_sizes[-1][0:-2]             # <<<<<<<<<<<<<<
 *     dim_names_sizes.append("\n")
 *     ncdump.extend(dim_names_sizes)
 */
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_dim_names_sizes, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, -2L, NULL, NULL, &__pyx_slice__9, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__Pyx_SetItemInt(__pyx_v_dim_names_sizes, -1L, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 924, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":923
 *     )
 *     # trim the comma, add a line break
 *     if len(dim_names_sizes) > 1:             # <<<<<<<<<<<<<<
 *         dim_names_sizes[-1] = dim_names_sizes[-1][0:-2]
 *     dim_names_sizes.append("\n")
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":925
 *     if len(dim_names_sizes) > 1:
 *         dim_names_sizes[-1] = dim_names_sizes[-1][0:-2]
 *     dim_names_sizes.append("\n")             # <<<<<<<<<<<<<<
 *     ncdump.extend(dim_names_sizes)
 * 
 */
  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_dim_names_sizes, __pyx_kp_u__10); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 925, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":926
 *         dim_names_sizes[-1] = dim_names_sizes[-1][0:-2]
 *     dim_names_sizes.append("\n")
 *     ncdump.extend(dim_names_sizes)             # <<<<<<<<<<<<<<
 * 
 *     # we have to add the dimension variables as well, which are only stored
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ncdump, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dim_names_sizes) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dim_names_sizes);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":930
 *     # we have to add the dimension variables as well, which are only stored
 *     # as Dimensions in CFA
 *     for v in grp.getVariables():             # <<<<<<<<<<<<<<
 *         cfa_var = grp.getVariable(v)
 *         var_names_dims.append("{} {}({}), ".format(
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_getVariables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 930, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 930, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 930, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 930, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":931
 *     # as Dimensions in CFA
 *     for v in grp.getVariables():
 *         cfa_var = grp.getVariable(v)             # <<<<<<<<<<<<<<
 *         var_names_dims.append("{} {}({}), ".format(
 *             cfa_var.getType(), v, ", ".join(cfa_var.getDimensions())
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_getVariable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_v);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cfa_var, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":932
 *     for v in grp.getVariables():
 *         cfa_var = grp.getVariable(v)
 *         var_names_dims.append("{} {}({}), ".format(             # <<<<<<<<<<<<<<
 *             cfa_var.getType(), v, ", ".join(cfa_var.getDimensions())
 *         )
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__8, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "S3netCDF4/_s3netCDF4.pyx":933
 *         cfa_var = grp.getVariable(v)
 *         var_names_dims.append("{} {}({}), ".format(
 *             cfa_var.getType(), v, ", ".join(cfa_var.getDimensions())             # <<<<<<<<<<<<<<
 *         )
 *     )
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_var, __pyx_n_s_getType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_var, __pyx_n_s_getDimensions); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_13 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_13)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
      }
    }
    __pyx_t_7 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyUnicode_Join(__pyx_kp_u__11, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, __pyx_v_v, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_6, __pyx_v_v, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else
    #endif
    {
      __pyx_t_13 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 932, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_8, __pyx_t_6);
      __Pyx_INCREF(__pyx_v_v);
      __Pyx_GIVEREF(__pyx_v_v);
      PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_8, __pyx_v_v);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_8, __pyx_t_9);
      __pyx_t_6 = 0;
      __pyx_t_9 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":932
 *     for v in grp.getVariables():
 *         cfa_var = grp.getVariable(v)
 *         var_names_dims.append("{} {}({}), ".format(             # <<<<<<<<<<<<<<
 *             cfa_var.getType(), v, ", ".join(cfa_var.getDimensions())
 *         )
 */
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_var_names_dims, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 932, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":930
 *     # we have to add the dimension variables as well, which are only stored
 *     # as Dimensions in CFA
 *     for v in grp.getVariables():             # <<<<<<<<<<<<<<
 *         cfa_var = grp.getVariable(v)
 *         var_names_dims.append("{} {}({}), ".format(
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":937
 *     )
 *     # trim the comma, add a line break
 *     if len(var_names_dims) > 1:             # <<<<<<<<<<<<<<
 *         var_names_dims[-1] = var_names_dims[-1][0:-2]
 *     var_names_dims.append("\n")
 */
  __pyx_t_4 = PyList_GET_SIZE(__pyx_v_var_names_dims); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 937, __pyx_L1_error)
  __pyx_t_12 = ((__pyx_t_4 > 1) != 0);
  if (__pyx_t_12) {

    /* "S3netCDF4/_s3netCDF4.pyx":938
 *     # trim the comma, add a line break
 *     if len(var_names_dims) > 1:
 *         var_names_dims[-1] = var_names_dims[-1][0:-2]             # <<<<<<<<<<<<<<
 *     var_names_dims.append("\n")
 *     ncdump.extend(var_names_dims)
 */
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_var_names_dims, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, -2L, NULL, NULL, &__pyx_slice__9, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__Pyx_SetItemInt(__pyx_v_var_names_dims, -1L, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 938, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":937
 *     )
 *     # trim the comma, add a line break
 *     if len(var_names_dims) > 1:             # <<<<<<<<<<<<<<
 *         var_names_dims[-1] = var_names_dims[-1][0:-2]
 *     var_names_dims.append("\n")
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":939
 *     if len(var_names_dims) > 1:
 *         var_names_dims[-1] = var_names_dims[-1][0:-2]
 *     var_names_dims.append("\n")             # <<<<<<<<<<<<<<
 *     ncdump.extend(var_names_dims)
 * 
 */
  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_var_names_dims, __pyx_kp_u__10); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 939, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":940
 *         var_names_dims[-1] = var_names_dims[-1][0:-2]
 *     var_names_dims.append("\n")
 *     ncdump.extend(var_names_dims)             # <<<<<<<<<<<<<<
 * 
 *     # add the group names, and cfa specific groups
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ncdump, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_var_names_dims) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_var_names_dims);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":943
 * 
 *     # add the group names, and cfa specific groups
 *     group_names = ["groups: "]             # <<<<<<<<<<<<<<
 *     cfa_group_names = ["cfa_groups: "]
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_kp_u_groups_2);
  __Pyx_GIVEREF(__pyx_kp_u_groups_2);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_groups_2);
  __pyx_v_group_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":944
 *     # add the group names, and cfa specific groups
 *     group_names = ["groups: "]
 *     cfa_group_names = ["cfa_groups: "]             # <<<<<<<<<<<<<<
 * 
 *     for g in nc_obj.groups:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_kp_u_cfa_groups);
  __Pyx_GIVEREF(__pyx_kp_u_cfa_groups);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cfa_groups);
  __pyx_v_cfa_group_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":946
 *     cfa_group_names = ["cfa_groups: "]
 * 
 *     for g in nc_obj.groups:             # <<<<<<<<<<<<<<
 *         # don't add cfa groups or the root group
 *         if not(g == "root"):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_obj, __pyx_n_s_groups); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 946, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 946, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 946, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 946, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":948
 *     for g in nc_obj.groups:
 *         # don't add cfa groups or the root group
 *         if not(g == "root"):             # <<<<<<<<<<<<<<
 *             if (g[0:4] == "cfa_"):
 *                 cfa_group_names.append("{}, ".format(g))
 */
    __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_g, __pyx_n_u_root, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 948, __pyx_L1_error)
    __pyx_t_11 = ((!__pyx_t_12) != 0);
    if (__pyx_t_11) {

      /* "S3netCDF4/_s3netCDF4.pyx":949
 *         # don't add cfa groups or the root group
 *         if not(g == "root"):
 *             if (g[0:4] == "cfa_"):             # <<<<<<<<<<<<<<
 *                 cfa_group_names.append("{}, ".format(g))
 *             else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_g, 0, 4, NULL, NULL, &__pyx_slice__12, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_cfa, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 949, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_11) {

        /* "S3netCDF4/_s3netCDF4.pyx":950
 *         if not(g == "root"):
 *             if (g[0:4] == "cfa_"):
 *                 cfa_group_names.append("{}, ".format(g))             # <<<<<<<<<<<<<<
 *             else:
 *                 group_names.append("{}, ".format(g))
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__13, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_13, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_g);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_cfa_group_names, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 950, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":949
 *         # don't add cfa groups or the root group
 *         if not(g == "root"):
 *             if (g[0:4] == "cfa_"):             # <<<<<<<<<<<<<<
 *                 cfa_group_names.append("{}, ".format(g))
 *             else:
 */
        goto __pyx_L16;
      }

      /* "S3netCDF4/_s3netCDF4.pyx":952
 *                 cfa_group_names.append("{}, ".format(g))
 *             else:
 *                 group_names.append("{}, ".format(g))             # <<<<<<<<<<<<<<
 * 
 *     if len(group_names) > 1:
 */
      /*else*/ {
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__13, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 952, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_13, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_g);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_group_names, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 952, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L16:;

      /* "S3netCDF4/_s3netCDF4.pyx":948
 *     for g in nc_obj.groups:
 *         # don't add cfa groups or the root group
 *         if not(g == "root"):             # <<<<<<<<<<<<<<
 *             if (g[0:4] == "cfa_"):
 *                 cfa_group_names.append("{}, ".format(g))
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":946
 *     cfa_group_names = ["cfa_groups: "]
 * 
 *     for g in nc_obj.groups:             # <<<<<<<<<<<<<<
 *         # don't add cfa groups or the root group
 *         if not(g == "root"):
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":954
 *                 group_names.append("{}, ".format(g))
 * 
 *     if len(group_names) > 1:             # <<<<<<<<<<<<<<
 *         group_names[-1] = group_names[-1][0:-2]
 *     group_names.append("\n")
 */
  __pyx_t_4 = PyList_GET_SIZE(__pyx_v_group_names); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 954, __pyx_L1_error)
  __pyx_t_11 = ((__pyx_t_4 > 1) != 0);
  if (__pyx_t_11) {

    /* "S3netCDF4/_s3netCDF4.pyx":955
 * 
 *     if len(group_names) > 1:
 *         group_names[-1] = group_names[-1][0:-2]             # <<<<<<<<<<<<<<
 *     group_names.append("\n")
 *     ncdump.extend(group_names)
 */
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_group_names, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, -2L, NULL, NULL, &__pyx_slice__9, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__Pyx_SetItemInt(__pyx_v_group_names, -1L, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 955, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":954
 *                 group_names.append("{}, ".format(g))
 * 
 *     if len(group_names) > 1:             # <<<<<<<<<<<<<<
 *         group_names[-1] = group_names[-1][0:-2]
 *     group_names.append("\n")
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":956
 *     if len(group_names) > 1:
 *         group_names[-1] = group_names[-1][0:-2]
 *     group_names.append("\n")             # <<<<<<<<<<<<<<
 *     ncdump.extend(group_names)
 * 
 */
  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_group_names, __pyx_kp_u__10); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 956, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":957
 *         group_names[-1] = group_names[-1][0:-2]
 *     group_names.append("\n")
 *     ncdump.extend(group_names)             # <<<<<<<<<<<<<<
 * 
 *     if len(cfa_group_names) > 1:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ncdump, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_group_names) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_group_names);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":959
 *     ncdump.extend(group_names)
 * 
 *     if len(cfa_group_names) > 1:             # <<<<<<<<<<<<<<
 *         cfa_group_names[-1] = cfa_group_names[-1][0:-2]
 *     ncdump.extend(cfa_group_names)
 */
  __pyx_t_4 = PyList_GET_SIZE(__pyx_v_cfa_group_names); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 959, __pyx_L1_error)
  __pyx_t_11 = ((__pyx_t_4 > 1) != 0);
  if (__pyx_t_11) {

    /* "S3netCDF4/_s3netCDF4.pyx":960
 * 
 *     if len(cfa_group_names) > 1:
 *         cfa_group_names[-1] = cfa_group_names[-1][0:-2]             # <<<<<<<<<<<<<<
 *     ncdump.extend(cfa_group_names)
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_cfa_group_names, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -2L, NULL, NULL, &__pyx_slice__9, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(__Pyx_SetItemInt(__pyx_v_cfa_group_names, -1L, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 960, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":959
 *     ncdump.extend(group_names)
 * 
 *     if len(cfa_group_names) > 1:             # <<<<<<<<<<<<<<
 *         cfa_group_names[-1] = cfa_group_names[-1][0:-2]
 *     ncdump.extend(cfa_group_names)
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":961
 *     if len(cfa_group_names) > 1:
 *         cfa_group_names[-1] = cfa_group_names[-1][0:-2]
 *     ncdump.extend(cfa_group_names)             # <<<<<<<<<<<<<<
 * 
 *     return ncdump
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ncdump, __pyx_n_s_extend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_cfa_group_names) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_cfa_group_names);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":963
 *     ncdump.extend(cfa_group_names)
 * 
 *     return ncdump             # <<<<<<<<<<<<<<
 * 
 * class s3Group(object):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ncdump);
  __pyx_r = __pyx_v_ncdump;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":892
 * 
 * # Function below is for s3Group and s3Dataset classes
 * def _group_and_dataset_repr(ncdump, cfa_obj, nc_obj):             # <<<<<<<<<<<<<<
 *     """This is a generalised function to generate a list to be used in the
 *     __repr__ strings for both s3Groups and s3Datasets, as the code is largely
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4._group_and_dataset_repr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cfa_meta);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_grp);
  __Pyx_XDECREF(__pyx_v_var_names_dims);
  __Pyx_XDECREF(__pyx_v_dim_names_sizes);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_cfa_dim);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_cfa_var);
  __Pyx_XDECREF(__pyx_v_group_names);
  __Pyx_XDECREF(__pyx_v_cfa_group_names);
  __Pyx_XDECREF(__pyx_v_g);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":974
 *                      "_s3_variables", "_s3_dimensions"]
 * 
 *     def __init__(self, nc_grp=None, cfa_grp=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the class, any loading of the variables will be done
 *         by the parser, or the CreateGroup member of s3Dataset."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group___init__[] = "Just initialise the class, any loading of the variables will be done\n        by the parser, or the CreateGroup member of s3Dataset.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group___init__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_nc_grp = 0;
  PyObject *__pyx_v_cfa_grp = 0;
  PyObject *__pyx_v_parent = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_nc_grp_2,&__pyx_n_s_cfa_grp_2,&__pyx_n_s_parent,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc_grp_2);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfa_grp_2);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 974, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_nc_grp = values[1];
    __pyx_v_cfa_grp = values[2];
    __pyx_v_parent = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 974, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group___init__(__pyx_self, __pyx_v_self, __pyx_v_nc_grp, __pyx_v_cfa_grp, __pyx_v_parent);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nc_grp, PyObject *__pyx_v_cfa_grp, PyObject *__pyx_v_parent) {
  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("__init__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":977
 *         """Just initialise the class, any loading of the variables will be done
 *         by the parser, or the CreateGroup member of s3Dataset."""
 *         self._nc_grp = nc_grp             # <<<<<<<<<<<<<<
 *         self._cfa_grp = cfa_grp
 *         self.parent = parent
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp, __pyx_v_nc_grp) < 0) __PYX_ERR(0, 977, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":978
 *         by the parser, or the CreateGroup member of s3Dataset."""
 *         self._nc_grp = nc_grp
 *         self._cfa_grp = cfa_grp             # <<<<<<<<<<<<<<
 *         self.parent = parent
 *         self._s3_variables = {}
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp, __pyx_v_cfa_grp) < 0) __PYX_ERR(0, 978, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":979
 *         self._nc_grp = nc_grp
 *         self._cfa_grp = cfa_grp
 *         self.parent = parent             # <<<<<<<<<<<<<<
 *         self._s3_variables = {}
 *         self._s3_dimensions = {}
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 979, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":980
 *         self._cfa_grp = cfa_grp
 *         self.parent = parent
 *         self._s3_variables = {}             # <<<<<<<<<<<<<<
 *         self._s3_dimensions = {}
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_s3_variables, __pyx_t_1) < 0) __PYX_ERR(0, 980, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":981
 *         self.parent = parent
 *         self._s3_variables = {}
 *         self._s3_dimensions = {}             # <<<<<<<<<<<<<<
 * 
 *     def create(self, parent, name, **kwargs):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_s3_dimensions, __pyx_t_1) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":974
 *                      "_s3_variables", "_s3_dimensions"]
 * 
 *     def __init__(self, nc_grp=None, cfa_grp=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the class, any loading of the variables will be done
 *         by the parser, or the CreateGroup member of s3Dataset."""
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":983
 *         self._s3_dimensions = {}
 * 
 *     def create(self, parent, name, **kwargs):             # <<<<<<<<<<<<<<
 *         """Initialise the group.  This adds the CFAGroup structure to the
 *         group as well as initialising the composed class."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_3create(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_2create[] = "Initialise the group.  This adds the CFAGroup structure to the\n        group as well as initialising the composed class.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_3create = {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_3create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_2create};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_3create(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_parent = 0;
  PyObject *__pyx_v_name = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_parent,&__pyx_n_s_name,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create", 1, 3, 3, 1); __PYX_ERR(0, 983, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create", 1, 3, 3, 2); __PYX_ERR(0, 983, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "create") < 0)) __PYX_ERR(0, 983, __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_self = values[0];
    __pyx_v_parent = values[1];
    __pyx_v_name = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 983, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_2create(__pyx_self, __pyx_v_self, __pyx_v_parent, __pyx_v_name, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_2create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":987
 *         group as well as initialising the composed class."""
 *         # Has this been called from a group?
 *         if hasattr(parent, "_cfa_dataset") and parent._cfa_dataset:             # <<<<<<<<<<<<<<
 *             self._cfa_grp = parent._cfa_dataset.createGroup(name)
 *         else:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_parent, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 987, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":988
 *         # Has this been called from a group?
 *         if hasattr(parent, "_cfa_dataset") and parent._cfa_dataset:
 *             self._cfa_grp = parent._cfa_dataset.createGroup(name)             # <<<<<<<<<<<<<<
 *         else:
 *             self._cfa_grp = None
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_createGroup); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp, __pyx_t_4) < 0) __PYX_ERR(0, 988, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":987
 *         group as well as initialising the composed class."""
 *         # Has this been called from a group?
 *         if hasattr(parent, "_cfa_dataset") and parent._cfa_dataset:             # <<<<<<<<<<<<<<
 *             self._cfa_grp = parent._cfa_dataset.createGroup(name)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":990
 *             self._cfa_grp = parent._cfa_dataset.createGroup(name)
 *         else:
 *             self._cfa_grp = None             # <<<<<<<<<<<<<<
 *         # create netCDF group
 *         self._nc_grp  = parent._nc_dataset.createGroup(name)
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp, Py_None) < 0) __PYX_ERR(0, 990, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":992
 *             self._cfa_grp = None
 *         # create netCDF group
 *         self._nc_grp  = parent._nc_dataset.createGroup(name)             # <<<<<<<<<<<<<<
 *         # record the parent
 *         self.parent = parent
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_createGroup); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp, __pyx_t_4) < 0) __PYX_ERR(0, 992, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":994
 *         self._nc_grp  = parent._nc_dataset.createGroup(name)
 *         # record the parent
 *         self.parent = parent             # <<<<<<<<<<<<<<
 * 
 *     def createDimension(self, dimname, size=None,
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parent, __pyx_v_parent) < 0) __PYX_ERR(0, 994, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":983
 *         self._s3_dimensions = {}
 * 
 *     def create(self, parent, name, **kwargs):             # <<<<<<<<<<<<<<
 *         """Initialise the group.  This adds the CFAGroup structure to the
 *         group as well as initialising the composed class."""
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":996
 *         self.parent = parent
 * 
 *     def createDimension(self, dimname, size=None,             # <<<<<<<<<<<<<<
 *                         axis_type="U", metadata={}):
 *         """Create a dimension in the group.  Add the CFADimension structure to
 */

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject*)__pyx_n_u_U));
  __Pyx_GIVEREF(((PyObject*)__pyx_n_u_U));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_u_U));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_metadata);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_metadata);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_metadata);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 996, __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(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_5createDimension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_4createDimension[] = "Create a dimension in the group.  Add the CFADimension structure to\n        the group by calling createDimension on self._cfa_grp.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_5createDimension = {"createDimension", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_5createDimension, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_4createDimension};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_5createDimension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_dimname = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_axis_type = 0;
  PyObject *__pyx_v_metadata = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createDimension (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dimname,&__pyx_n_s_size,&__pyx_n_s_axis_type,&__pyx_n_s_metadata,0};
    PyObject* values[5] = {0,0,0,0,0};
    __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject*)__pyx_n_u_U));
    values[4] = __pyx_dynamic_args->__pyx_arg_metadata;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dimname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createDimension", 0, 2, 5, 1); __PYX_ERR(0, 996, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_axis_type);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDimension") < 0)) __PYX_ERR(0, 996, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_dimname = values[1];
    __pyx_v_size = values[2];
    __pyx_v_axis_type = values[3];
    __pyx_v_metadata = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createDimension", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 996, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.createDimension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_4createDimension(__pyx_self, __pyx_v_self, __pyx_v_dimname, __pyx_v_size, __pyx_v_axis_type, __pyx_v_metadata);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_4createDimension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dimname, PyObject *__pyx_v_size, PyObject *__pyx_v_axis_type, PyObject *__pyx_v_metadata) {
  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;
  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("createDimension", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1000
 *         """Create a dimension in the group.  Add the CFADimension structure to
 *         the group by calling createDimension on self._cfa_grp."""
 *         if dimname in self._nc_grp.dimensions:             # <<<<<<<<<<<<<<
 *             raise APIException(
 *                 "Dimension name: {} already exists.".format(dimname)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_dimname, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (unlikely(__pyx_t_4)) {

    /* "S3netCDF4/_s3netCDF4.pyx":1001
 *         the group by calling createDimension on self._cfa_grp."""
 *         if dimname in self._nc_grp.dimensions:
 *             raise APIException(             # <<<<<<<<<<<<<<
 *                 "Dimension name: {} already exists.".format(dimname)
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_APIException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "S3netCDF4/_s3netCDF4.pyx":1002
 *         if dimname in self._nc_grp.dimensions:
 *             raise APIException(
 *                 "Dimension name: {} already exists.".format(dimname)             # <<<<<<<<<<<<<<
 *             )
 *         self._s3_dimensions[dimname] = s3Dimension()
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Dimension_name_already_exists, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1002, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_dimname) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_dimname);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1002, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1001, __pyx_L1_error)

    /* "S3netCDF4/_s3netCDF4.pyx":1000
 *         """Create a dimension in the group.  Add the CFADimension structure to
 *         the group by calling createDimension on self._cfa_grp."""
 *         if dimname in self._nc_grp.dimensions:             # <<<<<<<<<<<<<<
 *             raise APIException(
 *                 "Dimension name: {} already exists.".format(dimname)
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1004
 *                 "Dimension name: {} already exists.".format(dimname)
 *             )
 *         self._s3_dimensions[dimname] = s3Dimension()             # <<<<<<<<<<<<<<
 *         self._s3_dimensions[dimname].create(
 *             self,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_s3Dimension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_dimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_dimname, __pyx_t_2) < 0)) __PYX_ERR(0, 1004, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1005
 *             )
 *         self._s3_dimensions[dimname] = s3Dimension()
 *         self._s3_dimensions[dimname].create(             # <<<<<<<<<<<<<<
 *             self,
 *             dimname,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_dimensions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_dimname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1007
 *         self._s3_dimensions[dimname].create(
 *             self,
 *             dimname,             # <<<<<<<<<<<<<<
 *             size=size,
 *             axis_type=axis_type,
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_INCREF(__pyx_v_dimname);
  __Pyx_GIVEREF(__pyx_v_dimname);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dimname);

  /* "S3netCDF4/_s3netCDF4.pyx":1008
 *             self,
 *             dimname,
 *             size=size,             # <<<<<<<<<<<<<<
 *             axis_type=axis_type,
 *             metadata=metadata
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_size, __pyx_v_size) < 0) __PYX_ERR(0, 1008, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1009
 *             dimname,
 *             size=size,
 *             axis_type=axis_type,             # <<<<<<<<<<<<<<
 *             metadata=metadata
 *         )
 */
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_axis_type, __pyx_v_axis_type) < 0) __PYX_ERR(0, 1008, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1010
 *             size=size,
 *             axis_type=axis_type,
 *             metadata=metadata             # <<<<<<<<<<<<<<
 *         )
 *         return self._s3_dimensions[dimname]
 */
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(0, 1008, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1005
 *             )
 *         self._s3_dimensions[dimname] = s3Dimension()
 *         self._s3_dimensions[dimname].create(             # <<<<<<<<<<<<<<
 *             self,
 *             dimname,
 */
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1005, __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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1012
 *             metadata=metadata
 *         )
 *         return self._s3_dimensions[dimname]             # <<<<<<<<<<<<<<
 * 
 *     def renameDimension(self, oldname, newname):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_dimensions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_dimname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":996
 *         self.parent = parent
 * 
 *     def createDimension(self, dimname, size=None,             # <<<<<<<<<<<<<<
 *                         axis_type="U", metadata={}):
 *         """Create a dimension in the group.  Add the CFADimension structure to
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.createDimension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1014
 *         return self._s3_dimensions[dimname]
 * 
 *     def renameDimension(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the dimension by overloading the base method."""
 *         if self._cfa_grp:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_7renameDimension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_6renameDimension[] = "Rename the dimension by overloading the base method.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_7renameDimension = {"renameDimension", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_7renameDimension, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_6renameDimension};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_7renameDimension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_oldname = 0;
  PyObject *__pyx_v_newname = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("renameDimension (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldname,&__pyx_n_s_newname,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_oldname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renameDimension", 1, 3, 3, 1); __PYX_ERR(0, 1014, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_newname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renameDimension", 1, 3, 3, 2); __PYX_ERR(0, 1014, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameDimension") < 0)) __PYX_ERR(0, 1014, __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_self = values[0];
    __pyx_v_oldname = values[1];
    __pyx_v_newname = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("renameDimension", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1014, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.renameDimension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_6renameDimension(__pyx_self, __pyx_v_self, __pyx_v_oldname, __pyx_v_newname);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_6renameDimension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname) {
  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_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("renameDimension", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1016
 *     def renameDimension(self, oldname, newname):
 *         """Rename the dimension by overloading the base method."""
 *         if self._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_grp.renameDimension(oldname, newname)
 *         self._nc_grp.renameDimension(oldname, newname)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1016, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "S3netCDF4/_s3netCDF4.pyx":1017
 *         """Rename the dimension by overloading the base method."""
 *         if self._cfa_grp:
 *             self._cfa_grp.renameDimension(oldname, newname)             # <<<<<<<<<<<<<<
 *         self._nc_grp.renameDimension(oldname, newname)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_renameDimension); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_oldname, __pyx_v_newname};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_oldname, __pyx_v_newname};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1017, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_oldname);
      __Pyx_GIVEREF(__pyx_v_oldname);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_oldname);
      __Pyx_INCREF(__pyx_v_newname);
      __Pyx_GIVEREF(__pyx_v_newname);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_newname);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __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;

    /* "S3netCDF4/_s3netCDF4.pyx":1016
 *     def renameDimension(self, oldname, newname):
 *         """Rename the dimension by overloading the base method."""
 *         if self._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_grp.renameDimension(oldname, newname)
 *         self._nc_grp.renameDimension(oldname, newname)
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1018
 *         if self._cfa_grp:
 *             self._cfa_grp.renameDimension(oldname, newname)
 *         self._nc_grp.renameDimension(oldname, newname)             # <<<<<<<<<<<<<<
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_renameDimension); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_oldname, __pyx_v_newname};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_oldname, __pyx_v_newname};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_oldname);
    __Pyx_GIVEREF(__pyx_v_oldname);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_oldname);
    __Pyx_INCREF(__pyx_v_newname);
    __Pyx_GIVEREF(__pyx_v_newname);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_newname);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1014
 *         return self._s3_dimensions[dimname]
 * 
 *     def renameDimension(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the dimension by overloading the base method."""
 *         if self._cfa_grp:
 */

  /* 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_6);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.renameDimension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1020
 *         self._nc_grp.renameDimension(oldname, newname)
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *                        complevel=4, shuffle=True, fletcher32=False,
 *                        contiguous=False, chunksizes=None, endian='native',
 */

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

  /* "S3netCDF4/_s3netCDF4.pyx":1024
 *                        contiguous=False, chunksizes=None, endian='native',
 *                        least_significant_digit=None, fill_value=None,
 *                        chunk_cache=None, subarray_shape=np.array([]),             # <<<<<<<<<<<<<<
 *                        max_subarray_size=0):
 *         """Create a variable in the Group.  Add the CFAVariable structure to
 */
  __pyx_t_1 = PyTuple_New(13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject*)__pyx_empty_tuple));
  __Pyx_GIVEREF(((PyObject*)__pyx_empty_tuple));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)__pyx_empty_tuple));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)__pyx_int_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_4));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_4));
  __Pyx_INCREF(((PyObject *)Py_True));
  __Pyx_GIVEREF(((PyObject *)Py_True));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_True));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject*)__pyx_n_u_native));
  __Pyx_GIVEREF(((PyObject*)__pyx_n_u_native));
  PyTuple_SET_ITEM(__pyx_t_1, 7, ((PyObject*)__pyx_n_u_native));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 8, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 9, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 10, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_subarray_shape);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_subarray_shape);
  PyTuple_SET_ITEM(__pyx_t_1, 11, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_subarray_shape);
  __Pyx_INCREF(((PyObject *)__pyx_int_0));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_0));
  PyTuple_SET_ITEM(__pyx_t_1, 12, ((PyObject *)__pyx_int_0));

  /* "S3netCDF4/_s3netCDF4.pyx":1020
 *         self._nc_grp.renameDimension(oldname, newname)
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *                        complevel=4, shuffle=True, fletcher32=False,
 *                        contiguous=False, chunksizes=None, endian='native',
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __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(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_9createVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_8createVariable[] = "Create a variable in the Group.  Add the CFAVariable structure to\n        the group by calling createVariable on self._cfa_grp.\n        ";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_9createVariable = {"createVariable", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_9createVariable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_8createVariable};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_9createVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_varname = 0;
  PyObject *__pyx_v_datatype = 0;
  PyObject *__pyx_v_dimensions = 0;
  PyObject *__pyx_v_zlib = 0;
  PyObject *__pyx_v_complevel = 0;
  PyObject *__pyx_v_shuffle = 0;
  PyObject *__pyx_v_fletcher32 = 0;
  PyObject *__pyx_v_contiguous = 0;
  PyObject *__pyx_v_chunksizes = 0;
  PyObject *__pyx_v_endian = 0;
  PyObject *__pyx_v_least_significant_digit = 0;
  PyObject *__pyx_v_fill_value = 0;
  PyObject *__pyx_v_chunk_cache = 0;
  PyObject *__pyx_v_subarray_shape = 0;
  PyObject *__pyx_v_max_subarray_size = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createVariable (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_varname,&__pyx_n_s_datatype,&__pyx_n_s_dimensions,&__pyx_n_s_zlib,&__pyx_n_s_complevel,&__pyx_n_s_shuffle,&__pyx_n_s_fletcher32,&__pyx_n_s_contiguous,&__pyx_n_s_chunksizes,&__pyx_n_s_endian,&__pyx_n_s_least_significant_digit,&__pyx_n_s_fill_value,&__pyx_n_s_chunk_cache,&__pyx_n_s_subarray_shape,&__pyx_n_s_max_subarray_size,0};
    PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self);
    values[3] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    values[4] = ((PyObject *)((PyObject *)Py_False));
    values[5] = ((PyObject *)((PyObject *)__pyx_int_4));
    values[6] = ((PyObject *)((PyObject *)Py_True));
    values[7] = ((PyObject *)((PyObject *)Py_False));
    values[8] = ((PyObject *)((PyObject *)Py_False));
    values[9] = ((PyObject *)((PyObject *)Py_None));
    values[10] = ((PyObject *)((PyObject*)__pyx_n_u_native));
    values[11] = ((PyObject *)((PyObject *)Py_None));
    values[12] = ((PyObject *)((PyObject *)Py_None));
    values[13] = ((PyObject *)((PyObject *)Py_None));
    values[14] = __pyx_dynamic_args->__pyx_arg_subarray_shape;
    values[15] = ((PyObject *)((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 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_varname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createVariable", 0, 3, 16, 1); __PYX_ERR(0, 1020, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_datatype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createVariable", 0, 3, 16, 2); __PYX_ERR(0, 1020, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dimensions);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zlib);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_complevel);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shuffle);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fletcher32);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_contiguous);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chunksizes);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_endian);
          if (value) { values[10] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_least_significant_digit);
          if (value) { values[11] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[12] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chunk_cache);
          if (value) { values[13] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subarray_shape);
          if (value) { values[14] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_subarray_size);
          if (value) { values[15] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createVariable") < 0)) __PYX_ERR(0, 1020, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_self = values[0];
    __pyx_v_varname = values[1];
    __pyx_v_datatype = values[2];
    __pyx_v_dimensions = values[3];
    __pyx_v_zlib = values[4];
    __pyx_v_complevel = values[5];
    __pyx_v_shuffle = values[6];
    __pyx_v_fletcher32 = values[7];
    __pyx_v_contiguous = values[8];
    __pyx_v_chunksizes = values[9];
    __pyx_v_endian = values[10];
    __pyx_v_least_significant_digit = values[11];
    __pyx_v_fill_value = values[12];
    __pyx_v_chunk_cache = values[13];
    __pyx_v_subarray_shape = values[14];
    __pyx_v_max_subarray_size = values[15];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createVariable", 0, 3, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1020, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.createVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_8createVariable(__pyx_self, __pyx_v_self, __pyx_v_varname, __pyx_v_datatype, __pyx_v_dimensions, __pyx_v_zlib, __pyx_v_complevel, __pyx_v_shuffle, __pyx_v_fletcher32, __pyx_v_contiguous, __pyx_v_chunksizes, __pyx_v_endian, __pyx_v_least_significant_digit, __pyx_v_fill_value, __pyx_v_chunk_cache, __pyx_v_subarray_shape, __pyx_v_max_subarray_size);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_8createVariable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_varname, PyObject *__pyx_v_datatype, PyObject *__pyx_v_dimensions, PyObject *__pyx_v_zlib, PyObject *__pyx_v_complevel, PyObject *__pyx_v_shuffle, PyObject *__pyx_v_fletcher32, PyObject *__pyx_v_contiguous, PyObject *__pyx_v_chunksizes, PyObject *__pyx_v_endian, PyObject *__pyx_v_least_significant_digit, PyObject *__pyx_v_fill_value, PyObject *__pyx_v_chunk_cache, PyObject *__pyx_v_subarray_shape, PyObject *__pyx_v_max_subarray_size) {
  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("createVariable", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1029
 *         the group by calling createVariable on self._cfa_grp.
 *         """
 *         self._s3_variables[varname] = s3Variable()             # <<<<<<<<<<<<<<
 *         self._s3_variables[varname].create(
 *             self,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_s3Variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_varname, __pyx_t_1) < 0)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1030
 *         """
 *         self._s3_variables[varname] = s3Variable()
 *         self._s3_variables[varname].create(             # <<<<<<<<<<<<<<
 *             self,
 *             varname,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_varname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1033
 *             self,
 *             varname,
 *             datatype,             # <<<<<<<<<<<<<<
 *             dimensions=dimensions,
 *             zlib=zlib,
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
  __Pyx_INCREF(__pyx_v_varname);
  __Pyx_GIVEREF(__pyx_v_varname);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_varname);
  __Pyx_INCREF(__pyx_v_datatype);
  __Pyx_GIVEREF(__pyx_v_datatype);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_datatype);

  /* "S3netCDF4/_s3netCDF4.pyx":1034
 *             varname,
 *             datatype,
 *             dimensions=dimensions,             # <<<<<<<<<<<<<<
 *             zlib=zlib,
 *             complevel=complevel,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dimensions, __pyx_v_dimensions) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1035
 *             datatype,
 *             dimensions=dimensions,
 *             zlib=zlib,             # <<<<<<<<<<<<<<
 *             complevel=complevel,
 *             shuffle=shuffle,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_zlib, __pyx_v_zlib) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1036
 *             dimensions=dimensions,
 *             zlib=zlib,
 *             complevel=complevel,             # <<<<<<<<<<<<<<
 *             shuffle=shuffle,
 *             fletcher32=fletcher32,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_complevel, __pyx_v_complevel) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1037
 *             zlib=zlib,
 *             complevel=complevel,
 *             shuffle=shuffle,             # <<<<<<<<<<<<<<
 *             fletcher32=fletcher32,
 *             contiguous=contiguous,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1038
 *             complevel=complevel,
 *             shuffle=shuffle,
 *             fletcher32=fletcher32,             # <<<<<<<<<<<<<<
 *             contiguous=contiguous,
 *             chunksizes=chunksizes,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fletcher32, __pyx_v_fletcher32) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1039
 *             shuffle=shuffle,
 *             fletcher32=fletcher32,
 *             contiguous=contiguous,             # <<<<<<<<<<<<<<
 *             chunksizes=chunksizes,
 *             endian=endian,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_contiguous, __pyx_v_contiguous) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1040
 *             fletcher32=fletcher32,
 *             contiguous=contiguous,
 *             chunksizes=chunksizes,             # <<<<<<<<<<<<<<
 *             endian=endian,
 *             least_significant_digit=least_significant_digit,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chunksizes, __pyx_v_chunksizes) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1041
 *             contiguous=contiguous,
 *             chunksizes=chunksizes,
 *             endian=endian,             # <<<<<<<<<<<<<<
 *             least_significant_digit=least_significant_digit,
 *             fill_value=fill_value,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_endian, __pyx_v_endian) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1042
 *             chunksizes=chunksizes,
 *             endian=endian,
 *             least_significant_digit=least_significant_digit,             # <<<<<<<<<<<<<<
 *             fill_value=fill_value,
 *             chunk_cache=chunk_cache,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_least_significant_digit, __pyx_v_least_significant_digit) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1043
 *             endian=endian,
 *             least_significant_digit=least_significant_digit,
 *             fill_value=fill_value,             # <<<<<<<<<<<<<<
 *             chunk_cache=chunk_cache,
 *             subarray_shape=subarray_shape,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fill_value, __pyx_v_fill_value) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1044
 *             least_significant_digit=least_significant_digit,
 *             fill_value=fill_value,
 *             chunk_cache=chunk_cache,             # <<<<<<<<<<<<<<
 *             subarray_shape=subarray_shape,
 *             max_subarray_size=max_subarray_size
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chunk_cache, __pyx_v_chunk_cache) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1045
 *             fill_value=fill_value,
 *             chunk_cache=chunk_cache,
 *             subarray_shape=subarray_shape,             # <<<<<<<<<<<<<<
 *             max_subarray_size=max_subarray_size
 *         )
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_subarray_shape, __pyx_v_subarray_shape) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1046
 *             chunk_cache=chunk_cache,
 *             subarray_shape=subarray_shape,
 *             max_subarray_size=max_subarray_size             # <<<<<<<<<<<<<<
 *         )
 *         return self._s3_variables[varname]
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_max_subarray_size, __pyx_v_max_subarray_size) < 0) __PYX_ERR(0, 1034, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1030
 *         """
 *         self._s3_variables[varname] = s3Variable()
 *         self._s3_variables[varname].create(             # <<<<<<<<<<<<<<
 *             self,
 *             varname,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1030, __pyx_L1_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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1048
 *             max_subarray_size=max_subarray_size
 *         )
 *         return self._s3_variables[varname]             # <<<<<<<<<<<<<<
 * 
 *     def renameVariable(self, oldname, newname):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_varname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":1020
 *         self._nc_grp.renameDimension(oldname, newname)
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *                        complevel=4, shuffle=True, fletcher32=False,
 *                        contiguous=False, chunksizes=None, endian='native',
 */

  /* 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("S3netCDF4._s3netCDF4.s3Group.createVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1050
 *         return self._s3_variables[varname]
 * 
 *     def renameVariable(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the variable by overloading the base method."""
 *         if self._cfa_grp:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_11renameVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_10renameVariable[] = "Rename the variable by overloading the base method.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_11renameVariable = {"renameVariable", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_11renameVariable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_10renameVariable};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_11renameVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_oldname = 0;
  PyObject *__pyx_v_newname = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("renameVariable (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldname,&__pyx_n_s_newname,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_oldname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renameVariable", 1, 3, 3, 1); __PYX_ERR(0, 1050, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_newname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renameVariable", 1, 3, 3, 2); __PYX_ERR(0, 1050, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameVariable") < 0)) __PYX_ERR(0, 1050, __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_self = values[0];
    __pyx_v_oldname = values[1];
    __pyx_v_newname = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("renameVariable", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1050, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.renameVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_10renameVariable(__pyx_self, __pyx_v_self, __pyx_v_oldname, __pyx_v_newname);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_10renameVariable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname) {
  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_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("renameVariable", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1052
 *     def renameVariable(self, oldname, newname):
 *         """Rename the variable by overloading the base method."""
 *         if self._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_grp.renameVariable(oldname, newname)
 *         self._nc_grp.renameVariable(oldname, newname)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "S3netCDF4/_s3netCDF4.pyx":1053
 *         """Rename the variable by overloading the base method."""
 *         if self._cfa_grp:
 *             self._cfa_grp.renameVariable(oldname, newname)             # <<<<<<<<<<<<<<
 *         self._nc_grp.renameVariable(oldname, newname)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_renameVariable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_oldname, __pyx_v_newname};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_oldname, __pyx_v_newname};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1053, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_oldname);
      __Pyx_GIVEREF(__pyx_v_oldname);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_oldname);
      __Pyx_INCREF(__pyx_v_newname);
      __Pyx_GIVEREF(__pyx_v_newname);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_newname);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __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;

    /* "S3netCDF4/_s3netCDF4.pyx":1052
 *     def renameVariable(self, oldname, newname):
 *         """Rename the variable by overloading the base method."""
 *         if self._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_grp.renameVariable(oldname, newname)
 *         self._nc_grp.renameVariable(oldname, newname)
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1054
 *         if self._cfa_grp:
 *             self._cfa_grp.renameVariable(oldname, newname)
 *         self._nc_grp.renameVariable(oldname, newname)             # <<<<<<<<<<<<<<
 * 
 *     def delncattr(self, name):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_renameVariable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_oldname, __pyx_v_newname};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_oldname, __pyx_v_newname};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_oldname);
    __Pyx_GIVEREF(__pyx_v_oldname);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_oldname);
    __Pyx_INCREF(__pyx_v_newname);
    __Pyx_GIVEREF(__pyx_v_newname);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_newname);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1050
 *         return self._s3_variables[varname]
 * 
 *     def renameVariable(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the variable by overloading the base method."""
 *         if self._cfa_grp:
 */

  /* 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_6);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.renameVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1056
 *         self._nc_grp.renameVariable(oldname, newname)
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_13delncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_12delncattr[] = "Override delncattr function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_13delncattr = {"delncattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_13delncattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_12delncattr};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_13delncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delncattr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("delncattr", 1, 2, 2, 1); __PYX_ERR(0, 1056, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delncattr") < 0)) __PYX_ERR(0, 1056, __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_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delncattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1056, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_12delncattr(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_12delncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delncattr", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1060
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._cfa_grp.metadata.pop(name)
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1060, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1060, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1061
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_grp.metadata.pop(name)
 *             except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "S3netCDF4/_s3netCDF4.pyx":1062
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             try:
 *                 self._cfa_grp.metadata.pop(name)             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 raise APIException(
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1062, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1062, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pop); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1062, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1062, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":1061
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_grp.metadata.pop(name)
 *             except KeyError:
 */
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1063
 *             try:
 *                 self._cfa_grp.metadata.pop(name)
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 raise APIException(
 *                     "Attribute {} not found in variable {}".format(
 */
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_10) {
        __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 1063, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_9);

        /* "S3netCDF4/_s3netCDF4.pyx":1064
 *                 self._cfa_grp.metadata.pop(name)
 *             except KeyError:
 *                 raise APIException(             # <<<<<<<<<<<<<<
 *                     "Attribute {} not found in variable {}".format(
 *                     name, self.name
 */
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_APIException); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1064, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_12);

        /* "S3netCDF4/_s3netCDF4.pyx":1065
 *             except KeyError:
 *                 raise APIException(
 *                     "Attribute {} not found in variable {}".format(             # <<<<<<<<<<<<<<
 *                     name, self.name
 *                 ))
 */
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Attribute_not_found_in_variable, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1065, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_14);

        /* "S3netCDF4/_s3netCDF4.pyx":1066
 *                 raise APIException(
 *                     "Attribute {} not found in variable {}".format(
 *                     name, self.name             # <<<<<<<<<<<<<<
 *                 ))
 *         else:
 */
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1066, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_16 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_16)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_16);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
            __pyx_t_10 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_14)) {
          PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_name, __pyx_t_15};
          __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1065, __pyx_L8_except_error)
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
          PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_name, __pyx_t_15};
          __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1065, __pyx_L8_except_error)
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        } else
        #endif
        {
          __pyx_t_17 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1065, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_17);
          if (__pyx_t_16) {
            __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __pyx_t_16 = NULL;
          }
          __Pyx_INCREF(__pyx_v_name);
          __Pyx_GIVEREF(__pyx_v_name);
          PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_10, __pyx_v_name);
          __Pyx_GIVEREF(__pyx_t_15);
          PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_10, __pyx_t_15);
          __pyx_t_15 = 0;
          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1065, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        }
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_11 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_14, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1064, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_Raise(__pyx_t_11, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(0, 1064, __pyx_L8_except_error)
      }
      goto __pyx_L8_except_error;
      __pyx_L8_except_error:;

      /* "S3netCDF4/_s3netCDF4.pyx":1061
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_grp.metadata.pop(name)
 *             except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L11_try_end:;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1060
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._cfa_grp.metadata.pop(name)
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1069
 *                 ))
 *         else:
 *             self._nc_grp.delncattr(name)             # <<<<<<<<<<<<<<
 * 
 *     def getncattr(self, name):
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1069, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_delncattr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1069, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1069, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":1056
 *         self._nc_grp.renameVariable(oldname, newname)
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1071
 *             self._nc_grp.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_15getncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_14getncattr[] = "Override getncattr function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_15getncattr = {"getncattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_15getncattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_14getncattr};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_15getncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getncattr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getncattr", 1, 2, 2, 1); __PYX_ERR(0, 1071, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getncattr") < 0)) __PYX_ERR(0, 1071, __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_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getncattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1071, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_14getncattr(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_14getncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getncattr", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1075
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             try:
 *                 return self._cfa_grp.metadata[name]
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1075, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1076
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_grp.metadata[name]
 *             except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "S3netCDF4/_s3netCDF4.pyx":1077
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             try:
 *                 return self._cfa_grp.metadata[name]             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 return self._nc_grp.getncattr(name)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1077, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_metadata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1077, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1077, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L10_try_return;

        /* "S3netCDF4/_s3netCDF4.pyx":1076
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_grp.metadata[name]
 *             except KeyError:
 */
      }
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1078
 *             try:
 *                 return self._cfa_grp.metadata[name]
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 return self._nc_grp.getncattr(name)
 *         else:
 */
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_10) < 0) __PYX_ERR(0, 1078, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_10);

        /* "S3netCDF4/_s3netCDF4.pyx":1079
 *                 return self._cfa_grp.metadata[name]
 *             except KeyError:
 *                 return self._nc_grp.getncattr(name)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_grp.getncattr(name)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1079, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_getncattr); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1079, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_name);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1079, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_r = __pyx_t_11;
        __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L9_except_return;
      }
      goto __pyx_L8_except_error;
      __pyx_L8_except_error:;

      /* "S3netCDF4/_s3netCDF4.pyx":1076
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_grp.metadata[name]
 *             except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L10_try_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
      __pyx_L9_except_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1075
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             try:
 *                 return self._cfa_grp.metadata[name]
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1081
 *                 return self._nc_grp.getncattr(name)
 *         else:
 *             return self._nc_grp.getncattr(name)             # <<<<<<<<<<<<<<
 * 
 *     def ncattrs(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_getncattr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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_10 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_10;
    __pyx_t_10 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1071
 *             self._nc_grp.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1083
 *             return self._nc_grp.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_17ncattrs(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_16ncattrs[] = "Override ncattrs function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_17ncattrs = {"ncattrs", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_17ncattrs, METH_O, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_16ncattrs};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_17ncattrs(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ncattrs (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_16ncattrs(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_16ncattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ncattrs", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1087
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             return self._cfa_grp.metadata.keys()
 *         else:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1087, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1088
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             return self._cfa_grp.metadata.keys()             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_grp.ncattrs()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1088, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_metadata); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1088, __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_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1088, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1088, __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;

    /* "S3netCDF4/_s3netCDF4.pyx":1087
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             return self._cfa_grp.metadata.keys()
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1090
 *             return self._cfa_grp.metadata.keys()
 *         else:
 *             return self._nc_grp.ncattrs()             # <<<<<<<<<<<<<<
 * 
 *     def setncattr(self, name, value):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ncattrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1083
 *             return self._nc_grp.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.ncattrs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1092
 *             return self._nc_grp.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_19setncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_18setncattr[] = "Override setncattr function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_19setncattr = {"setncattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_19setncattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_18setncattr};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_19setncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setncattr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr", 1, 3, 3, 1); __PYX_ERR(0, 1092, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr", 1, 3, 3, 2); __PYX_ERR(0, 1092, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr") < 0)) __PYX_ERR(0, 1092, __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_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setncattr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1092, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.setncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_18setncattr(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_18setncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setncattr", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1096
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_grp.metadata[name] = value
 *         else:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1096, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1096, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1097
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             self._cfa_grp.metadata[name] = value             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_grp.setncattr(name, value)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1097, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1097, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 1097, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1096
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_grp.metadata[name] = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1099
 *             self._cfa_grp.metadata[name] = value
 *         else:
 *             self._nc_grp.setncattr(name, value)             # <<<<<<<<<<<<<<
 * 
 *     def setncattr_string(self, name, value):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_setncattr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1099, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1099, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1099, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1099, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":1092
 *             return self._nc_grp.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.setncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1101
 *             self._nc_grp.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_21setncattr_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_20setncattr_string[] = "Override setncattr_string function to manipulate the metadata\n        dictionary, rather than the netCDF file.  The attributes are copied from\n        the metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_21setncattr_string = {"setncattr_string", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_21setncattr_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_20setncattr_string};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_21setncattr_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setncattr_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr_string", 1, 3, 3, 1); __PYX_ERR(0, 1101, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr_string", 1, 3, 3, 2); __PYX_ERR(0, 1101, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr_string") < 0)) __PYX_ERR(0, 1101, __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_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setncattr_string", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1101, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.setncattr_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_20setncattr_string(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_20setncattr_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setncattr_string", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1105
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_grp.metadata[name] = value
 *         else:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1105, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1106
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             self._cfa_grp.metadata[name] = value             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_grp.setncattr_string(name, value)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 1106, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1105
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_grp.metadata[name] = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1108
 *             self._cfa_grp.metadata[name] = value
 *         else:
 *             self._nc_grp.setncattr_string(name, value)             # <<<<<<<<<<<<<<
 * 
 *     def setncatts(self, attdict):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_setncattr_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1108, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1108, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1108, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":1101
 *             self._nc_grp.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.setncattr_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1110
 *             self._nc_grp.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_23setncatts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_22setncatts[] = "Override setncattrs function to manipulate the metadata\n        dictionary, rather than the netCDF file.  The attributes are copied from\n        the metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_23setncatts = {"setncatts", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_23setncatts, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_22setncatts};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_23setncatts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_attdict = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setncatts (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attdict,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attdict)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncatts", 1, 2, 2, 1); __PYX_ERR(0, 1110, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncatts") < 0)) __PYX_ERR(0, 1110, __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_self = values[0];
    __pyx_v_attdict = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setncatts", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1110, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.setncatts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_22setncatts(__pyx_self, __pyx_v_self, __pyx_v_attdict);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_22setncatts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attdict) {
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setncatts", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1114
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             for k in attdict:
 *                 self._cfa_grp.metadata[k] = attdict[k]
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1114, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1115
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             for k in attdict:             # <<<<<<<<<<<<<<
 *                 self._cfa_grp.metadata[k] = attdict[k]
 *         else:
 */
    if (likely(PyList_CheckExact(__pyx_v_attdict)) || PyTuple_CheckExact(__pyx_v_attdict)) {
      __pyx_t_4 = __pyx_v_attdict; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_attdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1115, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1115, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1115, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1115, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1115, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1115, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1116
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             for k in attdict:
 *                 self._cfa_grp.metadata[k] = attdict[k]             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_grp.setncatts(attdict)
 */
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_attdict, __pyx_v_k); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(PyObject_SetItem(__pyx_t_9, __pyx_v_k, __pyx_t_7) < 0)) __PYX_ERR(0, 1116, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1115
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             for k in attdict:             # <<<<<<<<<<<<<<
 *                 self._cfa_grp.metadata[k] = attdict[k]
 *         else:
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1114
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             for k in attdict:
 *                 self._cfa_grp.metadata[k] = attdict[k]
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1118
 *                 self._cfa_grp.metadata[k] = attdict[k]
 *         else:
 *             self._nc_grp.setncatts(attdict)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, elem):
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_setncatts); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_attdict) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_attdict);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":1110
 *             self._nc_grp.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.setncatts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1120
 *             self._nc_grp.setncatts(attdict)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_25__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_24__getitem__[] = "Override the __getitem__ for the Dataset to return the group or\n        variable with the name of elem";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_25__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_25__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_24__getitem__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_25__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_elem = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_elem,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elem)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1120, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 1120, __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_self = values[0];
    __pyx_v_elem = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1120, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_24__getitem__(__pyx_self, __pyx_v_self, __pyx_v_elem);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_24__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elem) {
  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("__getitem__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1123
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 *         if elem in self.variables:             # <<<<<<<<<<<<<<
 *             return self.variables[elem]
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_elem, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (likely(__pyx_t_3)) {

    /* "S3netCDF4/_s3netCDF4.pyx":1124
 *         variable with the name of elem"""
 *         if elem in self.variables:
 *             return self.variables[elem]             # <<<<<<<<<<<<<<
 *         else:
 *             raise IndexError(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_elem); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":1123
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 *         if elem in self.variables:             # <<<<<<<<<<<<<<
 *             return self.variables[elem]
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1126
 *             return self.variables[elem]
 *         else:
 *             raise IndexError(             # <<<<<<<<<<<<<<
 *                 "{} not found as a group or variable in Dataset".format(elem)
 *             )
 */
  /*else*/ {

    /* "S3netCDF4/_s3netCDF4.pyx":1127
 *         else:
 *             raise IndexError(
 *                 "{} not found as a group or variable in Dataset".format(elem)             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_not_found_as_a_group_or_variabl, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_elem) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_elem);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1126
 *             return self.variables[elem]
 *         else:
 *             raise IndexError(             # <<<<<<<<<<<<<<
 *                 "{} not found as a group or variable in Dataset".format(elem)
 *             )
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1126, __pyx_L1_error)
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1120
 *             self._nc_grp.setncatts(attdict)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1131
 * 
 *     @property
 *     def variables(self):             # <<<<<<<<<<<<<<
 *         return self._s3_variables
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_27variables(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_27variables = {"variables", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_27variables, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_27variables(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("variables (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_26variables(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_26variables(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("variables", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1132
 *     @property
 *     def variables(self):
 *         return self._s3_variables             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":1131
 * 
 *     @property
 *     def variables(self):             # <<<<<<<<<<<<<<
 *         return self._s3_variables
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1135
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         return self._s3_dimensions
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_29dimensions(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_29dimensions = {"dimensions", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_29dimensions, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_29dimensions(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dimensions (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_28dimensions(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_28dimensions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("dimensions", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1136
 *     @property
 *     def dimensions(self):
 *         return self._s3_dimensions             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_dimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":1135
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         return self._s3_dimensions
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1138
 *         return self._s3_dimensions
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             if sys_version_info[0] > 2:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_31__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_31__repr__ = {"__repr__", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_31__repr__, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_31__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_30__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_30__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1139
 * 
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1139, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1140
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             if sys_version_info[0] > 2:             # <<<<<<<<<<<<<<
 *                 return self.__unicode__()
 *             else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys_version_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1140, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1140, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "S3netCDF4/_s3netCDF4.pyx":1141
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()             # <<<<<<<<<<<<<<
 *             else:
 *                 return unicode(self).encode('utf-8')
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1141, __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;

      /* "S3netCDF4/_s3netCDF4.pyx":1140
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             if sys_version_info[0] > 2:             # <<<<<<<<<<<<<<
 *                 return self.__unicode__()
 *             else:
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1143
 *                 return self.__unicode__()
 *             else:
 *                 return unicode(self).encode('utf-8')             # <<<<<<<<<<<<<<
 *         else:
 *             # don't output any info about the cfa groups
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1139
 * 
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1146
 *         else:
 *             # don't output any info about the cfa groups
 *             if self._nc_grp.name[0:4] == "cfa_":             # <<<<<<<<<<<<<<
 *                 return ("cfa_group")
 *             else:
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 4, NULL, NULL, &__pyx_slice__12, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_n_u_cfa, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {

      /* "S3netCDF4/_s3netCDF4.pyx":1147
 *             # don't output any info about the cfa groups
 *             if self._nc_grp.name[0:4] == "cfa_":
 *                 return ("cfa_group")             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._nc_grp.__repr__()
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_n_u_cfa_group);
      __pyx_r = __pyx_n_u_cfa_group;
      goto __pyx_L0;

      /* "S3netCDF4/_s3netCDF4.pyx":1146
 *         else:
 *             # don't output any info about the cfa groups
 *             if self._nc_grp.name[0:4] == "cfa_":             # <<<<<<<<<<<<<<
 *                 return ("cfa_group")
 *             else:
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1149
 *                 return ("cfa_group")
 *             else:
 *                 return self._nc_grp.__repr__()             # <<<<<<<<<<<<<<
 * 
 *     def __unicode__(self):
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_repr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1138
 *         return self._s3_dimensions
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             if sys_version_info[0] > 2:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1151
 *                 return self._nc_grp.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_grp = self._cfa_grp
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_33__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_33__unicode__ = {"__unicode__", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_33__unicode__, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_33__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_32__unicode__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_32__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ncdump = NULL;
  PyObject *__pyx_v_cfa_grp = NULL;
  PyObject *__pyx_v_nc_grp = 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_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__unicode__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1152
 * 
 *     def __unicode__(self):
 *         ncdump = ['{}\n'.format(type(self))]             # <<<<<<<<<<<<<<
 *         cfa_grp = self._cfa_grp
 *         nc_grp = self._nc_grp
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)Py_TYPE(__pyx_v_self))) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)Py_TYPE(__pyx_v_self)));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_ncdump = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1153
 *     def __unicode__(self):
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_grp = self._cfa_grp             # <<<<<<<<<<<<<<
 *         nc_grp = self._nc_grp
 *         ncdump.append("group /{}:\n".format(cfa_grp.getName()))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_cfa_grp = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1154
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_grp = self._cfa_grp
 *         nc_grp = self._nc_grp             # <<<<<<<<<<<<<<
 *         ncdump.append("group /{}:\n".format(cfa_grp.getName()))
 *         ncdump = _group_and_dataset_repr(ncdump, cfa_grp, nc_grp)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_nc_grp = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1155
 *         cfa_grp = self._cfa_grp
 *         nc_grp = self._nc_grp
 *         ncdump.append("group /{}:\n".format(cfa_grp.getName()))             # <<<<<<<<<<<<<<
 *         ncdump = _group_and_dataset_repr(ncdump, cfa_grp, nc_grp)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_group, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_grp, __pyx_n_s_getName); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && 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_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_ncdump, __pyx_t_2); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1156
 *         nc_grp = self._nc_grp
 *         ncdump.append("group /{}:\n".format(cfa_grp.getName()))
 *         ncdump = _group_and_dataset_repr(ncdump, cfa_grp, nc_grp)             # <<<<<<<<<<<<<<
 * 
 *         return "".join(ncdump)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_group_and_dataset_repr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && 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);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_ncdump, __pyx_v_cfa_grp, __pyx_v_nc_grp};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_ncdump, __pyx_v_cfa_grp, __pyx_v_nc_grp};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1156, __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_ncdump);
    __Pyx_GIVEREF(__pyx_v_ncdump);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_ncdump);
    __Pyx_INCREF(__pyx_v_cfa_grp);
    __Pyx_GIVEREF(__pyx_v_cfa_grp);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_cfa_grp);
    __Pyx_INCREF(__pyx_v_nc_grp);
    __Pyx_GIVEREF(__pyx_v_nc_grp);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, __pyx_v_nc_grp);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_ncdump, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1158
 *         ncdump = _group_and_dataset_repr(ncdump, cfa_grp, nc_grp)
 * 
 *         return "".join(ncdump)             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__3, __pyx_v_ncdump); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":1151
 *                 return self._nc_grp.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_grp = self._cfa_grp
 */

  /* 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("S3netCDF4._s3netCDF4.s3Group.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ncdump);
  __Pyx_XDECREF(__pyx_v_cfa_grp);
  __Pyx_XDECREF(__pyx_v_nc_grp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1160
 *         return "".join(ncdump)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Group so as to return its
 *         private variables."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_35__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_34__getattr__[] = "Override the __getattr__ for the Group so as to return its\n        private variables.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_35__getattr__ = {"__getattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_35__getattr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_34__getattr__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_35__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, 1); __PYX_ERR(0, 1160, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattr__") < 0)) __PYX_ERR(0, 1160, __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_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1160, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_34__getattr__(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_34__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  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;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1163
 *         """Override the __getattr__ for the Group so as to return its
 *         private variables."""
 *         if name in s3Group._private_atts:             # <<<<<<<<<<<<<<
 *             return self.__dict__[name]
 *         elif name in netCDF4._private_atts:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_s3Group); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":1164
 *         private variables."""
 *         if name in s3Group._private_atts:
 *             return self.__dict__[name]             # <<<<<<<<<<<<<<
 *         elif name in netCDF4._private_atts:
 *             return self._nc_grp.__getattr__(name)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __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;

    /* "S3netCDF4/_s3netCDF4.pyx":1163
 *         """Override the __getattr__ for the Group so as to return its
 *         private variables."""
 *         if name in s3Group._private_atts:             # <<<<<<<<<<<<<<
 *             return self.__dict__[name]
 *         elif name in netCDF4._private_atts:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1165
 *         if name in s3Group._private_atts:
 *             return self.__dict__[name]
 *         elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *             return self._nc_grp.__getattr__(name)
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":1166
 *             return self.__dict__[name]
 *         elif name in netCDF4._private_atts:
 *             return self._nc_grp.__getattr__(name)             # <<<<<<<<<<<<<<
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             return self._cfa_grp.metadata[name]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":1165
 *         if name in s3Group._private_atts:
 *             return self.__dict__[name]
 *         elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *             return self._nc_grp.__getattr__(name)
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1167
 *         elif name in netCDF4._private_atts:
 *             return self._nc_grp.__getattr__(name)
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             return self._cfa_grp.metadata[name]
 *         else:
 */
  __pyx_t_4 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1167, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_4 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":1168
 *             return self._nc_grp.__getattr__(name)
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             return self._cfa_grp.metadata[name]             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_grp.__getattr__(name)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":1167
 *         elif name in netCDF4._private_atts:
 *             return self._nc_grp.__getattr__(name)
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             return self._cfa_grp.metadata[name]
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1170
 *             return self._cfa_grp.metadata[name]
 *         else:
 *             return self._nc_grp.__getattr__(name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getattr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __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;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1160
 *         return "".join(ncdump)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Group so as to return its
 *         private variables."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1173
 * 
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Group so as to assign its
 *         private variables."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_37__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_36__setattr__[] = "Override the __setattr__ for the Group so as to assign its\n        private variables.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_37__setattr__ = {"__setattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_37__setattr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_7s3Group_36__setattr__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_7s3Group_37__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 1); __PYX_ERR(0, 1173, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 2); __PYX_ERR(0, 1173, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setattr__") < 0)) __PYX_ERR(0, 1173, __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_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1173, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_36__setattr__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_7s3Group_36__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setattr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1176
 *         """Override the __setattr__ for the Group so as to assign its
 *         private variables."""
 *         if name in s3Group._private_atts:             # <<<<<<<<<<<<<<
 *             self.__dict__[name] = value
 *         elif name in netCDF4._private_atts:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_s3Group); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":1177
 *         private variables."""
 *         if name in s3Group._private_atts:
 *             self.__dict__[name] = value             # <<<<<<<<<<<<<<
 *         elif name in netCDF4._private_atts:
 *             self._nc_grp.__setattr__(name, value)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 1177, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1176
 *         """Override the __setattr__ for the Group so as to assign its
 *         private variables."""
 *         if name in s3Group._private_atts:             # <<<<<<<<<<<<<<
 *             self.__dict__[name] = value
 *         elif name in netCDF4._private_atts:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1178
 *         if name in s3Group._private_atts:
 *             self.__dict__[name] = value
 *         elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *             self._nc_grp.__setattr__(name, value)
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":1179
 *             self.__dict__[name] = value
 *         elif name in netCDF4._private_atts:
 *             self._nc_grp.__setattr__(name, value)             # <<<<<<<<<<<<<<
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             self._cfa_grp.metadata[name] = value
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_setattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && 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;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1179, __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_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1178
 *         if name in s3Group._private_atts:
 *             self.__dict__[name] = value
 *         elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *             self._nc_grp.__setattr__(name, value)
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1180
 *         elif name in netCDF4._private_atts:
 *             self._nc_grp.__setattr__(name, value)
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_grp.metadata[name] = value
 *         else:
 */
  __pyx_t_4 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_grp); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1180, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_4 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":1181
 *             self._nc_grp.__setattr__(name, value)
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             self._cfa_grp.metadata[name] = value             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_grp.__setattr__(name, value)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_grp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 1181, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1180
 *         elif name in netCDF4._private_atts:
 *             self._nc_grp.__setattr__(name, value)
 *         elif hasattr(self, "_cfa_grp") and self._cfa_grp:             # <<<<<<<<<<<<<<
 *             self._cfa_grp.metadata[name] = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1183
 *             self._cfa_grp.metadata[name] = value
 *         else:
 *             self._nc_grp.__setattr__(name, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_grp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setattr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && 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;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__pyx_t_1) {
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_v_value);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":1173
 * 
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Group so as to assign its
 *         private variables."""
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Group.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1199
 * 
 *     @property
 *     def file_object(self):             # <<<<<<<<<<<<<<
 *         return self._managed_object.file_object
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_1file_object(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_1file_object = {"file_object", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_1file_object, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_1file_object(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("file_object (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_file_object(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_file_object(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("file_object", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1200
 *     @property
 *     def file_object(self):
 *         return self._managed_object.file_object             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, filename, mode='r', clobber=True, format='DEFAULT',
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_managed_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_file_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":1199
 * 
 *     @property
 *     def file_object(self):             # <<<<<<<<<<<<<<
 *         return self._managed_object.file_object
 * 
 */

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

/* "S3netCDF4/_s3netCDF4.pyx":1202
 *         return self._managed_object.file_object
 * 
 *     def __init__(self, filename, mode='r', clobber=True, format='DEFAULT',             # <<<<<<<<<<<<<<
 *                  diskless=False, persist=False, keepweakref=False, memory=None,
 *                  cfa_version="0.5", **kwargs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_3__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_2__init__[] = "The __init__ method can now be used with asyncio as all of the async\n        functionally has been moved to the FileManager.\n        Python reserved methods cannot be declared as `async`.\n        ";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_3__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_3__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_2__init__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_3__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_v_clobber = 0;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_diskless = 0;
  PyObject *__pyx_v_persist = 0;
  PyObject *__pyx_v_keepweakref = 0;
  PyObject *__pyx_v_memory = 0;
  PyObject *__pyx_v_cfa_version = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,&__pyx_n_s_mode,&__pyx_n_s_clobber,&__pyx_n_s_format,&__pyx_n_s_diskless,&__pyx_n_s_persist,&__pyx_n_s_keepweakref,&__pyx_n_s_memory,&__pyx_n_s_cfa_version,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_n_u_r));
    values[3] = ((PyObject *)((PyObject *)Py_True));
    values[4] = ((PyObject *)((PyObject*)__pyx_n_u_DEFAULT));

    /* "S3netCDF4/_s3netCDF4.pyx":1203
 * 
 *     def __init__(self, filename, mode='r', clobber=True, format='DEFAULT',
 *                  diskless=False, persist=False, keepweakref=False, memory=None,             # <<<<<<<<<<<<<<
 *                  cfa_version="0.5", **kwargs):
 *         """The __init__ method can now be used with asyncio as all of the async
 */
    values[5] = ((PyObject *)((PyObject *)Py_False));
    values[6] = ((PyObject *)((PyObject *)Py_False));
    values[7] = ((PyObject *)((PyObject *)Py_False));
    values[8] = ((PyObject *)((PyObject *)Py_None));
    values[9] = ((PyObject *)((PyObject*)__pyx_kp_u_0_5));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 10, 1); __PYX_ERR(0, 1202, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clobber);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diskless);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_persist);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keepweakref);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cfa_version);
          if (value) { values[9] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1202, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_filename = values[1];
    __pyx_v_mode = values[2];
    __pyx_v_clobber = values[3];
    __pyx_v_format = values[4];
    __pyx_v_diskless = values[5];
    __pyx_v_persist = values[6];
    __pyx_v_keepweakref = values[7];
    __pyx_v_memory = values[8];
    __pyx_v_cfa_version = values[9];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1202, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_2__init__(__pyx_self, __pyx_v_self, __pyx_v_filename, __pyx_v_mode, __pyx_v_clobber, __pyx_v_format, __pyx_v_diskless, __pyx_v_persist, __pyx_v_keepweakref, __pyx_v_memory, __pyx_v_cfa_version, __pyx_v_kwargs);

  /* "S3netCDF4/_s3netCDF4.pyx":1202
 *         return self._managed_object.file_object
 * 
 *     def __init__(self, filename, mode='r', clobber=True, format='DEFAULT',             # <<<<<<<<<<<<<<
 *                  diskless=False, persist=False, keepweakref=False, memory=None,
 *                  cfa_version="0.5", **kwargs):
 */

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_2__init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_clobber, PyObject *__pyx_v_format, PyObject *__pyx_v_diskless, PyObject *__pyx_v_persist, PyObject *__pyx_v_keepweakref, PyObject *__pyx_v_memory, PyObject *__pyx_v_cfa_version, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_v_file_type = NULL;
  PyObject *__pyx_v_data = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_file_version = NULL;
  PyObject *__pyx_v_nc_bytes = NULL;
  PyObject *__pyx_v_parser = 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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1211
 *         # check CFA compatibility 0.5 can only be used with NETCDF4 or CFA4
 *         # (strictly CFA4, but we'll allow the user some leeway)
 *         if cfa_version == "0.5":             # <<<<<<<<<<<<<<
 *             if format == "CFA3" or format == "NETCDF3_CLASSIC":
 *                 raise APIException(
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_cfa_version, __pyx_kp_u_0_5, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1211, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1212
 *         # (strictly CFA4, but we'll allow the user some leeway)
 *         if cfa_version == "0.5":
 *             if format == "CFA3" or format == "NETCDF3_CLASSIC":             # <<<<<<<<<<<<<<
 *                 raise APIException(
 *                     "CFA 0.5 is not compatible with NETCDF3 file formats."
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_CFA3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1212, __pyx_L1_error)
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_NETCDF3_CLASSIC, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1212, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(__pyx_t_1)) {

      /* "S3netCDF4/_s3netCDF4.pyx":1213
 *         if cfa_version == "0.5":
 *             if format == "CFA3" or format == "NETCDF3_CLASSIC":
 *                 raise APIException(             # <<<<<<<<<<<<<<
 *                     "CFA 0.5 is not compatible with NETCDF3 file formats."
 *                 )
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_APIException); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_CFA_0_5_is_not_compatible_with_N) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_CFA_0_5_is_not_compatible_with_N);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1213, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1212
 *         # (strictly CFA4, but we'll allow the user some leeway)
 *         if cfa_version == "0.5":
 *             if format == "CFA3" or format == "NETCDF3_CLASSIC":             # <<<<<<<<<<<<<<
 *                 raise APIException(
 *                     "CFA 0.5 is not compatible with NETCDF3 file formats."
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1211
 *         # check CFA compatibility 0.5 can only be used with NETCDF4 or CFA4
 *         # (strictly CFA4, but we'll allow the user some leeway)
 *         if cfa_version == "0.5":             # <<<<<<<<<<<<<<
 *             if format == "CFA3" or format == "NETCDF3_CLASSIC":
 *                 raise APIException(
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1218
 * 
 *         # Create a file manager object and keep it
 *         self._file_manager = FileManager()             # <<<<<<<<<<<<<<
 *         self._mode = mode
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FileManager); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_file_manager, __pyx_t_3) < 0) __PYX_ERR(0, 1218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1219
 *         # Create a file manager object and keep it
 *         self._file_manager = FileManager()
 *         self._mode = mode             # <<<<<<<<<<<<<<
 * 
 *         # record the parameters passed in so that we can pass these on to the
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mode_2, __pyx_v_mode) < 0) __PYX_ERR(0, 1219, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1224
 *         # subarray files
 *         self._creation_params = {
 *             "mode"     : mode,             # <<<<<<<<<<<<<<
 *             "clobber"  : clobber,
 *             "format"   : format,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_mode, __pyx_v_mode) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1225
 *         self._creation_params = {
 *             "mode"     : mode,
 *             "clobber"  : clobber,             # <<<<<<<<<<<<<<
 *             "format"   : format,
 *             "diskless" : diskless,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_clobber, __pyx_v_clobber) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1226
 *             "mode"     : mode,
 *             "clobber"  : clobber,
 *             "format"   : format,             # <<<<<<<<<<<<<<
 *             "diskless" : diskless,
 *             "persist"  : persist,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_format, __pyx_v_format) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1227
 *             "clobber"  : clobber,
 *             "format"   : format,
 *             "diskless" : diskless,             # <<<<<<<<<<<<<<
 *             "persist"  : persist,
 *             "keepweakref" : keepweakref,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_diskless, __pyx_v_diskless) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1228
 *             "format"   : format,
 *             "diskless" : diskless,
 *             "persist"  : persist,             # <<<<<<<<<<<<<<
 *             "keepweakref" : keepweakref,
 *             "memory"   : memory,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_persist, __pyx_v_persist) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1229
 *             "diskless" : diskless,
 *             "persist"  : persist,
 *             "keepweakref" : keepweakref,             # <<<<<<<<<<<<<<
 *             "memory"   : memory,
 *         }
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_keepweakref, __pyx_v_keepweakref) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1230
 *             "persist"  : persist,
 *             "keepweakref" : keepweakref,
 *             "memory"   : memory,             # <<<<<<<<<<<<<<
 *         }
 * 
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_memory, __pyx_v_memory) < 0) __PYX_ERR(0, 1224, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1223
 *         # record the parameters passed in so that we can pass these on to the
 *         # subarray files
 *         self._creation_params = {             # <<<<<<<<<<<<<<
 *             "mode"     : mode,
 *             "clobber"  : clobber,
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_creation_params, __pyx_t_3) < 0) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1235
 *         # set the group to be an empty dictionary.  There will always be one
 *         # group - the root group, this will be created later
 *         self._s3_groups = {}             # <<<<<<<<<<<<<<
 *         self._s3_dimensions = {}
 *         self._s3_variables = {}
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_s3_groups, __pyx_t_3) < 0) __PYX_ERR(0, 1235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1236
 *         # group - the root group, this will be created later
 *         self._s3_groups = {}
 *         self._s3_dimensions = {}             # <<<<<<<<<<<<<<
 *         self._s3_variables = {}
 * 
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_s3_dimensions, __pyx_t_3) < 0) __PYX_ERR(0, 1236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1237
 *         self._s3_groups = {}
 *         self._s3_dimensions = {}
 *         self._s3_variables = {}             # <<<<<<<<<<<<<<
 * 
 *         # create the file object, this controls access to the various
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_s3_variables, __pyx_t_3) < 0) __PYX_ERR(0, 1237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1241
 *         # create the file object, this controls access to the various
 *         # file backends that are supported
 *         self._managed_object = self._file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                     filename,
 *                                     mode=mode,
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_request_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1242
 *         # file backends that are supported
 *         self._managed_object = self._file_manager.request_file(
 *                                     filename,             # <<<<<<<<<<<<<<
 *                                     mode=mode,
 *                                     lock=True
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_filename);
  __Pyx_GIVEREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_filename);

  /* "S3netCDF4/_s3netCDF4.pyx":1243
 *         self._managed_object = self._file_manager.request_file(
 *                                     filename,
 *                                     mode=mode,             # <<<<<<<<<<<<<<
 *                                     lock=True
 *                                )
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_v_mode) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1244
 *                                     filename,
 *                                     mode=mode,
 *                                     lock=True             # <<<<<<<<<<<<<<
 *                                )
 * 
 */
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_lock, Py_True) < 0) __PYX_ERR(0, 1243, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1241
 *         # create the file object, this controls access to the various
 *         # file backends that are supported
 *         self._managed_object = self._file_manager.request_file(             # <<<<<<<<<<<<<<
 *                                     filename,
 *                                     mode=mode,
 */
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_managed_object, __pyx_t_6) < 0) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1248
 * 
 *         # set the file up for write mode
 *         if mode == 'w':             # <<<<<<<<<<<<<<
 *             # check the format for writing - allow CFA4 in arguments and default
 *             # to CFA4 for writing so as to distribute files across subarrays
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1248, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1251
 *             # check the format for writing - allow CFA4 in arguments and default
 *             # to CFA4 for writing so as to distribute files across subarrays
 *             if format == 'CFA4' or format == 'DEFAULT':             # <<<<<<<<<<<<<<
 *                 file_type = 'NETCDF4'
 *                 self._creation_params["format"] = "NETCDF4"
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_CFA4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1251, __pyx_L1_error)
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_DEFAULT, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1251, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_2;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

      /* "S3netCDF4/_s3netCDF4.pyx":1252
 *             # to CFA4 for writing so as to distribute files across subarrays
 *             if format == 'CFA4' or format == 'DEFAULT':
 *                 file_type = 'NETCDF4'             # <<<<<<<<<<<<<<
 *                 self._creation_params["format"] = "NETCDF4"
 *                 self._cfa_dataset = CFADataset(
 */
      __Pyx_INCREF(__pyx_n_u_NETCDF4);
      __pyx_v_file_type = __pyx_n_u_NETCDF4;

      /* "S3netCDF4/_s3netCDF4.pyx":1253
 *             if format == 'CFA4' or format == 'DEFAULT':
 *                 file_type = 'NETCDF4'
 *                 self._creation_params["format"] = "NETCDF4"             # <<<<<<<<<<<<<<
 *                 self._cfa_dataset = CFADataset(
 *                     name=filename,
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_creation_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_n_u_format, __pyx_n_u_NETCDF4) < 0)) __PYX_ERR(0, 1253, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1254
 *                 file_type = 'NETCDF4'
 *                 self._creation_params["format"] = "NETCDF4"
 *                 self._cfa_dataset = CFADataset(             # <<<<<<<<<<<<<<
 *                     name=filename,
 *                     format='NETCDF4',
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_CFADataset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1254, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "S3netCDF4/_s3netCDF4.pyx":1255
 *                 self._creation_params["format"] = "NETCDF4"
 *                 self._cfa_dataset = CFADataset(
 *                     name=filename,             # <<<<<<<<<<<<<<
 *                     format='NETCDF4',
 *                     cfa_version=cfa_version
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_filename) < 0) __PYX_ERR(0, 1255, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_format, __pyx_n_u_NETCDF4) < 0) __PYX_ERR(0, 1255, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1257
 *                     name=filename,
 *                     format='NETCDF4',
 *                     cfa_version=cfa_version             # <<<<<<<<<<<<<<
 *                 )
 *                 # create the root group in the cfa file
 */
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_cfa_version, __pyx_v_cfa_version) < 0) __PYX_ERR(0, 1255, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1254
 *                 file_type = 'NETCDF4'
 *                 self._creation_params["format"] = "NETCDF4"
 *                 self._cfa_dataset = CFADataset(             # <<<<<<<<<<<<<<
 *                     name=filename,
 *                     format='NETCDF4',
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset, __pyx_t_3) < 0) __PYX_ERR(0, 1254, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1260
 *                 )
 *                 # create the root group in the cfa file
 *                 self._cfa_dataset.createGroup("root")             # <<<<<<<<<<<<<<
 *             elif format == 'CFA3':
 *                 file_type = 'NETCDF3_CLASSIC'
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_createGroup); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_n_u_root) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_u_root);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1251
 *             # check the format for writing - allow CFA4 in arguments and default
 *             # to CFA4 for writing so as to distribute files across subarrays
 *             if format == 'CFA4' or format == 'DEFAULT':             # <<<<<<<<<<<<<<
 *                 file_type = 'NETCDF4'
 *                 self._creation_params["format"] = "NETCDF4"
 */
      goto __pyx_L8;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1261
 *                 # create the root group in the cfa file
 *                 self._cfa_dataset.createGroup("root")
 *             elif format == 'CFA3':             # <<<<<<<<<<<<<<
 *                 file_type = 'NETCDF3_CLASSIC'
 *                 self._creation_params["format"] = "NETCDF3_CLASSIC"
 */
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_CFA3, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1261, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "S3netCDF4/_s3netCDF4.pyx":1262
 *                 self._cfa_dataset.createGroup("root")
 *             elif format == 'CFA3':
 *                 file_type = 'NETCDF3_CLASSIC'             # <<<<<<<<<<<<<<
 *                 self._creation_params["format"] = "NETCDF3_CLASSIC"
 *                 self._cfa_dataset = CFADataset(
 */
      __Pyx_INCREF(__pyx_n_u_NETCDF3_CLASSIC);
      __pyx_v_file_type = __pyx_n_u_NETCDF3_CLASSIC;

      /* "S3netCDF4/_s3netCDF4.pyx":1263
 *             elif format == 'CFA3':
 *                 file_type = 'NETCDF3_CLASSIC'
 *                 self._creation_params["format"] = "NETCDF3_CLASSIC"             # <<<<<<<<<<<<<<
 *                 self._cfa_dataset = CFADataset(
 *                     name=filename,
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_creation_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_n_u_format, __pyx_n_u_NETCDF3_CLASSIC) < 0)) __PYX_ERR(0, 1263, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1264
 *                 file_type = 'NETCDF3_CLASSIC'
 *                 self._creation_params["format"] = "NETCDF3_CLASSIC"
 *                 self._cfa_dataset = CFADataset(             # <<<<<<<<<<<<<<
 *                     name=filename,
 *                     format='NETCDF3_CLASSIC',
 */
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CFADataset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "S3netCDF4/_s3netCDF4.pyx":1265
 *                 self._creation_params["format"] = "NETCDF3_CLASSIC"
 *                 self._cfa_dataset = CFADataset(
 *                     name=filename,             # <<<<<<<<<<<<<<
 *                     format='NETCDF3_CLASSIC',
 *                     cfa_version=cfa_version
 */
      __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_v_filename) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_format, __pyx_n_u_NETCDF3_CLASSIC) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1267
 *                     name=filename,
 *                     format='NETCDF3_CLASSIC',
 *                     cfa_version=cfa_version             # <<<<<<<<<<<<<<
 *                 )
 *                 # create the root group in the cfa file
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_cfa_version, __pyx_v_cfa_version) < 0) __PYX_ERR(0, 1265, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1264
 *                 file_type = 'NETCDF3_CLASSIC'
 *                 self._creation_params["format"] = "NETCDF3_CLASSIC"
 *                 self._cfa_dataset = CFADataset(             # <<<<<<<<<<<<<<
 *                     name=filename,
 *                     format='NETCDF3_CLASSIC',
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset, __pyx_t_5) < 0) __PYX_ERR(0, 1264, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1270
 *                 )
 *                 # create the root group in the cfa file
 *                 self._cfa_dataset.createGroup("root")             # <<<<<<<<<<<<<<
 *             else:
 *                 file_type = format
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_createGroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_n_u_root) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_u_root);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1261
 *                 # create the root group in the cfa file
 *                 self._cfa_dataset.createGroup("root")
 *             elif format == 'CFA3':             # <<<<<<<<<<<<<<
 *                 file_type = 'NETCDF3_CLASSIC'
 *                 self._creation_params["format"] = "NETCDF3_CLASSIC"
 */
      goto __pyx_L8;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1272
 *                 self._cfa_dataset.createGroup("root")
 *             else:
 *                 file_type = format             # <<<<<<<<<<<<<<
 *                 self._creation_params["format"] = format
 *                 self._cfa_dataset = None
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_v_format);
      __pyx_v_file_type = __pyx_v_format;

      /* "S3netCDF4/_s3netCDF4.pyx":1273
 *             else:
 *                 file_type = format
 *                 self._creation_params["format"] = format             # <<<<<<<<<<<<<<
 *                 self._cfa_dataset = None
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_creation_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_format, __pyx_v_format) < 0)) __PYX_ERR(0, 1273, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1274
 *                 file_type = format
 *                 self._creation_params["format"] = format
 *                 self._cfa_dataset = None             # <<<<<<<<<<<<<<
 * 
 *             if self._managed_object.file_object.remote_system:
 */
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset, Py_None) < 0) __PYX_ERR(0, 1274, __pyx_L1_error)
    }
    __pyx_L8:;

    /* "S3netCDF4/_s3netCDF4.pyx":1276
 *                 self._cfa_dataset = None
 * 
 *             if self._managed_object.file_object.remote_system:             # <<<<<<<<<<<<<<
 *                 # call the constructor of the netCDF4.Dataset class
 *                 self._nc_dataset = netCDF4.Dataset(
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_managed_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_file_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_remote_system); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1276, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_1) {

      /* "S3netCDF4/_s3netCDF4.pyx":1278
 *             if self._managed_object.file_object.remote_system:
 *                 # call the constructor of the netCDF4.Dataset class
 *                 self._nc_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *                     "inmemory.nc", mode=mode, clobber=clobber,
 *                     format=file_type, diskless=True, persist=False,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Dataset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1279
 *                 # call the constructor of the netCDF4.Dataset class
 *                 self._nc_dataset = netCDF4.Dataset(
 *                     "inmemory.nc", mode=mode, clobber=clobber,             # <<<<<<<<<<<<<<
 *                     format=file_type, diskless=True, persist=False,
 *                     keepweakref=keepweakref, memory=0, **kwargs
 */
      __pyx_t_6 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_v_mode) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_clobber, __pyx_v_clobber) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1280
 *                 self._nc_dataset = netCDF4.Dataset(
 *                     "inmemory.nc", mode=mode, clobber=clobber,
 *                     format=file_type, diskless=True, persist=False,             # <<<<<<<<<<<<<<
 *                     keepweakref=keepweakref, memory=0, **kwargs
 *                 )
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_format, __pyx_v_file_type) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_diskless, Py_True) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_persist, Py_False) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1281
 *                     "inmemory.nc", mode=mode, clobber=clobber,
 *                     format=file_type, diskless=True, persist=False,
 *                     keepweakref=keepweakref, memory=0, **kwargs             # <<<<<<<<<<<<<<
 *                 )
 *                 # indicate successfully open
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_keepweakref, __pyx_v_keepweakref) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_memory, __pyx_int_0) < 0) __PYX_ERR(0, 1279, __pyx_L1_error)
      __pyx_t_5 = __pyx_t_6;
      __pyx_t_6 = 0;
      if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwargs) < 0) __PYX_ERR(0, 1281, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1278
 *             if self._managed_object.file_object.remote_system:
 *                 # call the constructor of the netCDF4.Dataset class
 *                 self._nc_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *                     "inmemory.nc", mode=mode, clobber=clobber,
 *                     format=file_type, diskless=True, persist=False,
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__14, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset, __pyx_t_6) < 0) __PYX_ERR(0, 1278, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1284
 *                 )
 *                 # indicate successfully open
 *                 self._file_manager.open_success(filename)             # <<<<<<<<<<<<<<
 *             else:
 *                 # this is a non remote file, i.e. just on the disk
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_open_success); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && 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 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1284, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1276
 *                 self._cfa_dataset = None
 * 
 *             if self._managed_object.file_object.remote_system:             # <<<<<<<<<<<<<<
 *                 # call the constructor of the netCDF4.Dataset class
 *                 self._nc_dataset = netCDF4.Dataset(
 */
      goto __pyx_L11;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1289
 *                 # close the file object, as we don't need it anymore and free
 *                 # up file handles
 *                 self._managed_object.file_object.close()             # <<<<<<<<<<<<<<
 *                 # write the netCDF file
 *                 self._nc_dataset = netCDF4.Dataset(
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_managed_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_file_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && 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 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1291
 *                 self._managed_object.file_object.close()
 *                 # write the netCDF file
 *                 self._nc_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *                     filename, mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Dataset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1292
 *                 # write the netCDF file
 *                 self._nc_dataset = netCDF4.Dataset(
 *                     filename, mode=mode, clobber=clobber,             # <<<<<<<<<<<<<<
 *                     format=file_type, diskless=diskless, persist=persist,
 *                     keepweakref=keepweakref, **kwargs
 */
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_filename);

      /* "S3netCDF4/_s3netCDF4.pyx":1291
 *                 self._managed_object.file_object.close()
 *                 # write the netCDF file
 *                 self._nc_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *                     filename, mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,
 */
      __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "S3netCDF4/_s3netCDF4.pyx":1292
 *                 # write the netCDF file
 *                 self._nc_dataset = netCDF4.Dataset(
 *                     filename, mode=mode, clobber=clobber,             # <<<<<<<<<<<<<<
 *                     format=file_type, diskless=diskless, persist=persist,
 *                     keepweakref=keepweakref, **kwargs
 */
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mode, __pyx_v_mode) < 0) __PYX_ERR(0, 1292, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_clobber, __pyx_v_clobber) < 0) __PYX_ERR(0, 1292, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1293
 *                 self._nc_dataset = netCDF4.Dataset(
 *                     filename, mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,             # <<<<<<<<<<<<<<
 *                     keepweakref=keepweakref, **kwargs
 *                 )
 */
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_format, __pyx_v_file_type) < 0) __PYX_ERR(0, 1292, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_diskless, __pyx_v_diskless) < 0) __PYX_ERR(0, 1292, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_persist, __pyx_v_persist) < 0) __PYX_ERR(0, 1292, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1294
 *                     filename, mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,
 *                     keepweakref=keepweakref, **kwargs             # <<<<<<<<<<<<<<
 *                 )
 *                 # indicate successfully open
 */
      if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_keepweakref, __pyx_v_keepweakref) < 0) __PYX_ERR(0, 1292, __pyx_L1_error)
      __pyx_t_5 = __pyx_t_4;
      __pyx_t_4 = 0;
      if (__Pyx_MergeKeywords(__pyx_t_5, __pyx_v_kwargs) < 0) __PYX_ERR(0, 1294, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1291
 *                 self._managed_object.file_object.close()
 *                 # write the netCDF file
 *                 self._nc_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *                     filename, mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset, __pyx_t_4) < 0) __PYX_ERR(0, 1291, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1297
 *                 )
 *                 # indicate successfully open
 *                 self._file_manager.open_success(filename)             # <<<<<<<<<<<<<<
 *             # manage the interactions with the data_object
 *             self._managed_object.data_object = self._nc_dataset
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_open_success); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L11:;

    /* "S3netCDF4/_s3netCDF4.pyx":1299
 *                 self._file_manager.open_success(filename)
 *             # manage the interactions with the data_object
 *             self._managed_object.data_object = self._nc_dataset             # <<<<<<<<<<<<<<
 *         # handle read-only mode
 *         elif mode == 'r':
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_managed_object); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_n_s_data_object, __pyx_t_4) < 0) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1248
 * 
 *         # set the file up for write mode
 *         if mode == 'w':             # <<<<<<<<<<<<<<
 *             # check the format for writing - allow CFA4 in arguments and default
 *             # to CFA4 for writing so as to distribute files across subarrays
 */
    goto __pyx_L7;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1301
 *             self._managed_object.data_object = self._nc_dataset
 *         # handle read-only mode
 *         elif mode == 'r':             # <<<<<<<<<<<<<<
 *             # check the file exists
 *             if (
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_n_u_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1301, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "S3netCDF4/_s3netCDF4.pyx":1304
 *             # check the file exists
 *             if (
 *             self._managed_object.open_state == OpenFileRecord.DOES_NOT_EXIST             # <<<<<<<<<<<<<<
 *             ):
 *                 raise FileNotFoundError(
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_managed_object); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_open_state); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_DOES_NOT_EXIST); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1303
 *         elif mode == 'r':
 *             # check the file exists
 *             if (             # <<<<<<<<<<<<<<
 *             self._managed_object.open_state == OpenFileRecord.DOES_NOT_EXIST
 *             ):
 */
    if (unlikely(__pyx_t_1)) {

      /* "S3netCDF4/_s3netCDF4.pyx":1306
 *             self._managed_object.open_state == OpenFileRecord.DOES_NOT_EXIST
 *             ):
 *                 raise FileNotFoundError(             # <<<<<<<<<<<<<<
 *                     errno_ENOENT, strerror(errno_ENOENT), filename
 *                 )
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_FileNotFoundError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "S3netCDF4/_s3netCDF4.pyx":1307
 *             ):
 *                 raise FileNotFoundError(
 *                     errno_ENOENT, strerror(errno_ENOENT), filename             # <<<<<<<<<<<<<<
 *                 )
 *             # get the header data
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_errno_ENOENT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_strerror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_errno_ENOENT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1306
 *             self._managed_object.open_state == OpenFileRecord.DOES_NOT_EXIST
 *             ):
 *                 raise FileNotFoundError(             # <<<<<<<<<<<<<<
 *                     errno_ENOENT, strerror(errno_ENOENT), filename
 *                 )
 */
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_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_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_filename);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 1306, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1303
 *         elif mode == 'r':
 *             # check the file exists
 *             if (             # <<<<<<<<<<<<<<
 *             self._managed_object.open_state == OpenFileRecord.DOES_NOT_EXIST
 *             ):
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1310
 *                 )
 *             # get the header data
 *             data = self._managed_object.file_object.read_from(0, 6)             # <<<<<<<<<<<<<<
 *             file_type, file_version = s3Dataset._interpret_netCDF_filetype(data)
 *             # check what the file type is a netCDF file or not
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_managed_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_file_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_read_from); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_data = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1311
 *             # get the header data
 *             data = self._managed_object.file_object.read_from(0, 6)
 *             file_type, file_version = s3Dataset._interpret_netCDF_filetype(data)             # <<<<<<<<<<<<<<
 *             # check what the file type is a netCDF file or not
 *             if file_type == 'NOT_NETCDF':
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_s3Dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_interpret_netCDF_filetype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_data);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1311, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L13_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_5), 2) < 0) __PYX_ERR(0, 1311, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L14_unpacking_done;
      __pyx_L13_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1311, __pyx_L1_error)
      __pyx_L14_unpacking_done:;
    }
    __pyx_v_file_type = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_v_file_version = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1313
 *             file_type, file_version = s3Dataset._interpret_netCDF_filetype(data)
 *             # check what the file type is a netCDF file or not
 *             if file_type == 'NOT_NETCDF':             # <<<<<<<<<<<<<<
 *                 raise IOError("File: {} is not a netCDF file".format(filename))
 *                 # read the file in, or create it
 */
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_file_type, __pyx_n_u_NOT_NETCDF, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1313, __pyx_L1_error)
    if (unlikely(__pyx_t_1)) {

      /* "S3netCDF4/_s3netCDF4.pyx":1314
 *             # check what the file type is a netCDF file or not
 *             if file_type == 'NOT_NETCDF':
 *                 raise IOError("File: {} is not a netCDF file".format(filename))             # <<<<<<<<<<<<<<
 *                 # read the file in, or create it
 *             if self._managed_object.file_object.remote_system:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_File_is_not_a_netCDF_file, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && 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);
        }
      }
      __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_filename);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 1314, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1313
 *             file_type, file_version = s3Dataset._interpret_netCDF_filetype(data)
 *             # check what the file type is a netCDF file or not
 *             if file_type == 'NOT_NETCDF':             # <<<<<<<<<<<<<<
 *                 raise IOError("File: {} is not a netCDF file".format(filename))
 *                 # read the file in, or create it
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1316
 *                 raise IOError("File: {} is not a netCDF file".format(filename))
 *                 # read the file in, or create it
 *             if self._managed_object.file_object.remote_system:             # <<<<<<<<<<<<<<
 *                 # stream into memory
 *                 nc_bytes = self._managed_object.file_object.read()
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_managed_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_file_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_remote_system); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1316, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "S3netCDF4/_s3netCDF4.pyx":1318
 *             if self._managed_object.file_object.remote_system:
 *                 # stream into memory
 *                 nc_bytes = self._managed_object.file_object.read()             # <<<<<<<<<<<<<<
 *                 # call the base constructor
 *                 self._nc_dataset = netCDF4.Dataset(
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_managed_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_file_object); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_nc_bytes = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1320
 *                 nc_bytes = self._managed_object.file_object.read()
 *                 # call the base constructor
 *                 self._nc_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *                     "inmemory.nc", mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1320, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Dataset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1321
 *                 # call the base constructor
 *                 self._nc_dataset = netCDF4.Dataset(
 *                     "inmemory.nc", mode=mode, clobber=clobber,             # <<<<<<<<<<<<<<
 *                     format=file_type, diskless=diskless, persist=persist,
 *                     keepweakref=keepweakref, memory=nc_bytes, **kwargs
 */
      __pyx_t_6 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1321, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_v_mode) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_clobber, __pyx_v_clobber) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1322
 *                 self._nc_dataset = netCDF4.Dataset(
 *                     "inmemory.nc", mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,             # <<<<<<<<<<<<<<
 *                     keepweakref=keepweakref, memory=nc_bytes, **kwargs
 *                 )
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_format, __pyx_v_file_type) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_diskless, __pyx_v_diskless) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_persist, __pyx_v_persist) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1323
 *                     "inmemory.nc", mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,
 *                     keepweakref=keepweakref, memory=nc_bytes, **kwargs             # <<<<<<<<<<<<<<
 *                 )
 *                 # indicate successfully open
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_keepweakref, __pyx_v_keepweakref) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_memory, __pyx_v_nc_bytes) < 0) __PYX_ERR(0, 1321, __pyx_L1_error)
      __pyx_t_4 = __pyx_t_6;
      __pyx_t_6 = 0;
      if (__Pyx_MergeKeywords(__pyx_t_4, __pyx_v_kwargs) < 0) __PYX_ERR(0, 1323, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1320
 *                 nc_bytes = self._managed_object.file_object.read()
 *                 # call the base constructor
 *                 self._nc_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *                     "inmemory.nc", mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__14, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1320, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset, __pyx_t_6) < 0) __PYX_ERR(0, 1320, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1326
 *                 )
 *                 # indicate successfully open
 *                 self._file_manager.open_success(filename)             # <<<<<<<<<<<<<<
 *             else:
 *                 # close the file object, as we don't need it anymore and free
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_open_success); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && 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 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1316
 *                 raise IOError("File: {} is not a netCDF file".format(filename))
 *                 # read the file in, or create it
 *             if self._managed_object.file_object.remote_system:             # <<<<<<<<<<<<<<
 *                 # stream into memory
 *                 nc_bytes = self._managed_object.file_object.read()
 */
      goto __pyx_L16;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1330
 *                 # close the file object, as we don't need it anymore and free
 *                 # up file handles
 *                 self._managed_object.file_object.close()             # <<<<<<<<<<<<<<
 *                 # create the ncDataset
 *                 self._nc_dataset = netCDF4.Dataset(
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_managed_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_file_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __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_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && 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 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1332
 *                 self._managed_object.file_object.close()
 *                 # create the ncDataset
 *                 self._nc_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *                     filename, mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Dataset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1333
 *                 # create the ncDataset
 *                 self._nc_dataset = netCDF4.Dataset(
 *                     filename, mode=mode, clobber=clobber,             # <<<<<<<<<<<<<<
 *                     format=file_type, diskless=diskless, persist=persist,
 *                     keepweakref=keepweakref, **kwargs
 */
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_filename);

      /* "S3netCDF4/_s3netCDF4.pyx":1332
 *                 self._managed_object.file_object.close()
 *                 # create the ncDataset
 *                 self._nc_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *                     filename, mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "S3netCDF4/_s3netCDF4.pyx":1333
 *                 # create the ncDataset
 *                 self._nc_dataset = netCDF4.Dataset(
 *                     filename, mode=mode, clobber=clobber,             # <<<<<<<<<<<<<<
 *                     format=file_type, diskless=diskless, persist=persist,
 *                     keepweakref=keepweakref, **kwargs
 */
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_v_mode) < 0) __PYX_ERR(0, 1333, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_clobber, __pyx_v_clobber) < 0) __PYX_ERR(0, 1333, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1334
 *                 self._nc_dataset = netCDF4.Dataset(
 *                     filename, mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,             # <<<<<<<<<<<<<<
 *                     keepweakref=keepweakref, **kwargs
 *                 )
 */
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_format, __pyx_v_file_type) < 0) __PYX_ERR(0, 1333, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_diskless, __pyx_v_diskless) < 0) __PYX_ERR(0, 1333, __pyx_L1_error)
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_persist, __pyx_v_persist) < 0) __PYX_ERR(0, 1333, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1335
 *                     filename, mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,
 *                     keepweakref=keepweakref, **kwargs             # <<<<<<<<<<<<<<
 *                 )
 *                 self._managed_object.data_object = self._nc_dataset
 */
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_keepweakref, __pyx_v_keepweakref) < 0) __PYX_ERR(0, 1333, __pyx_L1_error)
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_5 = 0;
      if (__Pyx_MergeKeywords(__pyx_t_4, __pyx_v_kwargs) < 0) __PYX_ERR(0, 1335, __pyx_L1_error)

      /* "S3netCDF4/_s3netCDF4.pyx":1332
 *                 self._managed_object.file_object.close()
 *                 # create the ncDataset
 *                 self._nc_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *                     filename, mode=mode, clobber=clobber,
 *                     format=file_type, diskless=diskless, persist=persist,
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset, __pyx_t_5) < 0) __PYX_ERR(0, 1332, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1337
 *                     keepweakref=keepweakref, **kwargs
 *                 )
 *                 self._managed_object.data_object = self._nc_dataset             # <<<<<<<<<<<<<<
 *                 # indicate successfully open
 *                 self._file_manager.open_success(filename)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_managed_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_n_s_data_object, __pyx_t_5) < 0) __PYX_ERR(0, 1337, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1339
 *                 self._managed_object.data_object = self._nc_dataset
 *                 # indicate successfully open
 *                 self._file_manager.open_success(filename)             # <<<<<<<<<<<<<<
 * 
 *             # parse the CFA file if it is one
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_open_success); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L16:;

    /* "S3netCDF4/_s3netCDF4.pyx":1342
 * 
 *             # parse the CFA file if it is one
 *             parser = CFA_netCDFParser()             # <<<<<<<<<<<<<<
 *             if parser.is_file(self._nc_dataset):
 *                 parser.read(self, filename)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_CFA_netCDFParser); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_parser = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1343
 *             # parse the CFA file if it is one
 *             parser = CFA_netCDFParser()
 *             if parser.is_file(self._nc_dataset):             # <<<<<<<<<<<<<<
 *                 parser.read(self, filename)
 *         else:
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_is_file); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && 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);
      }
    }
    __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "S3netCDF4/_s3netCDF4.pyx":1344
 *             parser = CFA_netCDFParser()
 *             if parser.is_file(self._nc_dataset):
 *                 parser.read(self, filename)             # <<<<<<<<<<<<<<
 *         else:
 *             # no other modes are supported
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_read); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_10 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self, __pyx_v_filename};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1344, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self, __pyx_v_filename};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1344, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_self);
        __Pyx_GIVEREF(__pyx_v_self);
        PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_10, __pyx_v_self);
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_v_filename);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1344, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1343
 *             # parse the CFA file if it is one
 *             parser = CFA_netCDFParser()
 *             if parser.is_file(self._nc_dataset):             # <<<<<<<<<<<<<<
 *                 parser.read(self, filename)
 *         else:
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1301
 *             self._managed_object.data_object = self._nc_dataset
 *         # handle read-only mode
 *         elif mode == 'r':             # <<<<<<<<<<<<<<
 *             # check the file exists
 *             if (
 */
    goto __pyx_L7;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1347
 *         else:
 *             # no other modes are supported
 *             raise APIException("Mode " + mode + " not supported.")             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_APIException); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyNumber_Add(__pyx_kp_u_Mode, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_kp_u_not_supported); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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);
      }
    }
    __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1347, __pyx_L1_error)
  }
  __pyx_L7:;

  /* "S3netCDF4/_s3netCDF4.pyx":1202
 *         return self._managed_object.file_object
 * 
 *     def __init__(self, filename, mode='r', clobber=True, format='DEFAULT',             # <<<<<<<<<<<<<<
 *                  diskless=False, persist=False, keepweakref=False, memory=None,
 *                  cfa_version="0.5", **kwargs):
 */

  /* 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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_file_type);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_file_version);
  __Pyx_XDECREF(__pyx_v_nc_bytes);
  __Pyx_XDECREF(__pyx_v_parser);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1349
 *             raise APIException("Mode " + mode + " not supported.")
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Allow with s3Dataset statements."""
 *         return self
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_5__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_4__enter__[] = "Allow with s3Dataset statements.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_5__enter__ = {"__enter__", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_5__enter__, METH_O, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_4__enter__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_5__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_4__enter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_4__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1351
 *     def __enter__(self):
 *         """Allow with s3Dataset statements."""
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, atype, value, traceback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":1349
 *             raise APIException("Mode " + mode + " not supported.")
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Allow with s3Dataset statements."""
 *         return self
 */

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

/* "S3netCDF4/_s3netCDF4.pyx":1353
 *         return self
 * 
 *     def __exit__(self, atype, value, traceback):             # <<<<<<<<<<<<<<
 *         """Close on exit"""
 *         self.close()
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_7__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_6__exit__[] = "Close on exit";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_7__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_6__exit__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_7__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_atype = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_atype,&__pyx_n_s_value,&__pyx_n_s_traceback,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 1); __PYX_ERR(0, 1353, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 2); __PYX_ERR(0, 1353, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 3); __PYX_ERR(0, 1353, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 1353, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_atype = values[1];
    __pyx_v_value = values[2];
    __pyx_v_traceback = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1353, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_6__exit__(__pyx_self, __pyx_v_self, __pyx_v_atype, __pyx_v_value, __pyx_v_traceback);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_6__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_atype, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1355
 *     def __exit__(self, atype, value, traceback):
 *         """Close on exit"""
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":1353
 *         return self
 * 
 *     def __exit__(self, atype, value, traceback):             # <<<<<<<<<<<<<<
 *         """Close on exit"""
 *         self.close()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1357
 *         self.close()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """Close the Dataset."""
 *         # write the metadata to (all) the file(s)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_9close(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_8close[] = "Close the Dataset.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_9close = {"close", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_9close, METH_O, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_8close};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_9close(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_8close(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_8close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_parser = 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;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1360
 *         """Close the Dataset."""
 *         # write the metadata to (all) the file(s)
 *         if (self._mode == 'w' and             # <<<<<<<<<<<<<<
 *             hasattr(self, "_cfa_dataset") and
 *             self._cfa_dataset):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mode_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_w, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1361
 *         # write the metadata to (all) the file(s)
 *         if (self._mode == 'w' and
 *             hasattr(self, "_cfa_dataset") and             # <<<<<<<<<<<<<<
 *             self._cfa_dataset):
 *             parser = CFA_netCDFParser()
 */
  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1361, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1362
 *         if (self._mode == 'w' and
 *             hasattr(self, "_cfa_dataset") and
 *             self._cfa_dataset):             # <<<<<<<<<<<<<<
 *             parser = CFA_netCDFParser()
 *             parser.write(self._cfa_dataset, self)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;

  /* "S3netCDF4/_s3netCDF4.pyx":1360
 *         """Close the Dataset."""
 *         # write the metadata to (all) the file(s)
 *         if (self._mode == 'w' and             # <<<<<<<<<<<<<<
 *             hasattr(self, "_cfa_dataset") and
 *             self._cfa_dataset):
 */
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1363
 *             hasattr(self, "_cfa_dataset") and
 *             self._cfa_dataset):
 *             parser = CFA_netCDFParser()             # <<<<<<<<<<<<<<
 *             parser.write(self._cfa_dataset, self)
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CFA_netCDFParser); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_parser = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1364
 *             self._cfa_dataset):
 *             parser = CFA_netCDFParser()
 *             parser.write(self._cfa_dataset, self)             # <<<<<<<<<<<<<<
 * 
 *         # Close and possibly upload any file in the FileManager
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_self};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_self};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1364, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
      __Pyx_INCREF(__pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_self);
      __pyx_t_6 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1360
 *         """Close the Dataset."""
 *         # write the metadata to (all) the file(s)
 *         if (self._mode == 'w' and             # <<<<<<<<<<<<<<
 *             hasattr(self, "_cfa_dataset") and
 *             self._cfa_dataset):
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1368
 *         # Close and possibly upload any file in the FileManager
 *         # This will be the Master Array File and any SubArray files
 *         self._file_manager.free_all_files()             # <<<<<<<<<<<<<<
 * 
 *         # free all the arrays in the FileManager
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_free_all_files); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && 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);
    }
  }
  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1371
 * 
 *         # free all the arrays in the FileManager
 *         self._file_manager.free_all_arrays()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_manager); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_free_all_arrays); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1357
 *         self.close()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """Close the Dataset."""
 *         # write the metadata to (all) the file(s)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_parser);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1373
 *         self._file_manager.free_all_arrays()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """Close the dataset when no references are left to the S3Dataset"""
 *         self.close()
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_11__dealloc__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_10__dealloc__[] = "Close the dataset when no references are left to the S3Dataset";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_11__dealloc__ = {"__dealloc__", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_11__dealloc__, METH_O, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_10__dealloc__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_11__dealloc__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_10__dealloc__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_10__dealloc__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("__dealloc__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1375
 *     def __dealloc__(self):
 *         """Close the dataset when no references are left to the S3Dataset"""
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 *     def createDimension(self, dimname, size=None,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":1373
 *         self._file_manager.free_all_arrays()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """Close the dataset when no references are left to the S3Dataset"""
 *         self.close()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1377
 *         self.close()
 * 
 *     def createDimension(self, dimname, size=None,             # <<<<<<<<<<<<<<
 *                         axis_type="U", metadata={}):
 *         """Create a dimension in the Dataset.  This just calls createDimension
 */

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject*)__pyx_n_u_U));
  __Pyx_GIVEREF(((PyObject*)__pyx_n_u_U));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_n_u_U));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_metadata);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_metadata);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_metadata);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __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(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_13createDimension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_12createDimension[] = "Create a dimension in the Dataset.  This just calls createDimension\n        on the root group";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_13createDimension = {"createDimension", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_13createDimension, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_12createDimension};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_13createDimension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_dimname = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_v_axis_type = 0;
  PyObject *__pyx_v_metadata = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createDimension (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dimname,&__pyx_n_s_size,&__pyx_n_s_axis_type,&__pyx_n_s_metadata,0};
    PyObject* values[5] = {0,0,0,0,0};
    __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self);
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject*)__pyx_n_u_U));
    values[4] = __pyx_dynamic_args->__pyx_arg_metadata;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dimname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createDimension", 0, 2, 5, 1); __PYX_ERR(0, 1377, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_axis_type);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metadata);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDimension") < 0)) __PYX_ERR(0, 1377, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_dimname = values[1];
    __pyx_v_size = values[2];
    __pyx_v_axis_type = values[3];
    __pyx_v_metadata = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createDimension", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1377, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.createDimension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_12createDimension(__pyx_self, __pyx_v_self, __pyx_v_dimname, __pyx_v_size, __pyx_v_axis_type, __pyx_v_metadata);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_12createDimension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dimname, PyObject *__pyx_v_size, PyObject *__pyx_v_axis_type, PyObject *__pyx_v_metadata) {
  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("createDimension", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1381
 *         """Create a dimension in the Dataset.  This just calls createDimension
 *         on the root group"""
 *         self._s3_dimensions[dimname] = s3Dimension()             # <<<<<<<<<<<<<<
 *         self._s3_dimensions[dimname].create(
 *             self,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_s3Dimension); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_dimensions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_dimname, __pyx_t_1) < 0)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1382
 *         on the root group"""
 *         self._s3_dimensions[dimname] = s3Dimension()
 *         self._s3_dimensions[dimname].create(             # <<<<<<<<<<<<<<
 *             self,
 *             dimname,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_dimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_dimname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1384
 *         self._s3_dimensions[dimname].create(
 *             self,
 *             dimname,             # <<<<<<<<<<<<<<
 *             size=size,
 *             axis_type=axis_type,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
  __Pyx_INCREF(__pyx_v_dimname);
  __Pyx_GIVEREF(__pyx_v_dimname);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_dimname);

  /* "S3netCDF4/_s3netCDF4.pyx":1385
 *             self,
 *             dimname,
 *             size=size,             # <<<<<<<<<<<<<<
 *             axis_type=axis_type,
 *             metadata=metadata
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_size, __pyx_v_size) < 0) __PYX_ERR(0, 1385, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1386
 *             dimname,
 *             size=size,
 *             axis_type=axis_type,             # <<<<<<<<<<<<<<
 *             metadata=metadata
 *         )
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_axis_type, __pyx_v_axis_type) < 0) __PYX_ERR(0, 1385, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1387
 *             size=size,
 *             axis_type=axis_type,
 *             metadata=metadata             # <<<<<<<<<<<<<<
 *         )
 *         return self._s3_dimensions[dimname]
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(0, 1385, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1382
 *         on the root group"""
 *         self._s3_dimensions[dimname] = s3Dimension()
 *         self._s3_dimensions[dimname].create(             # <<<<<<<<<<<<<<
 *             self,
 *             dimname,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1382, __pyx_L1_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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1389
 *             metadata=metadata
 *         )
 *         return self._s3_dimensions[dimname]             # <<<<<<<<<<<<<<
 * 
 *     def renameDimension(self, oldname, newname):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_dimensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_dimname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1389, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":1377
 *         self.close()
 * 
 *     def createDimension(self, dimname, size=None,             # <<<<<<<<<<<<<<
 *                         axis_type="U", metadata={}):
 *         """Create a dimension in the Dataset.  This just calls createDimension
 */

  /* 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("S3netCDF4._s3netCDF4.s3Dataset.createDimension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1391
 *         return self._s3_dimensions[dimname]
 * 
 *     def renameDimension(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the dimension by overloading the base method."""
 *         if not oldname in self.dimensions:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_15renameDimension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_14renameDimension[] = "Rename the dimension by overloading the base method.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_15renameDimension = {"renameDimension", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_15renameDimension, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_14renameDimension};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_15renameDimension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_oldname = 0;
  PyObject *__pyx_v_newname = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("renameDimension (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldname,&__pyx_n_s_newname,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_oldname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renameDimension", 1, 3, 3, 1); __PYX_ERR(0, 1391, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_newname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renameDimension", 1, 3, 3, 2); __PYX_ERR(0, 1391, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameDimension") < 0)) __PYX_ERR(0, 1391, __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_self = values[0];
    __pyx_v_oldname = values[1];
    __pyx_v_newname = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("renameDimension", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1391, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.renameDimension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_14renameDimension(__pyx_self, __pyx_v_self, __pyx_v_oldname, __pyx_v_newname);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_14renameDimension(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname) {
  PyObject *__pyx_v_cfa_root_group = 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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("renameDimension", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1393
 *     def renameDimension(self, oldname, newname):
 *         """Rename the dimension by overloading the base method."""
 *         if not oldname in self.dimensions:             # <<<<<<<<<<<<<<
 *             raise APIException(
 *                 "Dimension name: {} does not exist.".format(oldname)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_oldname, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "S3netCDF4/_s3netCDF4.pyx":1394
 *         """Rename the dimension by overloading the base method."""
 *         if not oldname in self.dimensions:
 *             raise APIException(             # <<<<<<<<<<<<<<
 *                 "Dimension name: {} does not exist.".format(oldname)
 *             )
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_APIException); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "S3netCDF4/_s3netCDF4.pyx":1395
 *         if not oldname in self.dimensions:
 *             raise APIException(
 *                 "Dimension name: {} does not exist.".format(oldname)             # <<<<<<<<<<<<<<
 *             )
 *         # get the cfa root group
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Dimension_name_does_not_exist, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_oldname) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_oldname);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1394, __pyx_L1_error)

    /* "S3netCDF4/_s3netCDF4.pyx":1393
 *     def renameDimension(self, oldname, newname):
 *         """Rename the dimension by overloading the base method."""
 *         if not oldname in self.dimensions:             # <<<<<<<<<<<<<<
 *             raise APIException(
 *                 "Dimension name: {} does not exist.".format(oldname)
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1398
 *             )
 *         # get the cfa root group
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             cfa_root_group = self._cfa_dataset.getGroup("root")
 *             cfa_root_group.renameDimension(oldname, newname)
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1398, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_2 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":1399
 *         # get the cfa root group
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             cfa_root_group = self._cfa_dataset.getGroup("root")             # <<<<<<<<<<<<<<
 *             cfa_root_group.renameDimension(oldname, newname)
 *         self._nc_dataset.renameDimension(oldname, newname)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getGroup); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && 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 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_n_u_root) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_u_root);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_cfa_root_group = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1400
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             cfa_root_group = self._cfa_dataset.getGroup("root")
 *             cfa_root_group.renameDimension(oldname, newname)             # <<<<<<<<<<<<<<
 *         self._nc_dataset.renameDimension(oldname, newname)
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_root_group, __pyx_n_s_renameDimension); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && 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_9 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_oldname, __pyx_v_newname};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_oldname, __pyx_v_newname};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1400, __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_oldname);
      __Pyx_GIVEREF(__pyx_v_oldname);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_v_oldname);
      __Pyx_INCREF(__pyx_v_newname);
      __Pyx_GIVEREF(__pyx_v_newname);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_v_newname);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1398
 *             )
 *         # get the cfa root group
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             cfa_root_group = self._cfa_dataset.getGroup("root")
 *             cfa_root_group.renameDimension(oldname, newname)
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1401
 *             cfa_root_group = self._cfa_dataset.getGroup("root")
 *             cfa_root_group.renameDimension(oldname, newname)
 *         self._nc_dataset.renameDimension(oldname, newname)             # <<<<<<<<<<<<<<
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_renameDimension); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_oldname, __pyx_v_newname};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_oldname, __pyx_v_newname};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_oldname);
    __Pyx_GIVEREF(__pyx_v_oldname);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_v_oldname);
    __Pyx_INCREF(__pyx_v_newname);
    __Pyx_GIVEREF(__pyx_v_newname);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_v_newname);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1391
 *         return self._s3_dimensions[dimname]
 * 
 *     def renameDimension(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the dimension by overloading the base method."""
 *         if not oldname in self.dimensions:
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.renameDimension", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cfa_root_group);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1403
 *         self._nc_dataset.renameDimension(oldname, newname)
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *                        complevel=4, shuffle=True, fletcher32=False,
 *                        contiguous=False, chunksizes=None, endian='native',
 */

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

  /* "S3netCDF4/_s3netCDF4.pyx":1407
 *                        contiguous=False, chunksizes=None, endian='native',
 *                        least_significant_digit=None, fill_value=None,
 *                        chunk_cache=None, subarray_shape=np.array([]),             # <<<<<<<<<<<<<<
 *                        max_subarray_size=0):
 *         """Create a variable in the Dataset.  Add the CFAVariable structure to
 */
  __pyx_t_1 = PyTuple_New(13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject*)__pyx_empty_tuple));
  __Pyx_GIVEREF(((PyObject*)__pyx_empty_tuple));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)__pyx_empty_tuple));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)__pyx_int_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_4));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_int_4));
  __Pyx_INCREF(((PyObject *)Py_True));
  __Pyx_GIVEREF(((PyObject *)Py_True));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_True));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject*)__pyx_n_u_native));
  __Pyx_GIVEREF(((PyObject*)__pyx_n_u_native));
  PyTuple_SET_ITEM(__pyx_t_1, 7, ((PyObject*)__pyx_n_u_native));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 8, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 9, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 10, ((PyObject *)Py_None));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_subarray_shape);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_subarray_shape);
  PyTuple_SET_ITEM(__pyx_t_1, 11, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_subarray_shape);
  __Pyx_INCREF(((PyObject *)__pyx_int_0));
  __Pyx_GIVEREF(((PyObject *)__pyx_int_0));
  PyTuple_SET_ITEM(__pyx_t_1, 12, ((PyObject *)__pyx_int_0));

  /* "S3netCDF4/_s3netCDF4.pyx":1403
 *         self._nc_dataset.renameDimension(oldname, newname)
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *                        complevel=4, shuffle=True, fletcher32=False,
 *                        contiguous=False, chunksizes=None, endian='native',
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __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(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_17createVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_16createVariable[] = "Create a variable in the Dataset.  Add the CFAVariable structure to\n        the Dataset by calling createVariable on self._cfa_dataset.\n        ";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_17createVariable = {"createVariable", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_17createVariable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_16createVariable};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_17createVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_varname = 0;
  PyObject *__pyx_v_datatype = 0;
  PyObject *__pyx_v_dimensions = 0;
  PyObject *__pyx_v_zlib = 0;
  PyObject *__pyx_v_complevel = 0;
  PyObject *__pyx_v_shuffle = 0;
  PyObject *__pyx_v_fletcher32 = 0;
  PyObject *__pyx_v_contiguous = 0;
  PyObject *__pyx_v_chunksizes = 0;
  PyObject *__pyx_v_endian = 0;
  PyObject *__pyx_v_least_significant_digit = 0;
  PyObject *__pyx_v_fill_value = 0;
  PyObject *__pyx_v_chunk_cache = 0;
  PyObject *__pyx_v_subarray_shape = 0;
  PyObject *__pyx_v_max_subarray_size = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createVariable (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_varname,&__pyx_n_s_datatype,&__pyx_n_s_dimensions,&__pyx_n_s_zlib,&__pyx_n_s_complevel,&__pyx_n_s_shuffle,&__pyx_n_s_fletcher32,&__pyx_n_s_contiguous,&__pyx_n_s_chunksizes,&__pyx_n_s_endian,&__pyx_n_s_least_significant_digit,&__pyx_n_s_fill_value,&__pyx_n_s_chunk_cache,&__pyx_n_s_subarray_shape,&__pyx_n_s_max_subarray_size,0};
    PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults5 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self);
    values[3] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    values[4] = ((PyObject *)((PyObject *)Py_False));
    values[5] = ((PyObject *)((PyObject *)__pyx_int_4));
    values[6] = ((PyObject *)((PyObject *)Py_True));
    values[7] = ((PyObject *)((PyObject *)Py_False));
    values[8] = ((PyObject *)((PyObject *)Py_False));
    values[9] = ((PyObject *)((PyObject *)Py_None));
    values[10] = ((PyObject *)((PyObject*)__pyx_n_u_native));
    values[11] = ((PyObject *)((PyObject *)Py_None));
    values[12] = ((PyObject *)((PyObject *)Py_None));
    values[13] = ((PyObject *)((PyObject *)Py_None));
    values[14] = __pyx_dynamic_args->__pyx_arg_subarray_shape;
    values[15] = ((PyObject *)((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 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_varname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createVariable", 0, 3, 16, 1); __PYX_ERR(0, 1403, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_datatype)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createVariable", 0, 3, 16, 2); __PYX_ERR(0, 1403, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dimensions);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zlib);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_complevel);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shuffle);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fletcher32);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_contiguous);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chunksizes);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_endian);
          if (value) { values[10] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 11:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_least_significant_digit);
          if (value) { values[11] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 12:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill_value);
          if (value) { values[12] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 13:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chunk_cache);
          if (value) { values[13] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 14:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subarray_shape);
          if (value) { values[14] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 15:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_subarray_size);
          if (value) { values[15] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createVariable") < 0)) __PYX_ERR(0, 1403, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        CYTHON_FALLTHROUGH;
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        CYTHON_FALLTHROUGH;
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        CYTHON_FALLTHROUGH;
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        CYTHON_FALLTHROUGH;
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        CYTHON_FALLTHROUGH;
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_self = values[0];
    __pyx_v_varname = values[1];
    __pyx_v_datatype = values[2];
    __pyx_v_dimensions = values[3];
    __pyx_v_zlib = values[4];
    __pyx_v_complevel = values[5];
    __pyx_v_shuffle = values[6];
    __pyx_v_fletcher32 = values[7];
    __pyx_v_contiguous = values[8];
    __pyx_v_chunksizes = values[9];
    __pyx_v_endian = values[10];
    __pyx_v_least_significant_digit = values[11];
    __pyx_v_fill_value = values[12];
    __pyx_v_chunk_cache = values[13];
    __pyx_v_subarray_shape = values[14];
    __pyx_v_max_subarray_size = values[15];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createVariable", 0, 3, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1403, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.createVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_16createVariable(__pyx_self, __pyx_v_self, __pyx_v_varname, __pyx_v_datatype, __pyx_v_dimensions, __pyx_v_zlib, __pyx_v_complevel, __pyx_v_shuffle, __pyx_v_fletcher32, __pyx_v_contiguous, __pyx_v_chunksizes, __pyx_v_endian, __pyx_v_least_significant_digit, __pyx_v_fill_value, __pyx_v_chunk_cache, __pyx_v_subarray_shape, __pyx_v_max_subarray_size);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_16createVariable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_varname, PyObject *__pyx_v_datatype, PyObject *__pyx_v_dimensions, PyObject *__pyx_v_zlib, PyObject *__pyx_v_complevel, PyObject *__pyx_v_shuffle, PyObject *__pyx_v_fletcher32, PyObject *__pyx_v_contiguous, PyObject *__pyx_v_chunksizes, PyObject *__pyx_v_endian, PyObject *__pyx_v_least_significant_digit, PyObject *__pyx_v_fill_value, PyObject *__pyx_v_chunk_cache, PyObject *__pyx_v_subarray_shape, PyObject *__pyx_v_max_subarray_size) {
  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("createVariable", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1412
 *         the Dataset by calling createVariable on self._cfa_dataset.
 *         """
 *         self._s3_variables[varname] = s3Variable()             # <<<<<<<<<<<<<<
 *         self._s3_variables[varname].create(
 *             self,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_s3Variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_varname, __pyx_t_1) < 0)) __PYX_ERR(0, 1412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1413
 *         """
 *         self._s3_variables[varname] = s3Variable()
 *         self._s3_variables[varname].create(             # <<<<<<<<<<<<<<
 *             self,
 *             varname,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_varname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1416
 *             self,
 *             varname,
 *             datatype,             # <<<<<<<<<<<<<<
 *             dimensions=dimensions,
 *             zlib=zlib,
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
  __Pyx_INCREF(__pyx_v_varname);
  __Pyx_GIVEREF(__pyx_v_varname);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_varname);
  __Pyx_INCREF(__pyx_v_datatype);
  __Pyx_GIVEREF(__pyx_v_datatype);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_datatype);

  /* "S3netCDF4/_s3netCDF4.pyx":1417
 *             varname,
 *             datatype,
 *             dimensions=dimensions,             # <<<<<<<<<<<<<<
 *             zlib=zlib,
 *             complevel=complevel,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dimensions, __pyx_v_dimensions) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1418
 *             datatype,
 *             dimensions=dimensions,
 *             zlib=zlib,             # <<<<<<<<<<<<<<
 *             complevel=complevel,
 *             shuffle=shuffle,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_zlib, __pyx_v_zlib) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1419
 *             dimensions=dimensions,
 *             zlib=zlib,
 *             complevel=complevel,             # <<<<<<<<<<<<<<
 *             shuffle=shuffle,
 *             fletcher32=fletcher32,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_complevel, __pyx_v_complevel) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1420
 *             zlib=zlib,
 *             complevel=complevel,
 *             shuffle=shuffle,             # <<<<<<<<<<<<<<
 *             fletcher32=fletcher32,
 *             contiguous=contiguous,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1421
 *             complevel=complevel,
 *             shuffle=shuffle,
 *             fletcher32=fletcher32,             # <<<<<<<<<<<<<<
 *             contiguous=contiguous,
 *             chunksizes=chunksizes,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fletcher32, __pyx_v_fletcher32) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1422
 *             shuffle=shuffle,
 *             fletcher32=fletcher32,
 *             contiguous=contiguous,             # <<<<<<<<<<<<<<
 *             chunksizes=chunksizes,
 *             endian=endian,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_contiguous, __pyx_v_contiguous) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1423
 *             fletcher32=fletcher32,
 *             contiguous=contiguous,
 *             chunksizes=chunksizes,             # <<<<<<<<<<<<<<
 *             endian=endian,
 *             least_significant_digit=least_significant_digit,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chunksizes, __pyx_v_chunksizes) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1424
 *             contiguous=contiguous,
 *             chunksizes=chunksizes,
 *             endian=endian,             # <<<<<<<<<<<<<<
 *             least_significant_digit=least_significant_digit,
 *             fill_value=fill_value,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_endian, __pyx_v_endian) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1425
 *             chunksizes=chunksizes,
 *             endian=endian,
 *             least_significant_digit=least_significant_digit,             # <<<<<<<<<<<<<<
 *             fill_value=fill_value,
 *             chunk_cache=chunk_cache,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_least_significant_digit, __pyx_v_least_significant_digit) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1426
 *             endian=endian,
 *             least_significant_digit=least_significant_digit,
 *             fill_value=fill_value,             # <<<<<<<<<<<<<<
 *             chunk_cache=chunk_cache,
 *             subarray_shape=subarray_shape,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fill_value, __pyx_v_fill_value) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1427
 *             least_significant_digit=least_significant_digit,
 *             fill_value=fill_value,
 *             chunk_cache=chunk_cache,             # <<<<<<<<<<<<<<
 *             subarray_shape=subarray_shape,
 *             max_subarray_size=max_subarray_size
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chunk_cache, __pyx_v_chunk_cache) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1428
 *             fill_value=fill_value,
 *             chunk_cache=chunk_cache,
 *             subarray_shape=subarray_shape,             # <<<<<<<<<<<<<<
 *             max_subarray_size=max_subarray_size
 *         )
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_subarray_shape, __pyx_v_subarray_shape) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1429
 *             chunk_cache=chunk_cache,
 *             subarray_shape=subarray_shape,
 *             max_subarray_size=max_subarray_size             # <<<<<<<<<<<<<<
 *         )
 *         return self._s3_variables[varname]
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_max_subarray_size, __pyx_v_max_subarray_size) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1413
 *         """
 *         self._s3_variables[varname] = s3Variable()
 *         self._s3_variables[varname].create(             # <<<<<<<<<<<<<<
 *             self,
 *             varname,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1413, __pyx_L1_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_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1431
 *             max_subarray_size=max_subarray_size
 *         )
 *         return self._s3_variables[varname]             # <<<<<<<<<<<<<<
 * 
 *     def renameVariable(self, oldname, newname):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_varname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1431, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":1403
 *         self._nc_dataset.renameDimension(oldname, newname)
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *                        complevel=4, shuffle=True, fletcher32=False,
 *                        contiguous=False, chunksizes=None, endian='native',
 */

  /* 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("S3netCDF4._s3netCDF4.s3Dataset.createVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1433
 *         return self._s3_variables[varname]
 * 
 *     def renameVariable(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the variable by overloading the base method."""
 *         # get the cfa root group
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_19renameVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_18renameVariable[] = "Rename the variable by overloading the base method.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_19renameVariable = {"renameVariable", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_19renameVariable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_18renameVariable};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_19renameVariable(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_oldname = 0;
  PyObject *__pyx_v_newname = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("renameVariable (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldname,&__pyx_n_s_newname,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_oldname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renameVariable", 1, 3, 3, 1); __PYX_ERR(0, 1433, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_newname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renameVariable", 1, 3, 3, 2); __PYX_ERR(0, 1433, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameVariable") < 0)) __PYX_ERR(0, 1433, __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_self = values[0];
    __pyx_v_oldname = values[1];
    __pyx_v_newname = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("renameVariable", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1433, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.renameVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_18renameVariable(__pyx_self, __pyx_v_self, __pyx_v_oldname, __pyx_v_newname);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_18renameVariable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname) {
  PyObject *__pyx_v_cfa_root_group = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("renameVariable", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1436
 *         """Rename the variable by overloading the base method."""
 *         # get the cfa root group
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             cfa_root_group = self._cfa_dataset.getGroup("root")
 *             cfa_root_group.renameVariable(oldname, newname)
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1436, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1437
 *         # get the cfa root group
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             cfa_root_group = self._cfa_dataset.getGroup("root")             # <<<<<<<<<<<<<<
 *             cfa_root_group.renameVariable(oldname, newname)
 *         self._nc_dataset.renameVariable(oldname, newname)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getGroup); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_n_u_root) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_u_root);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_cfa_root_group = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1438
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             cfa_root_group = self._cfa_dataset.getGroup("root")
 *             cfa_root_group.renameVariable(oldname, newname)             # <<<<<<<<<<<<<<
 *         self._nc_dataset.renameVariable(oldname, newname)
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_root_group, __pyx_n_s_renameVariable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_oldname, __pyx_v_newname};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_oldname, __pyx_v_newname};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_oldname);
      __Pyx_GIVEREF(__pyx_v_oldname);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_oldname);
      __Pyx_INCREF(__pyx_v_newname);
      __Pyx_GIVEREF(__pyx_v_newname);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_newname);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1436
 *         """Rename the variable by overloading the base method."""
 *         # get the cfa root group
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             cfa_root_group = self._cfa_dataset.getGroup("root")
 *             cfa_root_group.renameVariable(oldname, newname)
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1439
 *             cfa_root_group = self._cfa_dataset.getGroup("root")
 *             cfa_root_group.renameVariable(oldname, newname)
 *         self._nc_dataset.renameVariable(oldname, newname)             # <<<<<<<<<<<<<<
 * 
 *     def createGroup(self, groupname):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_renameVariable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_oldname, __pyx_v_newname};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1439, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_oldname, __pyx_v_newname};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1439, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_oldname);
    __Pyx_GIVEREF(__pyx_v_oldname);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_oldname);
    __Pyx_INCREF(__pyx_v_newname);
    __Pyx_GIVEREF(__pyx_v_newname);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_newname);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1439, __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1433
 *         return self._s3_variables[varname]
 * 
 *     def renameVariable(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the variable by overloading the base method."""
 *         # get the cfa root group
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.renameVariable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cfa_root_group);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1441
 *         self._nc_dataset.renameVariable(oldname, newname)
 * 
 *     def createGroup(self, groupname):             # <<<<<<<<<<<<<<
 *         """Create a group.  If this file is a CFA file then create the CFAGroup
 *         as well."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_21createGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_20createGroup[] = "Create a group.  If this file is a CFA file then create the CFAGroup\n        as well.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_21createGroup = {"createGroup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_21createGroup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_20createGroup};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_21createGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_groupname = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createGroup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_groupname,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_groupname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("createGroup", 1, 2, 2, 1); __PYX_ERR(0, 1441, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createGroup") < 0)) __PYX_ERR(0, 1441, __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_self = values[0];
    __pyx_v_groupname = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createGroup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1441, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.createGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_20createGroup(__pyx_self, __pyx_v_self, __pyx_v_groupname);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_20createGroup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_groupname) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createGroup", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1444
 *         """Create a group.  If this file is a CFA file then create the CFAGroup
 *         as well."""
 *         self._s3_groups[groupname] = s3Group()             # <<<<<<<<<<<<<<
 *         self._s3_groups[groupname].create(self, groupname)
 *         return self._s3_groups[groupname]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_s3Group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_groups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_groupname, __pyx_t_1) < 0)) __PYX_ERR(0, 1444, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1445
 *         as well."""
 *         self._s3_groups[groupname] = s3Group()
 *         self._s3_groups[groupname].create(self, groupname)             # <<<<<<<<<<<<<<
 *         return self._s3_groups[groupname]
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_groups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_groupname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __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_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_groupname};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self, __pyx_v_groupname};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_groupname);
    __Pyx_GIVEREF(__pyx_v_groupname);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_groupname);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __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(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1446
 *         self._s3_groups[groupname] = s3Group()
 *         self._s3_groups[groupname].create(self, groupname)
 *         return self._s3_groups[groupname]             # <<<<<<<<<<<<<<
 * 
 *     def renameGroup(self, oldname, newname):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_groups); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_groupname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1446, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":1441
 *         self._nc_dataset.renameVariable(oldname, newname)
 * 
 *     def createGroup(self, groupname):             # <<<<<<<<<<<<<<
 *         """Create a group.  If this file is a CFA file then create the CFAGroup
 *         as well."""
 */

  /* 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("S3netCDF4._s3netCDF4.s3Dataset.createGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1448
 *         return self._s3_groups[groupname]
 * 
 *     def renameGroup(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename a group.  If this file is a CFA file then rename the CFAGroup
 *         as well."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_23renameGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_22renameGroup[] = "Rename a group.  If this file is a CFA file then rename the CFAGroup\n        as well.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_23renameGroup = {"renameGroup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_23renameGroup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_22renameGroup};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_23renameGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_oldname = 0;
  PyObject *__pyx_v_newname = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("renameGroup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldname,&__pyx_n_s_newname,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_oldname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renameGroup", 1, 3, 3, 1); __PYX_ERR(0, 1448, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_newname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("renameGroup", 1, 3, 3, 2); __PYX_ERR(0, 1448, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameGroup") < 0)) __PYX_ERR(0, 1448, __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_self = values[0];
    __pyx_v_oldname = values[1];
    __pyx_v_newname = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("renameGroup", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1448, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.renameGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_22renameGroup(__pyx_self, __pyx_v_self, __pyx_v_oldname, __pyx_v_newname);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_22renameGroup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("renameGroup", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1451
 *         """Rename a group.  If this file is a CFA file then rename the CFAGroup
 *         as well."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             self._cfa_dataset.renameGroup(oldname, newname)
 *         self._nc_dataset.renameGroup(oldname, newname)
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1451, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1452
 *         as well."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             self._cfa_dataset.renameGroup(oldname, newname)             # <<<<<<<<<<<<<<
 *         self._nc_dataset.renameGroup(oldname, newname)
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_renameGroup); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_oldname, __pyx_v_newname};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_oldname, __pyx_v_newname};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_oldname);
      __Pyx_GIVEREF(__pyx_v_oldname);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_oldname);
      __Pyx_INCREF(__pyx_v_newname);
      __Pyx_GIVEREF(__pyx_v_newname);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_newname);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1451
 *         """Rename a group.  If this file is a CFA file then rename the CFAGroup
 *         as well."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             self._cfa_dataset.renameGroup(oldname, newname)
 *         self._nc_dataset.renameGroup(oldname, newname)
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1453
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             self._cfa_dataset.renameGroup(oldname, newname)
 *         self._nc_dataset.renameGroup(oldname, newname)             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, name):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_renameGroup); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_oldname, __pyx_v_newname};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_oldname, __pyx_v_newname};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_oldname);
    __Pyx_GIVEREF(__pyx_v_oldname);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_oldname);
    __Pyx_INCREF(__pyx_v_newname);
    __Pyx_GIVEREF(__pyx_v_newname);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_newname);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1453, __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1448
 *         return self._s3_groups[groupname]
 * 
 *     def renameGroup(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename a group.  If this file is a CFA file then rename the CFAGroup
 *         as well."""
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.renameGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1455
 *         self._nc_dataset.renameGroup(oldname, newname)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Dataset so as to return its
 *         private variables."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_25__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_24__getattr__[] = "Override the __getattr__ for the Dataset so as to return its\n        private variables.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_25__getattr__ = {"__getattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_25__getattr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_24__getattr__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_25__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, 1); __PYX_ERR(0, 1455, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattr__") < 0)) __PYX_ERR(0, 1455, __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_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1455, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_24__getattr__(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_24__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  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;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1460
 *         # if name in _private_atts, it is stored at the python
 *         # level and not in the netCDF file.
 *         if name in s3Dataset._private_atts:             # <<<<<<<<<<<<<<
 *             return self.__dict__[name]
 *         elif name == "groups":
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_s3Dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":1461
 *         # level and not in the netCDF file.
 *         if name in s3Dataset._private_atts:
 *             return self.__dict__[name]             # <<<<<<<<<<<<<<
 *         elif name == "groups":
 *             return self.groups
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __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;

    /* "S3netCDF4/_s3netCDF4.pyx":1460
 *         # if name in _private_atts, it is stored at the python
 *         # level and not in the netCDF file.
 *         if name in s3Dataset._private_atts:             # <<<<<<<<<<<<<<
 *             return self.__dict__[name]
 *         elif name == "groups":
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1462
 *         if name in s3Dataset._private_atts:
 *             return self.__dict__[name]
 *         elif name == "groups":             # <<<<<<<<<<<<<<
 *             return self.groups
 *         elif name in netCDF4._private_atts:
 */
  __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_groups, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1462, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":1463
 *             return self.__dict__[name]
 *         elif name == "groups":
 *             return self.groups             # <<<<<<<<<<<<<<
 *         elif name in netCDF4._private_atts:
 *             return self._nc_dataset.__getattr__(name)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_groups); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":1462
 *         if name in s3Dataset._private_atts:
 *             return self.__dict__[name]
 *         elif name == "groups":             # <<<<<<<<<<<<<<
 *             return self.groups
 *         elif name in netCDF4._private_atts:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1464
 *         elif name == "groups":
 *             return self.groups
 *         elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *             return self._nc_dataset.__getattr__(name)
 *         elif (hasattr(self, "_cfa_dataset") and self._cfa_dataset):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1464, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":1465
 *             return self.groups
 *         elif name in netCDF4._private_atts:
 *             return self._nc_dataset.__getattr__(name)             # <<<<<<<<<<<<<<
 *         elif (hasattr(self, "_cfa_dataset") and self._cfa_dataset):
 *             return self._cfa_dataset.metadata[name]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":1464
 *         elif name == "groups":
 *             return self.groups
 *         elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *             return self._nc_dataset.__getattr__(name)
 *         elif (hasattr(self, "_cfa_dataset") and self._cfa_dataset):
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1466
 *         elif name in netCDF4._private_atts:
 *             return self._nc_dataset.__getattr__(name)
 *         elif (hasattr(self, "_cfa_dataset") and self._cfa_dataset):             # <<<<<<<<<<<<<<
 *             return self._cfa_dataset.metadata[name]
 *         else:
 */
  __pyx_t_4 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1466, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_4 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_3 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1466, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":1467
 *             return self._nc_dataset.__getattr__(name)
 *         elif (hasattr(self, "_cfa_dataset") and self._cfa_dataset):
 *             return self._cfa_dataset.metadata[name]             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_dataset.__getattr__(name)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":1466
 *         elif name in netCDF4._private_atts:
 *             return self._nc_dataset.__getattr__(name)
 *         elif (hasattr(self, "_cfa_dataset") and self._cfa_dataset):             # <<<<<<<<<<<<<<
 *             return self._cfa_dataset.metadata[name]
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1469
 *             return self._cfa_dataset.metadata[name]
 *         else:
 *             return self._nc_dataset.__getattr__(name)             # <<<<<<<<<<<<<<
 * 
 *     def __setattr__(self, name, value):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_getattr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __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;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1455
 *         self._nc_dataset.renameGroup(oldname, newname)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Dataset so as to return its
 *         private variables."""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1471
 *             return self._nc_dataset.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Dataset so as to assign its
 *         private variables."""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_27__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_26__setattr__[] = "Override the __setattr__ for the Dataset so as to assign its\n        private variables.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_27__setattr__ = {"__setattr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_27__setattr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_26__setattr__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_27__setattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 1); __PYX_ERR(0, 1471, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, 2); __PYX_ERR(0, 1471, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__setattr__") < 0)) __PYX_ERR(0, 1471, __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_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setattr__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1471, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_26__setattr__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_26__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setattr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1474
 *         """Override the __setattr__ for the Dataset so as to assign its
 *         private variables."""
 *         if name in s3Dataset._private_atts:             # <<<<<<<<<<<<<<
 *             self.__dict__[name] = value
 *         elif name in netCDF4._private_atts:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_s3Dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "S3netCDF4/_s3netCDF4.pyx":1475
 *         private variables."""
 *         if name in s3Dataset._private_atts:
 *             self.__dict__[name] = value             # <<<<<<<<<<<<<<
 *         elif name in netCDF4._private_atts:
 *             self._nc_dataset.__setattr__(name, value)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 1475, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1474
 *         """Override the __setattr__ for the Dataset so as to assign its
 *         private variables."""
 *         if name in s3Dataset._private_atts:             # <<<<<<<<<<<<<<
 *             self.__dict__[name] = value
 *         elif name in netCDF4._private_atts:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1476
 *         if name in s3Dataset._private_atts:
 *             self.__dict__[name] = value
 *         elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *             self._nc_dataset.__setattr__(name, value)
 *         elif hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_netCDF4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_private_atts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":1477
 *             self.__dict__[name] = value
 *         elif name in netCDF4._private_atts:
 *             self._nc_dataset.__setattr__(name, value)             # <<<<<<<<<<<<<<
 *         elif hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             self._cfa_dataset.metadata[name] = value
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_setattr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && 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;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name, __pyx_v_value};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1477, __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_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1476
 *         if name in s3Dataset._private_atts:
 *             self.__dict__[name] = value
 *         elif name in netCDF4._private_atts:             # <<<<<<<<<<<<<<
 *             self._nc_dataset.__setattr__(name, value)
 *         elif hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1478
 *         elif name in netCDF4._private_atts:
 *             self._nc_dataset.__setattr__(name, value)
 *         elif hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             self._cfa_dataset.metadata[name] = value
 *         else:
 */
  __pyx_t_4 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1478, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_4 != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":1479
 *             self._nc_dataset.__setattr__(name, value)
 *         elif hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             self._cfa_dataset.metadata[name] = value             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_dataset.__setattr__(name, value)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 1479, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1478
 *         elif name in netCDF4._private_atts:
 *             self._nc_dataset.__setattr__(name, value)
 *         elif hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             self._cfa_dataset.metadata[name] = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1481
 *             self._cfa_dataset.metadata[name] = value
 *         else:
 *             self._nc_dataset.__setattr__(name, value)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, elem):
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setattr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && 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;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
      PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__pyx_t_1) {
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_v_value);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":1471
 *             return self._nc_dataset.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Dataset so as to assign its
 *         private variables."""
 */

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1483
 *             self._nc_dataset.__setattr__(name, value)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_29__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_28__getitem__[] = "Override the __getitem__ for the Dataset to return the group or\n        variable with the name of elem";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_29__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_29__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_28__getitem__};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_29__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_elem = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_elem,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elem)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1483, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 1483, __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_self = values[0];
    __pyx_v_elem = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1483, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_28__getitem__(__pyx_self, __pyx_v_self, __pyx_v_elem);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_28__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elem) {
  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("__getitem__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1486
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 *         if elem in self.groups:             # <<<<<<<<<<<<<<
 *             return self.groups[elem]
 *         elif elem in self.variables:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_groups); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_elem, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "S3netCDF4/_s3netCDF4.pyx":1487
 *         variable with the name of elem"""
 *         if elem in self.groups:
 *             return self.groups[elem]             # <<<<<<<<<<<<<<
 *         elif elem in self.variables:
 *             return self.variables[elem]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_groups); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_elem); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":1486
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 *         if elem in self.groups:             # <<<<<<<<<<<<<<
 *             return self.groups[elem]
 *         elif elem in self.variables:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1488
 *         if elem in self.groups:
 *             return self.groups[elem]
 *         elif elem in self.variables:             # <<<<<<<<<<<<<<
 *             return self.variables[elem]
 *         else:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_elem, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1488, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (likely(__pyx_t_2)) {

    /* "S3netCDF4/_s3netCDF4.pyx":1489
 *             return self.groups[elem]
 *         elif elem in self.variables:
 *             return self.variables[elem]             # <<<<<<<<<<<<<<
 *         else:
 *             raise IndexError(
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_elem); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":1488
 *         if elem in self.groups:
 *             return self.groups[elem]
 *         elif elem in self.variables:             # <<<<<<<<<<<<<<
 *             return self.variables[elem]
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1491
 *             return self.variables[elem]
 *         else:
 *             raise IndexError(             # <<<<<<<<<<<<<<
 *                 "{} not found as a group or variable in Dataset".format(elem)
 *             )
 */
  /*else*/ {

    /* "S3netCDF4/_s3netCDF4.pyx":1492
 *         else:
 *             raise IndexError(
 *                 "{} not found as a group or variable in Dataset".format(elem)             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_not_found_as_a_group_or_variabl, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_elem) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_elem);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1491
 *             return self.variables[elem]
 *         else:
 *             raise IndexError(             # <<<<<<<<<<<<<<
 *                 "{} not found as a group or variable in Dataset".format(elem)
 *             )
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1491, __pyx_L1_error)
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1483
 *             self._nc_dataset.__setattr__(name, value)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1496
 * 
 *     @property
 *     def groups(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the groups, and this is a cfa dataset then build
 *         # and return the dictionary of s3_groups
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_31groups(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_31groups = {"groups", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_31groups, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_31groups(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("groups (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_30groups(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "S3netCDF4/_s3netCDF4.pyx":1499
 *         # if we are requesting the groups, and this is a cfa dataset then build
 *         # and return the dictionary of s3_groups
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             return self._s3_groups
 *         else:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1499, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1499, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1500
 *         # and return the dictionary of s3_groups
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             return self._s3_groups             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_dataset.groups
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_groups); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":1499
 *         # if we are requesting the groups, and this is a cfa dataset then build
 *         # and return the dictionary of s3_groups
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             return self._s3_groups
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1502
 *             return self._s3_groups
 *         else:
 *             return self._nc_dataset.groups             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_groups); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1496
 * 
 *     @property
 *     def groups(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the groups, and this is a cfa dataset then build
 *         # and return the dictionary of s3_groups
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.groups", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1505
 * 
 *     @property
 *     def variables(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the variables, and this is a cfa dataset then
 *         # build and return the dictionary of s3_variables
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_33variables(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_33variables = {"variables", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_33variables, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_33variables(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("variables (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_32variables(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "S3netCDF4/_s3netCDF4.pyx":1508
 *         # if we are requesting the variables, and this is a cfa dataset then
 *         # build and return the dictionary of s3_variables
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             return self._s3_variables
 *         else:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1508, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1509
 *         # build and return the dictionary of s3_variables
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             return self._s3_variables             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_dataset.variables
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":1508
 *         # if we are requesting the variables, and this is a cfa dataset then
 *         # build and return the dictionary of s3_variables
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             return self._s3_variables
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1511
 *             return self._s3_variables
 *         else:
 *             return self._nc_dataset.variables             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1505
 * 
 *     @property
 *     def variables(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the variables, and this is a cfa dataset then
 *         # build and return the dictionary of s3_variables
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.variables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1514
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the dimensions, and this is a cfa dataset then
 *         # build and return the dictionary of s3_dimensions
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_35dimensions(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_35dimensions = {"dimensions", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_35dimensions, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_35dimensions(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dimensions (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_34dimensions(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "S3netCDF4/_s3netCDF4.pyx":1517
 *         # if we are requesting the dimensions, and this is a cfa dataset then
 *         # build and return the dictionary of s3_dimensions
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             return self._s3_dimensions
 *         else:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1517, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1518
 *         # build and return the dictionary of s3_dimensions
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             return self._s3_dimensions             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_dataset.dimensions
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_s3_dimensions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "S3netCDF4/_s3netCDF4.pyx":1517
 *         # if we are requesting the dimensions, and this is a cfa dataset then
 *         # build and return the dictionary of s3_dimensions
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             return self._s3_dimensions
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1520
 *             return self._s3_dimensions
 *         else:
 *             return self._nc_dataset.dimensions             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1514
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the dimensions, and this is a cfa dataset then
 *         # build and return the dictionary of s3_dimensions
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1522
 *             return self._nc_dataset.dimensions
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             if sys_version_info[0] > 2:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_37__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_37__repr__ = {"__repr__", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_37__repr__, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_37__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_36__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_36__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1523
 * 
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1523, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1524
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             if sys_version_info[0] > 2:             # <<<<<<<<<<<<<<
 *                 return self.__unicode__()
 *             else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys_version_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1524, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1524, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "S3netCDF4/_s3netCDF4.pyx":1525
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()             # <<<<<<<<<<<<<<
 *             else:
 *                 return unicode(self).encode('utf-8')
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __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;

      /* "S3netCDF4/_s3netCDF4.pyx":1524
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             if sys_version_info[0] > 2:             # <<<<<<<<<<<<<<
 *                 return self.__unicode__()
 *             else:
 */
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1527
 *                 return self.__unicode__()
 *             else:
 *                 return unicode(self).encode('utf-8')             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_dataset.__repr__()
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1523
 * 
 *     def __repr__(self):
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             if sys_version_info[0] > 2:
 *                 return self.__unicode__()
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1529
 *                 return unicode(self).encode('utf-8')
 *         else:
 *             return self._nc_dataset.__repr__()             # <<<<<<<<<<<<<<
 * 
 *     def __unicode__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_repr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1522
 *             return self._nc_dataset.dimensions
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             if sys_version_info[0] > 2:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1531
 *             return self._nc_dataset.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         # This function is only applicable to S3Datasets with _cfa_dataset
 *         # defined.  Therefore we can use the _cfa_dataset information
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_39__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_39__unicode__ = {"__unicode__", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_39__unicode__, METH_O, 0};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_39__unicode__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_38__unicode__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_38__unicode__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_ncdump = NULL;
  PyObject *__pyx_v_cfa_ds = NULL;
  PyObject *__pyx_v_nc_ds = 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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__unicode__", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1534
 *         # This function is only applicable to S3Datasets with _cfa_dataset
 *         # defined.  Therefore we can use the _cfa_dataset information
 *         ncdump = ['{}\n'.format(type(self))]             # <<<<<<<<<<<<<<
 *         cfa_ds = self._cfa_dataset
 *         nc_ds = self._nc_dataset
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)Py_TYPE(__pyx_v_self))) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)Py_TYPE(__pyx_v_self)));
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_ncdump = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1535
 *         # defined.  Therefore we can use the _cfa_dataset information
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_ds = self._cfa_dataset             # <<<<<<<<<<<<<<
 *         nc_ds = self._nc_dataset
 *         # Add the title
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_cfa_ds = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1536
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_ds = self._cfa_dataset
 *         nc_ds = self._nc_dataset             # <<<<<<<<<<<<<<
 *         # Add the title
 *         ncdump.append("root group ({} data model, file format {}, "
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_nc_ds = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1539
 *         # Add the title
 *         ncdump.append("root group ({} data model, file format {}, "
 *                       "CFA v{}):\n".format(             # <<<<<<<<<<<<<<
 *                 cfa_ds.getFormat(), nc_ds.disk_format, cfa_ds.getCFAVersion()
 *             )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_root_group_data_model_file_forma, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "S3netCDF4/_s3netCDF4.pyx":1540
 *         ncdump.append("root group ({} data model, file format {}, "
 *                       "CFA v{}):\n".format(
 *                 cfa_ds.getFormat(), nc_ds.disk_format, cfa_ds.getCFAVersion()             # <<<<<<<<<<<<<<
 *             )
 *         )
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_ds, __pyx_n_s_getFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nc_ds, __pyx_n_s_disk_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfa_ds, __pyx_n_s_getCFAVersion); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && 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);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1539, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __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_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1539, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __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_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1539, __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;

  /* "S3netCDF4/_s3netCDF4.pyx":1538
 *         nc_ds = self._nc_dataset
 *         # Add the title
 *         ncdump.append("root group ({} data model, file format {}, "             # <<<<<<<<<<<<<<
 *                       "CFA v{}):\n".format(
 *                 cfa_ds.getFormat(), nc_ds.disk_format, cfa_ds.getCFAVersion()
 */
  __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_ncdump, __pyx_t_2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1543
 *             )
 *         )
 *         ncdump = _group_and_dataset_repr(ncdump, cfa_ds, nc_ds)             # <<<<<<<<<<<<<<
 *         return ''.join(ncdump)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_group_and_dataset_repr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(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);
      __pyx_t_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_ncdump, __pyx_v_cfa_ds, __pyx_v_nc_ds};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_ncdump, __pyx_v_cfa_ds, __pyx_v_nc_ds};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(__pyx_v_ncdump);
    __Pyx_GIVEREF(__pyx_v_ncdump);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_ncdump);
    __Pyx_INCREF(__pyx_v_cfa_ds);
    __Pyx_GIVEREF(__pyx_v_cfa_ds);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_cfa_ds);
    __Pyx_INCREF(__pyx_v_nc_ds);
    __Pyx_GIVEREF(__pyx_v_nc_ds);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_8, __pyx_v_nc_ds);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_ncdump, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1544
 *         )
 *         ncdump = _group_and_dataset_repr(ncdump, cfa_ds, nc_ds)
 *         return ''.join(ncdump)             # <<<<<<<<<<<<<<
 * 
 *     def _interpret_netCDF_filetype(data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__3, __pyx_v_ncdump); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":1531
 *             return self._nc_dataset.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         # This function is only applicable to S3Datasets with _cfa_dataset
 *         # defined.  Therefore we can use the _cfa_dataset information
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ncdump);
  __Pyx_XDECREF(__pyx_v_cfa_ds);
  __Pyx_XDECREF(__pyx_v_nc_ds);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1546
 *         return ''.join(ncdump)
 * 
 *     def _interpret_netCDF_filetype(data):             # <<<<<<<<<<<<<<
 *         """
 *            Pass in the first four bytes from the stream and interpret the magic number.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_41_interpret_netCDF_filetype(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_40_interpret_netCDF_filetype[] = "\n           Pass in the first four bytes from the stream and interpret the magic number.\n           See NC_interpret_magic_number in netcdf-c/libdispatch/dfile.c\n\n           Check that it is a netCDF file before fetching any data and\n           determine what type of netCDF file it is so the temporary empty file can\n           be created with the same type.\n\n           The possible types are:\n           `NETCDF3_CLASSIC`, `NETCDF4`,`NETCDF4_CLASSIC`, `NETCDF3_64BIT_OFFSET` or `NETCDF3_64BIT_DATA`\n           or\n           `NOT_NETCDF` if it is not a netCDF file - raise an exception on that\n\n           :return: string filetype\n        ";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_41_interpret_netCDF_filetype = {"_interpret_netCDF_filetype", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_41_interpret_netCDF_filetype, METH_O, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_40_interpret_netCDF_filetype};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_41_interpret_netCDF_filetype(PyObject *__pyx_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_interpret_netCDF_filetype (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_40_interpret_netCDF_filetype(__pyx_self, ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_40_interpret_netCDF_filetype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_v_file_version = NULL;
  PyObject *__pyx_v_file_type = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_interpret_netCDF_filetype", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1563
 *         """
 *         # start with NOT_NETCDF as the file_type
 *         file_version = 0             # <<<<<<<<<<<<<<
 *         file_type = 'NOT_NETCDF'
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_file_version = __pyx_int_0;

  /* "S3netCDF4/_s3netCDF4.pyx":1564
 *         # start with NOT_NETCDF as the file_type
 *         file_version = 0
 *         file_type = 'NOT_NETCDF'             # <<<<<<<<<<<<<<
 * 
 *         # check whether it's a netCDF file (how can we tell if it's a
 */
  __Pyx_INCREF(__pyx_n_u_NOT_NETCDF);
  __pyx_v_file_type = __pyx_n_u_NOT_NETCDF;

  /* "S3netCDF4/_s3netCDF4.pyx":1568
 *         # check whether it's a netCDF file (how can we tell if it's a
 *         # NETCDF4_CLASSIC file?
 *         if data[1:4] == b'HDF':             # <<<<<<<<<<<<<<
 *             # netCDF4 (HD5 version)
 *             file_type = 'NETCDF4'
 */
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 1, 4, NULL, NULL, &__pyx_slice__16, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_n_b_HDF, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "S3netCDF4/_s3netCDF4.pyx":1570
 *         if data[1:4] == b'HDF':
 *             # netCDF4 (HD5 version)
 *             file_type = 'NETCDF4'             # <<<<<<<<<<<<<<
 *             file_version = 5
 *         elif (data[0] == b'\016' and data[1] == b'\003' and \
 */
    __Pyx_INCREF(__pyx_n_u_NETCDF4);
    __Pyx_DECREF_SET(__pyx_v_file_type, __pyx_n_u_NETCDF4);

    /* "S3netCDF4/_s3netCDF4.pyx":1571
 *             # netCDF4 (HD5 version)
 *             file_type = 'NETCDF4'
 *             file_version = 5             # <<<<<<<<<<<<<<
 *         elif (data[0] == b'\016' and data[1] == b'\003' and \
 *               data[2] == b'\023' and data[3] == b'\001'):
 */
    __Pyx_INCREF(__pyx_int_5);
    __Pyx_DECREF_SET(__pyx_v_file_version, __pyx_int_5);

    /* "S3netCDF4/_s3netCDF4.pyx":1568
 *         # check whether it's a netCDF file (how can we tell if it's a
 *         # NETCDF4_CLASSIC file?
 *         if data[1:4] == b'HDF':             # <<<<<<<<<<<<<<
 *             # netCDF4 (HD5 version)
 *             file_type = 'NETCDF4'
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1572
 *             file_type = 'NETCDF4'
 *             file_version = 5
 *         elif (data[0] == b'\016' and data[1] == b'\003' and \             # <<<<<<<<<<<<<<
 *               data[2] == b'\023' and data[3] == b'\001'):
 *             file_type = 'NETCDF4'
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b__17, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b__18, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1573
 *             file_version = 5
 *         elif (data[0] == b'\016' and data[1] == b'\003' and \
 *               data[2] == b'\023' and data[3] == b'\001'):             # <<<<<<<<<<<<<<
 *             file_type = 'NETCDF4'
 *             file_version = 4
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b__19, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b__20, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;

  /* "S3netCDF4/_s3netCDF4.pyx":1572
 *             file_type = 'NETCDF4'
 *             file_version = 5
 *         elif (data[0] == b'\016' and data[1] == b'\003' and \             # <<<<<<<<<<<<<<
 *               data[2] == b'\023' and data[3] == b'\001'):
 *             file_type = 'NETCDF4'
 */
  if (__pyx_t_2) {

    /* "S3netCDF4/_s3netCDF4.pyx":1574
 *         elif (data[0] == b'\016' and data[1] == b'\003' and \
 *               data[2] == b'\023' and data[3] == b'\001'):
 *             file_type = 'NETCDF4'             # <<<<<<<<<<<<<<
 *             file_version = 4
 *         elif data[0:3] == b'CDF':
 */
    __Pyx_INCREF(__pyx_n_u_NETCDF4);
    __Pyx_DECREF_SET(__pyx_v_file_type, __pyx_n_u_NETCDF4);

    /* "S3netCDF4/_s3netCDF4.pyx":1575
 *               data[2] == b'\023' and data[3] == b'\001'):
 *             file_type = 'NETCDF4'
 *             file_version = 4             # <<<<<<<<<<<<<<
 *         elif data[0:3] == b'CDF':
 *             file_version = data[3]
 */
    __Pyx_INCREF(__pyx_int_4);
    __Pyx_DECREF_SET(__pyx_v_file_version, __pyx_int_4);

    /* "S3netCDF4/_s3netCDF4.pyx":1572
 *             file_type = 'NETCDF4'
 *             file_version = 5
 *         elif (data[0] == b'\016' and data[1] == b'\003' and \             # <<<<<<<<<<<<<<
 *               data[2] == b'\023' and data[3] == b'\001'):
 *             file_type = 'NETCDF4'
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1576
 *             file_type = 'NETCDF4'
 *             file_version = 4
 *         elif data[0:3] == b'CDF':             # <<<<<<<<<<<<<<
 *             file_version = data[3]
 *             if file_version == 1:
 */
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 3, NULL, NULL, &__pyx_slice__21, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_n_b_CDF, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "S3netCDF4/_s3netCDF4.pyx":1577
 *             file_version = 4
 *         elif data[0:3] == b'CDF':
 *             file_version = data[3]             # <<<<<<<<<<<<<<
 *             if file_version == 1:
 *                 file_type = 'NETCDF3_CLASSIC'
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_file_version, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1578
 *         elif data[0:3] == b'CDF':
 *             file_version = data[3]
 *             if file_version == 1:             # <<<<<<<<<<<<<<
 *                 file_type = 'NETCDF3_CLASSIC'
 *             elif file_version == '2':
 */
    __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_file_version, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1578, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "S3netCDF4/_s3netCDF4.pyx":1579
 *             file_version = data[3]
 *             if file_version == 1:
 *                 file_type = 'NETCDF3_CLASSIC'             # <<<<<<<<<<<<<<
 *             elif file_version == '2':
 *                 file_type = 'NETCDF3_64BIT_OFFSET'
 */
      __Pyx_INCREF(__pyx_n_u_NETCDF3_CLASSIC);
      __Pyx_DECREF_SET(__pyx_v_file_type, __pyx_n_u_NETCDF3_CLASSIC);

      /* "S3netCDF4/_s3netCDF4.pyx":1578
 *         elif data[0:3] == b'CDF':
 *             file_version = data[3]
 *             if file_version == 1:             # <<<<<<<<<<<<<<
 *                 file_type = 'NETCDF3_CLASSIC'
 *             elif file_version == '2':
 */
      goto __pyx_L8;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1580
 *             if file_version == 1:
 *                 file_type = 'NETCDF3_CLASSIC'
 *             elif file_version == '2':             # <<<<<<<<<<<<<<
 *                 file_type = 'NETCDF3_64BIT_OFFSET'
 *             elif file_version == '5':
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_file_version, __pyx_kp_u_2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1580, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "S3netCDF4/_s3netCDF4.pyx":1581
 *                 file_type = 'NETCDF3_CLASSIC'
 *             elif file_version == '2':
 *                 file_type = 'NETCDF3_64BIT_OFFSET'             # <<<<<<<<<<<<<<
 *             elif file_version == '5':
 *                 file_type = 'NETCDF3_64BIT_DATA'
 */
      __Pyx_INCREF(__pyx_n_u_NETCDF3_64BIT_OFFSET);
      __Pyx_DECREF_SET(__pyx_v_file_type, __pyx_n_u_NETCDF3_64BIT_OFFSET);

      /* "S3netCDF4/_s3netCDF4.pyx":1580
 *             if file_version == 1:
 *                 file_type = 'NETCDF3_CLASSIC'
 *             elif file_version == '2':             # <<<<<<<<<<<<<<
 *                 file_type = 'NETCDF3_64BIT_OFFSET'
 *             elif file_version == '5':
 */
      goto __pyx_L8;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1582
 *             elif file_version == '2':
 *                 file_type = 'NETCDF3_64BIT_OFFSET'
 *             elif file_version == '5':             # <<<<<<<<<<<<<<
 *                 file_type = 'NETCDF3_64BIT_DATA'
 *             else:
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_file_version, __pyx_kp_u_5, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1582, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "S3netCDF4/_s3netCDF4.pyx":1583
 *                 file_type = 'NETCDF3_64BIT_OFFSET'
 *             elif file_version == '5':
 *                 file_type = 'NETCDF3_64BIT_DATA'             # <<<<<<<<<<<<<<
 *             else:
 *                 file_version = 1 # default to one if no version
 */
      __Pyx_INCREF(__pyx_n_u_NETCDF3_64BIT_DATA);
      __Pyx_DECREF_SET(__pyx_v_file_type, __pyx_n_u_NETCDF3_64BIT_DATA);

      /* "S3netCDF4/_s3netCDF4.pyx":1582
 *             elif file_version == '2':
 *                 file_type = 'NETCDF3_64BIT_OFFSET'
 *             elif file_version == '5':             # <<<<<<<<<<<<<<
 *                 file_type = 'NETCDF3_64BIT_DATA'
 *             else:
 */
      goto __pyx_L8;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1585
 *                 file_type = 'NETCDF3_64BIT_DATA'
 *             else:
 *                 file_version = 1 # default to one if no version             # <<<<<<<<<<<<<<
 *         else:
 *             file_type = 'NOT_NETCDF'
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_DECREF_SET(__pyx_v_file_version, __pyx_int_1);
    }
    __pyx_L8:;

    /* "S3netCDF4/_s3netCDF4.pyx":1576
 *             file_type = 'NETCDF4'
 *             file_version = 4
 *         elif data[0:3] == b'CDF':             # <<<<<<<<<<<<<<
 *             file_version = data[3]
 *             if file_version == 1:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1587
 *                 file_version = 1 # default to one if no version
 *         else:
 *             file_type = 'NOT_NETCDF'             # <<<<<<<<<<<<<<
 *             file_version = 0
 *         return file_type, file_version
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_n_u_NOT_NETCDF);
    __Pyx_DECREF_SET(__pyx_v_file_type, __pyx_n_u_NOT_NETCDF);

    /* "S3netCDF4/_s3netCDF4.pyx":1588
 *         else:
 *             file_type = 'NOT_NETCDF'
 *             file_version = 0             # <<<<<<<<<<<<<<
 *         return file_type, file_version
 * 
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_DECREF_SET(__pyx_v_file_version, __pyx_int_0);
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":1589
 *             file_type = 'NOT_NETCDF'
 *             file_version = 0
 *         return file_type, file_version             # <<<<<<<<<<<<<<
 * 
 *     def delncattr(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_file_type);
  __Pyx_GIVEREF(__pyx_v_file_type);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_file_type);
  __Pyx_INCREF(__pyx_v_file_version);
  __Pyx_GIVEREF(__pyx_v_file_version);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_file_version);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "S3netCDF4/_s3netCDF4.pyx":1546
 *         return ''.join(ncdump)
 * 
 *     def _interpret_netCDF_filetype(data):             # <<<<<<<<<<<<<<
 *         """
 *            Pass in the first four bytes from the stream and interpret the magic number.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset._interpret_netCDF_filetype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_file_version);
  __Pyx_XDECREF(__pyx_v_file_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1591
 *         return file_type, file_version
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_43delncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_42delncattr[] = "Override delncattr function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_43delncattr = {"delncattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_43delncattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_42delncattr};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_43delncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delncattr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("delncattr", 1, 2, 2, 1); __PYX_ERR(0, 1591, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delncattr") < 0)) __PYX_ERR(0, 1591, __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_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delncattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1591, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_42delncattr(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_42delncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  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("delncattr", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1595
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._cfa_dataset.metadata.pop(name)
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1595, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1596
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_dataset.metadata.pop(name)
 *             except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "S3netCDF4/_s3netCDF4.pyx":1597
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             try:
 *                 self._cfa_dataset.metadata.pop(name)             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 raise APIException(
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1597, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1597, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pop); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1597, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1597, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "S3netCDF4/_s3netCDF4.pyx":1596
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_dataset.metadata.pop(name)
 *             except KeyError:
 */
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1598
 *             try:
 *                 self._cfa_dataset.metadata.pop(name)
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 raise APIException(
 *                     "Attribute {} not found in dataset".format(name))
 */
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_10) {
        __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 1598, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_9);

        /* "S3netCDF4/_s3netCDF4.pyx":1599
 *                 self._cfa_dataset.metadata.pop(name)
 *             except KeyError:
 *                 raise APIException(             # <<<<<<<<<<<<<<
 *                     "Attribute {} not found in dataset".format(name))
 *         else:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_APIException); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1599, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_12);

        /* "S3netCDF4/_s3netCDF4.pyx":1600
 *             except KeyError:
 *                 raise APIException(
 *                     "Attribute {} not found in dataset".format(name))             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_dataset.delncattr(name)
 */
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Attribute_not_found_in_dataset, __pyx_n_s_format); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1600, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
          }
        }
        __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_name);
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1600, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_11 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_14, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1599, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_Raise(__pyx_t_11, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(0, 1599, __pyx_L8_except_error)
      }
      goto __pyx_L8_except_error;
      __pyx_L8_except_error:;

      /* "S3netCDF4/_s3netCDF4.pyx":1596
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             try:             # <<<<<<<<<<<<<<
 *                 self._cfa_dataset.metadata.pop(name)
 *             except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L11_try_end:;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1595
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             try:
 *                 self._cfa_dataset.metadata.pop(name)
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1602
 *                     "Attribute {} not found in dataset".format(name))
 *         else:
 *             self._nc_dataset.delncattr(name)             # <<<<<<<<<<<<<<
 * 
 *     def getncattr(self, name):
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_delncattr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":1591
 *         return file_type, file_version
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1604
 *             self._nc_dataset.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_45getncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_44getncattr[] = "Override getncattr function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_45getncattr = {"getncattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_45getncattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_44getncattr};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_45getncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getncattr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("getncattr", 1, 2, 2, 1); __PYX_ERR(0, 1604, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getncattr") < 0)) __PYX_ERR(0, 1604, __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_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getncattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1604, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_44getncattr(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_44getncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getncattr", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1608
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             try:
 *                 return self._cfa_dataset.metadata[name]
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1608, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1609
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_dataset.metadata[name]
 *             except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "S3netCDF4/_s3netCDF4.pyx":1610
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             try:
 *                 return self._cfa_dataset.metadata[name]             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 return self._nc_dataset.getncattr(name)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_metadata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1610, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L10_try_return;

        /* "S3netCDF4/_s3netCDF4.pyx":1609
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_dataset.metadata[name]
 *             except KeyError:
 */
      }
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1611
 *             try:
 *                 return self._cfa_dataset.metadata[name]
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 return self._nc_dataset.getncattr(name)
 *         else:
 */
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_10) < 0) __PYX_ERR(0, 1611, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_10);

        /* "S3netCDF4/_s3netCDF4.pyx":1612
 *                 return self._cfa_dataset.metadata[name]
 *             except KeyError:
 *                 return self._nc_dataset.getncattr(name)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_dataset.getncattr(name)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1612, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_getncattr); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1612, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
          }
        }
        __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_name);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1612, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_r = __pyx_t_11;
        __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L9_except_return;
      }
      goto __pyx_L8_except_error;
      __pyx_L8_except_error:;

      /* "S3netCDF4/_s3netCDF4.pyx":1609
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._cfa_dataset.metadata[name]
 *             except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L10_try_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
      __pyx_L9_except_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
    }

    /* "S3netCDF4/_s3netCDF4.pyx":1608
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             try:
 *                 return self._cfa_dataset.metadata[name]
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1614
 *                 return self._nc_dataset.getncattr(name)
 *         else:
 *             return self._nc_dataset.getncattr(name)             # <<<<<<<<<<<<<<
 * 
 *     def ncattrs(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_getncattr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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_10 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_10;
    __pyx_t_10 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1604
 *             self._nc_dataset.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1616
 *             return self._nc_dataset.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_47ncattrs(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_46ncattrs[] = "Override ncattrs function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_47ncattrs = {"ncattrs", (PyCFunction)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_47ncattrs, METH_O, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_46ncattrs};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_47ncattrs(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ncattrs (wrapper)", 0);
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_46ncattrs(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_46ncattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ncattrs", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1620
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             return self._cfa_dataset.metadata.keys()
 *         else:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1620, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1620, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1621
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             return self._cfa_dataset.metadata.keys()             # <<<<<<<<<<<<<<
 *         else:
 *             return self._nc_dataset.ncattrs()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_metadata); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1621, __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_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1621, __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;

    /* "S3netCDF4/_s3netCDF4.pyx":1620
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             return self._cfa_dataset.metadata.keys()
 *         else:
 */
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1623
 *             return self._cfa_dataset.metadata.keys()
 *         else:
 *             return self._nc_dataset.ncattrs()             # <<<<<<<<<<<<<<
 * 
 *     def setncattr(self, name, value):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ncattrs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1616
 *             return self._nc_dataset.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.ncattrs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1625
 *             return self._nc_dataset.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_49setncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_48setncattr[] = "Override setncattr function to manipulate the metadata dictionary,\n        rather than the netCDF file.  The attributes are copied from the\n        metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_49setncattr = {"setncattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_49setncattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_48setncattr};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_49setncattr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setncattr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr", 1, 3, 3, 1); __PYX_ERR(0, 1625, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr", 1, 3, 3, 2); __PYX_ERR(0, 1625, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr") < 0)) __PYX_ERR(0, 1625, __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_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setncattr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1625, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.setncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_48setncattr(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_48setncattr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setncattr", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1629
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             self._cfa_dataset.metadata[name] = value
 *         else:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1629, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1630
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             self._cfa_dataset.metadata[name] = value             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_dataset.setncattr(name, value)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 1630, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1629
 *         rather than the netCDF file.  The attributes are copied from the
 *         metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             self._cfa_dataset.metadata[name] = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1632
 *             self._cfa_dataset.metadata[name] = value
 *         else:
 *             self._nc_dataset.setncattr(name, value)             # <<<<<<<<<<<<<<
 * 
 *     def setncattr_string(self, name, value):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_setncattr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1632, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1632, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":1625
 *             return self._nc_dataset.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.setncattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1634
 *             self._nc_dataset.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_51setncattr_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_50setncattr_string[] = "Override setncattr_string function to manipulate the metadata\n        dictionary, rather than the netCDF file.  The attributes are copied from\n        the metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_51setncattr_string = {"setncattr_string", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_51setncattr_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_50setncattr_string};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_51setncattr_string(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_value = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setncattr_string (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_value,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr_string", 1, 3, 3, 1); __PYX_ERR(0, 1634, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncattr_string", 1, 3, 3, 2); __PYX_ERR(0, 1634, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr_string") < 0)) __PYX_ERR(0, 1634, __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_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setncattr_string", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1634, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.setncattr_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_50setncattr_string(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_value);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_50setncattr_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setncattr_string", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1638
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             self._cfa_dataset.metadata[name] = value
 *         else:
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1638, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1639
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             self._cfa_dataset.metadata[name] = value             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_dataset.setncattr_string(name, value)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 1639, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1638
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             self._cfa_dataset.metadata[name] = value
 *         else:
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1641
 *             self._cfa_dataset.metadata[name] = value
 *         else:
 *             self._nc_dataset.setncattr_string(name, value)             # <<<<<<<<<<<<<<
 * 
 *     def setncatts(self, attdict):
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_setncattr_string); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1641, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value};
      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1641, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_5);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1641, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_name);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1641, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":1634
 *             self._nc_dataset.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.setncattr_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "S3netCDF4/_s3netCDF4.pyx":1643
 *             self._nc_dataset.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

/* Python wrapper */
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_53setncatts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_52setncatts[] = "Override setncattrs function to manipulate the metadata\n        dictionary, rather than the netCDF file.  The attributes are copied from\n        the metadata dictionary on write.";
static PyMethodDef __pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_53setncatts = {"setncatts", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_53setncatts, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9S3netCDF4_10_s3netCDF4_9s3Dataset_52setncatts};
static PyObject *__pyx_pw_9S3netCDF4_10_s3netCDF4_9s3Dataset_53setncatts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_attdict = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setncatts (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attdict,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attdict)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("setncatts", 1, 2, 2, 1); __PYX_ERR(0, 1643, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncatts") < 0)) __PYX_ERR(0, 1643, __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_self = values[0];
    __pyx_v_attdict = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setncatts", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1643, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.setncatts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_52setncatts(__pyx_self, __pyx_v_self, __pyx_v_attdict);

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

static PyObject *__pyx_pf_9S3netCDF4_10_s3netCDF4_9s3Dataset_52setncatts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_attdict) {
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setncatts", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":1647
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             for k in attdict:
 *                 self._cfa_dataset.metadata[k] = attdict[k]
 */
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_u_cfa_dataset); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1647, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1647, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "S3netCDF4/_s3netCDF4.pyx":1648
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             for k in attdict:             # <<<<<<<<<<<<<<
 *                 self._cfa_dataset.metadata[k] = attdict[k]
 *         else:
 */
    if (likely(PyList_CheckExact(__pyx_v_attdict)) || PyTuple_CheckExact(__pyx_v_attdict)) {
      __pyx_t_4 = __pyx_v_attdict; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_attdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1648, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1648, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1648, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1648, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1648, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1648, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1648, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1649
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             for k in attdict:
 *                 self._cfa_dataset.metadata[k] = attdict[k]             # <<<<<<<<<<<<<<
 *         else:
 *             self._nc_dataset.setncatts(attdict)
 */
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_attdict, __pyx_v_k); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1649, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cfa_dataset); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1649, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_metadata); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1649, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(PyObject_SetItem(__pyx_t_9, __pyx_v_k, __pyx_t_7) < 0)) __PYX_ERR(0, 1649, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "S3netCDF4/_s3netCDF4.pyx":1648
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             for k in attdict:             # <<<<<<<<<<<<<<
 *                 self._cfa_dataset.metadata[k] = attdict[k]
 *         else:
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "S3netCDF4/_s3netCDF4.pyx":1647
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 *         the metadata dictionary on write."""
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:             # <<<<<<<<<<<<<<
 *             for k in attdict:
 *                 self._cfa_dataset.metadata[k] = attdict[k]
 */
    goto __pyx_L3;
  }

  /* "S3netCDF4/_s3netCDF4.pyx":1651
 *                 self._cfa_dataset.metadata[k] = attdict[k]
 *         else:
 *             self._nc_dataset.setncatts(attdict)             # <<<<<<<<<<<<<<
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nc_dataset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_setncatts); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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);
      }
    }
    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_attdict) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_attdict);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "S3netCDF4/_s3netCDF4.pyx":1643
 *             self._nc_dataset.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("S3netCDF4._s3netCDF4.s3Dataset.setncatts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec__s3netCDF4(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec__s3netCDF4},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "_s3netCDF4",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  {&__pyx_kp_u_0_4, __pyx_k_0_4, sizeof(__pyx_k_0_4), 0, 1, 0, 0},
  {&__pyx_kp_u_0_5, __pyx_k_0_5, sizeof(__pyx_k_0_5), 0, 1, 0, 0},
  {&__pyx_kp_u_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 1, 0, 0},
  {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0},
  {&__pyx_n_s_APIException, __pyx_k_APIException, sizeof(__pyx_k_APIException), 0, 0, 1, 1},
  {&__pyx_kp_u_Attribute_not_found_in_dataset, __pyx_k_Attribute_not_found_in_dataset, sizeof(__pyx_k_Attribute_not_found_in_dataset), 0, 1, 0, 0},
  {&__pyx_kp_u_Attribute_not_found_in_variable, __pyx_k_Attribute_not_found_in_variable, sizeof(__pyx_k_Attribute_not_found_in_variable), 0, 1, 0, 0},
  {&__pyx_kp_u_BSD_see_LICENSE_file_in_top_leve, __pyx_k_BSD_see_LICENSE_file_in_top_leve, sizeof(__pyx_k_BSD_see_LICENSE_file_in_top_leve), 0, 1, 0, 0},
  {&__pyx_n_b_CDF, __pyx_k_CDF, sizeof(__pyx_k_CDF), 0, 0, 0, 1},
  {&__pyx_n_u_CFA3, __pyx_k_CFA3, sizeof(__pyx_k_CFA3), 0, 1, 0, 1},
  {&__pyx_n_u_CFA4, __pyx_k_CFA4, sizeof(__pyx_k_CFA4), 0, 1, 0, 1},
  {&__pyx_n_s_CFADataset, __pyx_k_CFADataset, sizeof(__pyx_k_CFADataset), 0, 0, 1, 1},
  {&__pyx_n_s_CFADimension, __pyx_k_CFADimension, sizeof(__pyx_k_CFADimension), 0, 0, 1, 1},
  {&__pyx_n_s_CFAError, __pyx_k_CFAError, sizeof(__pyx_k_CFAError), 0, 0, 1, 1},
  {&__pyx_n_s_CFAGroup, __pyx_k_CFAGroup, sizeof(__pyx_k_CFAGroup), 0, 0, 1, 1},
  {&__pyx_n_s_CFAVariable, __pyx_k_CFAVariable, sizeof(__pyx_k_CFAVariable), 0, 0, 1, 1},
  {&__pyx_kp_u_CFA_0_5_is_not_compatible_with_N, __pyx_k_CFA_0_5_is_not_compatible_with_N, sizeof(__pyx_k_CFA_0_5_is_not_compatible_with_N), 0, 1, 0, 0},
  {&__pyx_n_s_CFA_netCDFParser, __pyx_k_CFA_netCDFParser, sizeof(__pyx_k_CFA_netCDFParser), 0, 0, 1, 1},
  {&__pyx_kp_u_C_2019_2021_Science_and_Technol, __pyx_k_C_2019_2021_Science_and_Technol, sizeof(__pyx_k_C_2019_2021_Science_and_Technol), 0, 1, 0, 0},
  {&__pyx_kp_u_Cannot_find_group_or_dataset_in, __pyx_k_Cannot_find_group_or_dataset_in, sizeof(__pyx_k_Cannot_find_group_or_dataset_in), 0, 1, 0, 0},
  {&__pyx_n_u_DEFAULT, __pyx_k_DEFAULT, sizeof(__pyx_k_DEFAULT), 0, 1, 0, 1},
  {&__pyx_n_s_DOES_NOT_EXIST, __pyx_k_DOES_NOT_EXIST, sizeof(__pyx_k_DOES_NOT_EXIST), 0, 0, 1, 1},
  {&__pyx_n_s_Dataset, __pyx_k_Dataset, sizeof(__pyx_k_Dataset), 0, 0, 1, 1},
  {&__pyx_kp_u_Dimension_name_already_exists, __pyx_k_Dimension_name_already_exists, sizeof(__pyx_k_Dimension_name_already_exists), 0, 1, 0, 0},
  {&__pyx_kp_u_Dimension_name_does_not_exist, __pyx_k_Dimension_name_does_not_exist, sizeof(__pyx_k_Dimension_name_does_not_exist), 0, 1, 0, 0},
  {&__pyx_kp_u_Dimensions_has_to_be_of_type_tup, __pyx_k_Dimensions_has_to_be_of_type_tup, sizeof(__pyx_k_Dimensions_has_to_be_of_type_tup), 0, 1, 0, 0},
  {&__pyx_kp_s_Duplicate_the_UniData_netCDF4_D, __pyx_k_Duplicate_the_UniData_netCDF4_D, sizeof(__pyx_k_Duplicate_the_UniData_netCDF4_D), 0, 0, 1, 0},
  {&__pyx_kp_s_Duplicate_the_UniData_netCDF4_D_2, __pyx_k_Duplicate_the_UniData_netCDF4_D_2, sizeof(__pyx_k_Duplicate_the_UniData_netCDF4_D_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Duplicate_the_UniData_netCDF4_G, __pyx_k_Duplicate_the_UniData_netCDF4_G, sizeof(__pyx_k_Duplicate_the_UniData_netCDF4_G), 0, 0, 1, 0},
  {&__pyx_kp_s_Duplicate_the_UniData_netCDF4_V, __pyx_k_Duplicate_the_UniData_netCDF4_V, sizeof(__pyx_k_Duplicate_the_UniData_netCDF4_V), 0, 0, 1, 0},
  {&__pyx_n_s_ENOENT, __pyx_k_ENOENT, sizeof(__pyx_k_ENOENT), 0, 0, 1, 1},
  {&__pyx_n_s_FileManager, __pyx_k_FileManager, sizeof(__pyx_k_FileManager), 0, 0, 1, 1},
  {&__pyx_n_s_FileNotFoundError, __pyx_k_FileNotFoundError, sizeof(__pyx_k_FileNotFoundError), 0, 0, 1, 1},
  {&__pyx_kp_u_File_is_not_a_netCDF_file, __pyx_k_File_is_not_a_netCDF_file, sizeof(__pyx_k_File_is_not_a_netCDF_file), 0, 1, 0, 0},
  {&__pyx_n_s_FillValue, __pyx_k_FillValue, sizeof(__pyx_k_FillValue), 0, 0, 1, 1},
  {&__pyx_n_u_FillValue, __pyx_k_FillValue, sizeof(__pyx_k_FillValue), 0, 1, 0, 1},
  {&__pyx_n_b_HDF, __pyx_k_HDF, sizeof(__pyx_k_HDF), 0, 0, 0, 1},
  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_n_s_IOException, __pyx_k_IOException, sizeof(__pyx_k_IOException), 0, 0, 1, 1},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_n_s_KNOWN_EXISTS_ON_DISK, __pyx_k_KNOWN_EXISTS_ON_DISK, sizeof(__pyx_k_KNOWN_EXISTS_ON_DISK), 0, 0, 1, 1},
  {&__pyx_n_s_KNOWN_EXISTS_ON_STORAGE, __pyx_k_KNOWN_EXISTS_ON_STORAGE, sizeof(__pyx_k_KNOWN_EXISTS_ON_STORAGE), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_kp_u_Mode, __pyx_k_Mode, sizeof(__pyx_k_Mode), 0, 1, 0, 0},
  {&__pyx_n_u_NETCDF3_64BIT_DATA, __pyx_k_NETCDF3_64BIT_DATA, sizeof(__pyx_k_NETCDF3_64BIT_DATA), 0, 1, 0, 1},
  {&__pyx_n_u_NETCDF3_64BIT_OFFSET, __pyx_k_NETCDF3_64BIT_OFFSET, sizeof(__pyx_k_NETCDF3_64BIT_OFFSET), 0, 1, 0, 1},
  {&__pyx_n_u_NETCDF3_CLASSIC, __pyx_k_NETCDF3_CLASSIC, sizeof(__pyx_k_NETCDF3_CLASSIC), 0, 1, 0, 1},
  {&__pyx_n_u_NETCDF4, __pyx_k_NETCDF4, sizeof(__pyx_k_NETCDF4), 0, 1, 0, 1},
  {&__pyx_n_u_NOT_NETCDF, __pyx_k_NOT_NETCDF, sizeof(__pyx_k_NOT_NETCDF), 0, 1, 0, 1},
  {&__pyx_kp_u_Neil_Massey, __pyx_k_Neil_Massey, sizeof(__pyx_k_Neil_Massey), 0, 1, 0, 0},
  {&__pyx_n_s_OPEN_EXISTS_IN_MEMORY, __pyx_k_OPEN_EXISTS_IN_MEMORY, sizeof(__pyx_k_OPEN_EXISTS_IN_MEMORY), 0, 0, 1, 1},
  {&__pyx_n_s_OPEN_EXISTS_ON_DISK, __pyx_k_OPEN_EXISTS_ON_DISK, sizeof(__pyx_k_OPEN_EXISTS_ON_DISK), 0, 0, 1, 1},
  {&__pyx_n_s_OPEN_NEW_IN_MEMORY, __pyx_k_OPEN_NEW_IN_MEMORY, sizeof(__pyx_k_OPEN_NEW_IN_MEMORY), 0, 0, 1, 1},
  {&__pyx_n_s_OPEN_NEW_ON_DISK, __pyx_k_OPEN_NEW_ON_DISK, sizeof(__pyx_k_OPEN_NEW_ON_DISK), 0, 0, 1, 1},
  {&__pyx_n_s_OpenFileRecord, __pyx_k_OpenFileRecord, sizeof(__pyx_k_OpenFileRecord), 0, 0, 1, 1},
  {&__pyx_n_s_S3netCDF4_CFA_Parsers__CFAnetCDF, __pyx_k_S3netCDF4_CFA_Parsers__CFAnetCDF, sizeof(__pyx_k_S3netCDF4_CFA_Parsers__CFAnetCDF), 0, 0, 1, 1},
  {&__pyx_n_s_S3netCDF4_CFA__CFAClasses, __pyx_k_S3netCDF4_CFA__CFAClasses, sizeof(__pyx_k_S3netCDF4_CFA__CFAClasses), 0, 0, 1, 1},
  {&__pyx_n_s_S3netCDF4_CFA__CFAExceptions, __pyx_k_S3netCDF4_CFA__CFAExceptions, sizeof(__pyx_k_S3netCDF4_CFA__CFAExceptions), 0, 0, 1, 1},
  {&__pyx_n_s_S3netCDF4_Managers__FileManager, __pyx_k_S3netCDF4_Managers__FileManager, sizeof(__pyx_k_S3netCDF4_Managers__FileManager), 0, 0, 1, 1},
  {&__pyx_n_s_S3netCDF4__Exceptions, __pyx_k_S3netCDF4__Exceptions, sizeof(__pyx_k_S3netCDF4__Exceptions), 0, 0, 1, 1},
  {&__pyx_n_s_S3netCDF4__s3netCDF4, __pyx_k_S3netCDF4__s3netCDF4, sizeof(__pyx_k_S3netCDF4__s3netCDF4), 0, 0, 1, 1},
  {&__pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_k_S3netCDF4__s3netCDF4_pyx, sizeof(__pyx_k_S3netCDF4__s3netCDF4_pyx), 0, 0, 1, 0},
  {&__pyx_n_u_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 1, 0, 1},
  {&__pyx_kp_u_Unsupported_CFA_version, __pyx_k_Unsupported_CFA_version, sizeof(__pyx_k_Unsupported_CFA_version), 0, 1, 0, 0},
  {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
  {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
  {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0},
  {&__pyx_kp_b__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 0, 0},
  {&__pyx_kp_b__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 0, 0},
  {&__pyx_kp_b__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 0, 0},
  {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
  {&__pyx_kp_b__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 0, 0},
  {&__pyx_n_s__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 1, 1},
  {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
  {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0},
  {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
  {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
  {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_attdict, __pyx_k_attdict, sizeof(__pyx_k_attdict), 0, 0, 1, 1},
  {&__pyx_n_s_atype, __pyx_k_atype, sizeof(__pyx_k_atype), 0, 0, 1, 1},
  {&__pyx_n_s_authors, __pyx_k_authors, sizeof(__pyx_k_authors), 0, 0, 1, 1},
  {&__pyx_n_s_axis_type, __pyx_k_axis_type, sizeof(__pyx_k_axis_type), 0, 0, 1, 1},
  {&__pyx_kp_u_axis_type_2, __pyx_k_axis_type_2, sizeof(__pyx_k_axis_type_2), 0, 1, 0, 0},
  {&__pyx_n_u_cfa, __pyx_k_cfa, sizeof(__pyx_k_cfa), 0, 1, 0, 1},
  {&__pyx_n_s_cfa_dataset, __pyx_k_cfa_dataset, sizeof(__pyx_k_cfa_dataset), 0, 0, 1, 1},
  {&__pyx_n_u_cfa_dataset, __pyx_k_cfa_dataset, sizeof(__pyx_k_cfa_dataset), 0, 1, 0, 1},
  {&__pyx_n_s_cfa_dim, __pyx_k_cfa_dim, sizeof(__pyx_k_cfa_dim), 0, 0, 1, 1},
  {&__pyx_n_s_cfa_dim_2, __pyx_k_cfa_dim_2, sizeof(__pyx_k_cfa_dim_2), 0, 0, 1, 1},
  {&__pyx_n_u_cfa_dim_2, __pyx_k_cfa_dim_2, sizeof(__pyx_k_cfa_dim_2), 0, 1, 0, 1},
  {&__pyx_n_s_cfa_ds, __pyx_k_cfa_ds, sizeof(__pyx_k_cfa_ds), 0, 0, 1, 1},
  {&__pyx_n_u_cfa_group, __pyx_k_cfa_group, sizeof(__pyx_k_cfa_group), 0, 1, 0, 1},
  {&__pyx_n_s_cfa_group_names, __pyx_k_cfa_group_names, sizeof(__pyx_k_cfa_group_names), 0, 0, 1, 1},
  {&__pyx_kp_u_cfa_groups, __pyx_k_cfa_groups, sizeof(__pyx_k_cfa_groups), 0, 1, 0, 0},
  {&__pyx_n_s_cfa_grp, __pyx_k_cfa_grp, sizeof(__pyx_k_cfa_grp), 0, 0, 1, 1},
  {&__pyx_n_u_cfa_grp, __pyx_k_cfa_grp, sizeof(__pyx_k_cfa_grp), 0, 1, 0, 1},
  {&__pyx_n_s_cfa_grp_2, __pyx_k_cfa_grp_2, sizeof(__pyx_k_cfa_grp_2), 0, 0, 1, 1},
  {&__pyx_n_s_cfa_meta, __pyx_k_cfa_meta, sizeof(__pyx_k_cfa_meta), 0, 0, 1, 1},
  {&__pyx_n_s_cfa_obj, __pyx_k_cfa_obj, sizeof(__pyx_k_cfa_obj), 0, 0, 1, 1},
  {&__pyx_n_s_cfa_root_group, __pyx_k_cfa_root_group, sizeof(__pyx_k_cfa_root_group), 0, 0, 1, 1},
  {&__pyx_n_s_cfa_var, __pyx_k_cfa_var, sizeof(__pyx_k_cfa_var), 0, 0, 1, 1},
  {&__pyx_n_s_cfa_var_2, __pyx_k_cfa_var_2, sizeof(__pyx_k_cfa_var_2), 0, 0, 1, 1},
  {&__pyx_n_u_cfa_var_2, __pyx_k_cfa_var_2, sizeof(__pyx_k_cfa_var_2), 0, 1, 0, 1},
  {&__pyx_n_s_cfa_version, __pyx_k_cfa_version, sizeof(__pyx_k_cfa_version), 0, 0, 1, 1},
  {&__pyx_n_s_chunk_cache, __pyx_k_chunk_cache, sizeof(__pyx_k_chunk_cache), 0, 0, 1, 1},
  {&__pyx_n_s_chunksizes, __pyx_k_chunksizes, sizeof(__pyx_k_chunksizes), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_clobber, __pyx_k_clobber, sizeof(__pyx_k_clobber), 0, 0, 1, 1},
  {&__pyx_n_u_clobber, __pyx_k_clobber, sizeof(__pyx_k_clobber), 0, 1, 0, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_complevel, __pyx_k_complevel, sizeof(__pyx_k_complevel), 0, 0, 1, 1},
  {&__pyx_n_s_contiguous, __pyx_k_contiguous, sizeof(__pyx_k_contiguous), 0, 0, 1, 1},
  {&__pyx_n_s_copyright, __pyx_k_copyright, sizeof(__pyx_k_copyright), 0, 0, 1, 1},
  {&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1},
  {&__pyx_n_s_createDimension, __pyx_k_createDimension, sizeof(__pyx_k_createDimension), 0, 0, 1, 1},
  {&__pyx_n_s_createGroup, __pyx_k_createGroup, sizeof(__pyx_k_createGroup), 0, 0, 1, 1},
  {&__pyx_n_s_createVariable, __pyx_k_createVariable, sizeof(__pyx_k_createVariable), 0, 0, 1, 1},
  {&__pyx_n_s_create_subarray_ncfile, __pyx_k_create_subarray_ncfile, sizeof(__pyx_k_create_subarray_ncfile), 0, 0, 1, 1},
  {&__pyx_n_s_creation_params, __pyx_k_creation_params, sizeof(__pyx_k_creation_params), 0, 0, 1, 1},
  {&__pyx_n_u_creation_params, __pyx_k_creation_params, sizeof(__pyx_k_creation_params), 0, 1, 0, 1},
  {&__pyx_kp_u_current_shape, __pyx_k_current_shape, sizeof(__pyx_k_current_shape), 0, 1, 0, 0},
  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_data_model, __pyx_k_data_model, sizeof(__pyx_k_data_model), 0, 0, 1, 1},
  {&__pyx_n_u_data_model, __pyx_k_data_model, sizeof(__pyx_k_data_model), 0, 1, 0, 1},
  {&__pyx_n_s_data_object, __pyx_k_data_object, sizeof(__pyx_k_data_object), 0, 0, 1, 1},
  {&__pyx_n_s_datatype, __pyx_k_datatype, sizeof(__pyx_k_datatype), 0, 0, 1, 1},
  {&__pyx_n_s_dealloc, __pyx_k_dealloc, sizeof(__pyx_k_dealloc), 0, 0, 1, 1},
  {&__pyx_n_s_delncattr, __pyx_k_delncattr, sizeof(__pyx_k_delncattr), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1},
  {&__pyx_n_s_dim_len, __pyx_k_dim_len, sizeof(__pyx_k_dim_len), 0, 0, 1, 1},
  {&__pyx_n_s_dim_name, __pyx_k_dim_name, sizeof(__pyx_k_dim_name), 0, 0, 1, 1},
  {&__pyx_n_s_dim_names, __pyx_k_dim_names, sizeof(__pyx_k_dim_names), 0, 0, 1, 1},
  {&__pyx_n_s_dim_names_sizes, __pyx_k_dim_names_sizes, sizeof(__pyx_k_dim_names_sizes), 0, 0, 1, 1},
  {&__pyx_n_s_dimensions, __pyx_k_dimensions, sizeof(__pyx_k_dimensions), 0, 0, 1, 1},
  {&__pyx_kp_u_dimensions_sizes, __pyx_k_dimensions_sizes, sizeof(__pyx_k_dimensions_sizes), 0, 1, 0, 0},
  {&__pyx_n_s_dimid, __pyx_k_dimid, sizeof(__pyx_k_dimid), 0, 0, 1, 1},
  {&__pyx_n_u_dimid, __pyx_k_dimid, sizeof(__pyx_k_dimid), 0, 1, 0, 1},
  {&__pyx_n_s_dimname, __pyx_k_dimname, sizeof(__pyx_k_dimname), 0, 0, 1, 1},
  {&__pyx_n_s_disk_format, __pyx_k_disk_format, sizeof(__pyx_k_disk_format), 0, 0, 1, 1},
  {&__pyx_n_s_diskless, __pyx_k_diskless, sizeof(__pyx_k_diskless), 0, 0, 1, 1},
  {&__pyx_n_u_diskless, __pyx_k_diskless, sizeof(__pyx_k_diskless), 0, 1, 0, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_duplicate_subarray_ncfile, __pyx_k_duplicate_subarray_ncfile, sizeof(__pyx_k_duplicate_subarray_ncfile), 0, 0, 1, 1},
  {&__pyx_n_s_elem, __pyx_k_elem, sizeof(__pyx_k_elem), 0, 0, 1, 1},
  {&__pyx_n_s_endian, __pyx_k_endian, sizeof(__pyx_k_endian), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1},
  {&__pyx_n_s_errno_ENOENT, __pyx_k_errno_ENOENT, sizeof(__pyx_k_errno_ENOENT), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_file_manager, __pyx_k_file_manager, sizeof(__pyx_k_file_manager), 0, 0, 1, 1},
  {&__pyx_n_u_file_manager, __pyx_k_file_manager, sizeof(__pyx_k_file_manager), 0, 1, 0, 1},
  {&__pyx_n_s_file_manager_2, __pyx_k_file_manager_2, sizeof(__pyx_k_file_manager_2), 0, 0, 1, 1},
  {&__pyx_n_s_file_object, __pyx_k_file_object, sizeof(__pyx_k_file_object), 0, 0, 1, 1},
  {&__pyx_n_s_file_type, __pyx_k_file_type, sizeof(__pyx_k_file_type), 0, 0, 1, 1},
  {&__pyx_n_s_file_version, __pyx_k_file_version, sizeof(__pyx_k_file_version), 0, 0, 1, 1},
  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
  {&__pyx_n_s_fill_value, __pyx_k_fill_value, sizeof(__pyx_k_fill_value), 0, 0, 1, 1},
  {&__pyx_kp_u_filling_off, __pyx_k_filling_off, sizeof(__pyx_k_filling_off), 0, 1, 0, 0},
  {&__pyx_kp_u_filling_on__FillValue_of_used, __pyx_k_filling_on__FillValue_of_used, sizeof(__pyx_k_filling_on__FillValue_of_used), 0, 1, 0, 0},
  {&__pyx_n_s_fletcher32, __pyx_k_fletcher32, sizeof(__pyx_k_fletcher32), 0, 0, 1, 1},
  {&__pyx_n_s_fname, __pyx_k_fname, sizeof(__pyx_k_fname), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_u_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 1, 0, 1},
  {&__pyx_n_s_free_all_arrays, __pyx_k_free_all_arrays, sizeof(__pyx_k_free_all_arrays), 0, 0, 1, 1},
  {&__pyx_n_s_free_all_files, __pyx_k_free_all_files, sizeof(__pyx_k_free_all_files), 0, 0, 1, 1},
  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  {&__pyx_n_s_getAxisType, __pyx_k_getAxisType, sizeof(__pyx_k_getAxisType), 0, 0, 1, 1},
  {&__pyx_n_s_getBaseFilename, __pyx_k_getBaseFilename, sizeof(__pyx_k_getBaseFilename), 0, 0, 1, 1},
  {&__pyx_n_s_getCFAVersion, __pyx_k_getCFAVersion, sizeof(__pyx_k_getCFAVersion), 0, 0, 1, 1},
  {&__pyx_n_s_getDimension, __pyx_k_getDimension, sizeof(__pyx_k_getDimension), 0, 0, 1, 1},
  {&__pyx_n_s_getDimensions, __pyx_k_getDimensions, sizeof(__pyx_k_getDimensions), 0, 0, 1, 1},
  {&__pyx_n_s_getFormat, __pyx_k_getFormat, sizeof(__pyx_k_getFormat), 0, 0, 1, 1},
  {&__pyx_n_s_getGroup, __pyx_k_getGroup, sizeof(__pyx_k_getGroup), 0, 0, 1, 1},
  {&__pyx_n_u_getGroup, __pyx_k_getGroup, sizeof(__pyx_k_getGroup), 0, 1, 0, 1},
  {&__pyx_n_s_getLen, __pyx_k_getLen, sizeof(__pyx_k_getLen), 0, 0, 1, 1},
  {&__pyx_n_s_getMetadata, __pyx_k_getMetadata, sizeof(__pyx_k_getMetadata), 0, 0, 1, 1},
  {&__pyx_n_s_getName, __pyx_k_getName, sizeof(__pyx_k_getName), 0, 0, 1, 1},
  {&__pyx_n_s_getPartitionMatrixDimensions, __pyx_k_getPartitionMatrixDimensions, sizeof(__pyx_k_getPartitionMatrixDimensions), 0, 0, 1, 1},
  {&__pyx_n_s_getPartitionMatrixShape, __pyx_k_getPartitionMatrixShape, sizeof(__pyx_k_getPartitionMatrixShape), 0, 0, 1, 1},
  {&__pyx_n_s_getType, __pyx_k_getType, sizeof(__pyx_k_getType), 0, 0, 1, 1},
  {&__pyx_n_s_getVariable, __pyx_k_getVariable, sizeof(__pyx_k_getVariable), 0, 0, 1, 1},
  {&__pyx_n_s_getVariables, __pyx_k_getVariables, sizeof(__pyx_k_getVariables), 0, 0, 1, 1},
  {&__pyx_n_s_get_file_open_state, __pyx_k_get_file_open_state, sizeof(__pyx_k_get_file_open_state), 0, 0, 1, 1},
  {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
  {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
  {&__pyx_n_s_getncattr, __pyx_k_getncattr, sizeof(__pyx_k_getncattr), 0, 0, 1, 1},
  {&__pyx_kp_u_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 1, 0, 0},
  {&__pyx_n_s_group_and_dataset_repr, __pyx_k_group_and_dataset_repr, sizeof(__pyx_k_group_and_dataset_repr), 0, 0, 1, 1},
  {&__pyx_n_s_group_names, __pyx_k_group_names, sizeof(__pyx_k_group_names), 0, 0, 1, 1},
  {&__pyx_n_s_groupname, __pyx_k_groupname, sizeof(__pyx_k_groupname), 0, 0, 1, 1},
  {&__pyx_n_s_groups, __pyx_k_groups, sizeof(__pyx_k_groups), 0, 0, 1, 1},
  {&__pyx_n_u_groups, __pyx_k_groups, sizeof(__pyx_k_groups), 0, 1, 0, 1},
  {&__pyx_kp_u_groups_2, __pyx_k_groups_2, sizeof(__pyx_k_groups_2), 0, 1, 0, 0},
  {&__pyx_n_s_grp, __pyx_k_grp, sizeof(__pyx_k_grp), 0, 0, 1, 1},
  {&__pyx_n_u_grp, __pyx_k_grp, sizeof(__pyx_k_grp), 0, 1, 0, 1},
  {&__pyx_n_s_grp_2, __pyx_k_grp_2, sizeof(__pyx_k_grp_2), 0, 0, 1, 1},
  {&__pyx_n_s_grp_name, __pyx_k_grp_name, sizeof(__pyx_k_grp_name), 0, 0, 1, 1},
  {&__pyx_n_s_grpid, __pyx_k_grpid, sizeof(__pyx_k_grpid), 0, 0, 1, 1},
  {&__pyx_n_u_grpid, __pyx_k_grpid, sizeof(__pyx_k_grpid), 0, 1, 0, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_in_memory, __pyx_k_in_memory, sizeof(__pyx_k_in_memory), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_index_list, __pyx_k_index_list, sizeof(__pyx_k_index_list), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_kp_u_inmemory_nc, __pyx_k_inmemory_nc, sizeof(__pyx_k_inmemory_nc), 0, 1, 0, 0},
  {&__pyx_n_s_interpret_netCDF_filetype, __pyx_k_interpret_netCDF_filetype, sizeof(__pyx_k_interpret_netCDF_filetype), 0, 0, 1, 1},
  {&__pyx_n_s_is_file, __pyx_k_is_file, sizeof(__pyx_k_is_file), 0, 0, 1, 1},
  {&__pyx_n_s_isunlimited, __pyx_k_isunlimited, sizeof(__pyx_k_isunlimited), 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_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_keepweakref, __pyx_k_keepweakref, sizeof(__pyx_k_keepweakref), 0, 0, 1, 1},
  {&__pyx_n_u_keepweakref, __pyx_k_keepweakref, sizeof(__pyx_k_keepweakref), 0, 1, 0, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_least_significant_digit, __pyx_k_least_significant_digit, sizeof(__pyx_k_least_significant_digit), 0, 0, 1, 1},
  {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1},
  {&__pyx_n_s_license, __pyx_k_license, sizeof(__pyx_k_license), 0, 0, 1, 1},
  {&__pyx_n_s_location, __pyx_k_location, sizeof(__pyx_k_location), 0, 0, 1, 1},
  {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_managed_object, __pyx_k_managed_object, sizeof(__pyx_k_managed_object), 0, 0, 1, 1},
  {&__pyx_n_u_managed_object, __pyx_k_managed_object, sizeof(__pyx_k_managed_object), 0, 1, 0, 1},
  {&__pyx_n_s_max_subarray_size, __pyx_k_max_subarray_size, sizeof(__pyx_k_max_subarray_size), 0, 0, 1, 1},
  {&__pyx_n_s_memory, __pyx_k_memory, sizeof(__pyx_k_memory), 0, 0, 1, 1},
  {&__pyx_n_u_memory, __pyx_k_memory, sizeof(__pyx_k_memory), 0, 1, 0, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_metadata, __pyx_k_metadata, sizeof(__pyx_k_metadata), 0, 0, 1, 1},
  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
  {&__pyx_n_u_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 1, 0, 1},
  {&__pyx_n_s_mode_2, __pyx_k_mode_2, sizeof(__pyx_k_mode_2), 0, 0, 1, 1},
  {&__pyx_n_u_mode_2, __pyx_k_mode_2, sizeof(__pyx_k_mode_2), 0, 1, 0, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_u_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 0, 1},
  {&__pyx_kp_u_name_3, __pyx_k_name_3, sizeof(__pyx_k_name_3), 0, 1, 0, 0},
  {&__pyx_n_s_name_4, __pyx_k_name_4, sizeof(__pyx_k_name_4), 0, 0, 1, 1},
  {&__pyx_n_u_native, __pyx_k_native, sizeof(__pyx_k_native), 0, 1, 0, 1},
  {&__pyx_n_s_nc_bytes, __pyx_k_nc_bytes, sizeof(__pyx_k_nc_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_nc_dataset, __pyx_k_nc_dataset, sizeof(__pyx_k_nc_dataset), 0, 0, 1, 1},
  {&__pyx_n_u_nc_dataset, __pyx_k_nc_dataset, sizeof(__pyx_k_nc_dataset), 0, 1, 0, 1},
  {&__pyx_n_s_nc_dim, __pyx_k_nc_dim, sizeof(__pyx_k_nc_dim), 0, 0, 1, 1},
  {&__pyx_n_s_nc_dim_2, __pyx_k_nc_dim_2, sizeof(__pyx_k_nc_dim_2), 0, 0, 1, 1},
  {&__pyx_n_u_nc_dim_2, __pyx_k_nc_dim_2, sizeof(__pyx_k_nc_dim_2), 0, 1, 0, 1},
  {&__pyx_n_s_nc_dimensions, __pyx_k_nc_dimensions, sizeof(__pyx_k_nc_dimensions), 0, 0, 1, 1},
  {&__pyx_n_s_nc_ds, __pyx_k_nc_ds, sizeof(__pyx_k_nc_ds), 0, 0, 1, 1},
  {&__pyx_n_s_nc_dtype, __pyx_k_nc_dtype, sizeof(__pyx_k_nc_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_nc_grp, __pyx_k_nc_grp, sizeof(__pyx_k_nc_grp), 0, 0, 1, 1},
  {&__pyx_n_u_nc_grp, __pyx_k_nc_grp, sizeof(__pyx_k_nc_grp), 0, 1, 0, 1},
  {&__pyx_n_s_nc_grp_2, __pyx_k_nc_grp_2, sizeof(__pyx_k_nc_grp_2), 0, 0, 1, 1},
  {&__pyx_n_s_nc_in_dataset, __pyx_k_nc_in_dataset, sizeof(__pyx_k_nc_in_dataset), 0, 0, 1, 1},
  {&__pyx_n_s_nc_obj, __pyx_k_nc_obj, sizeof(__pyx_k_nc_obj), 0, 0, 1, 1},
  {&__pyx_n_s_nc_object, __pyx_k_nc_object, sizeof(__pyx_k_nc_object), 0, 0, 1, 1},
  {&__pyx_n_s_nc_out_dataset, __pyx_k_nc_out_dataset, sizeof(__pyx_k_nc_out_dataset), 0, 0, 1, 1},
  {&__pyx_n_s_nc_parent, __pyx_k_nc_parent, sizeof(__pyx_k_nc_parent), 0, 0, 1, 1},
  {&__pyx_n_s_nc_sa_dataset, __pyx_k_nc_sa_dataset, sizeof(__pyx_k_nc_sa_dataset), 0, 0, 1, 1},
  {&__pyx_n_s_nc_sa_dim_var, __pyx_k_nc_sa_dim_var, sizeof(__pyx_k_nc_sa_dim_var), 0, 0, 1, 1},
  {&__pyx_n_s_nc_sa_fld_var, __pyx_k_nc_sa_fld_var, sizeof(__pyx_k_nc_sa_fld_var), 0, 0, 1, 1},
  {&__pyx_n_s_nc_sa_grp, __pyx_k_nc_sa_grp, sizeof(__pyx_k_nc_sa_grp), 0, 0, 1, 1},
  {&__pyx_n_s_nc_var, __pyx_k_nc_var, sizeof(__pyx_k_nc_var), 0, 0, 1, 1},
  {&__pyx_n_s_nc_var_2, __pyx_k_nc_var_2, sizeof(__pyx_k_nc_var_2), 0, 0, 1, 1},
  {&__pyx_n_u_nc_var_2, __pyx_k_nc_var_2, sizeof(__pyx_k_nc_var_2), 0, 1, 0, 1},
  {&__pyx_n_s_ncattrs, __pyx_k_ncattrs, sizeof(__pyx_k_ncattrs), 0, 0, 1, 1},
  {&__pyx_n_s_ncd, __pyx_k_ncd, sizeof(__pyx_k_ncd), 0, 0, 1, 1},
  {&__pyx_n_s_ncdump, __pyx_k_ncdump, sizeof(__pyx_k_ncdump), 0, 0, 1, 1},
  {&__pyx_n_s_netCDF4, __pyx_k_netCDF4, sizeof(__pyx_k_netCDF4), 0, 0, 1, 1},
  {&__pyx_n_s_netCDF4__netCDF4, __pyx_k_netCDF4__netCDF4, sizeof(__pyx_k_netCDF4__netCDF4), 0, 0, 1, 1},
  {&__pyx_n_s_new_grp, __pyx_k_new_grp, sizeof(__pyx_k_new_grp), 0, 0, 1, 1},
  {&__pyx_n_s_new_var, __pyx_k_new_var, sizeof(__pyx_k_new_var), 0, 0, 1, 1},
  {&__pyx_n_s_newname, __pyx_k_newname, sizeof(__pyx_k_newname), 0, 0, 1, 1},
  {&__pyx_kp_u_not_found_as_a_group_or_variabl, __pyx_k_not_found_as_a_group_or_variabl, sizeof(__pyx_k_not_found_as_a_group_or_variabl), 0, 1, 0, 0},
  {&__pyx_kp_u_not_supported, __pyx_k_not_supported, sizeof(__pyx_k_not_supported), 0, 1, 0, 0},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_oldname, __pyx_k_oldname, sizeof(__pyx_k_oldname), 0, 0, 1, 1},
  {&__pyx_n_s_open_mode, __pyx_k_open_mode, sizeof(__pyx_k_open_mode), 0, 0, 1, 1},
  {&__pyx_n_s_open_state, __pyx_k_open_state, sizeof(__pyx_k_open_state), 0, 0, 1, 1},
  {&__pyx_n_s_open_subarray_ncfile, __pyx_k_open_subarray_ncfile, sizeof(__pyx_k_open_subarray_ncfile), 0, 0, 1, 1},
  {&__pyx_n_s_open_success, __pyx_k_open_success, sizeof(__pyx_k_open_success), 0, 0, 1, 1},
  {&__pyx_n_s_orig_mode, __pyx_k_orig_mode, sizeof(__pyx_k_orig_mode), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_parallel, __pyx_k_parallel, sizeof(__pyx_k_parallel), 0, 0, 1, 1},
  {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
  {&__pyx_n_u_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 1, 0, 1},
  {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1},
  {&__pyx_n_s_partition, __pyx_k_partition, sizeof(__pyx_k_partition), 0, 0, 1, 1},
  {&__pyx_kp_u_partition_matrix_dimensions, __pyx_k_partition_matrix_dimensions, sizeof(__pyx_k_partition_matrix_dimensions), 0, 1, 0, 0},
  {&__pyx_kp_u_partition_matrix_shape, __pyx_k_partition_matrix_shape, sizeof(__pyx_k_partition_matrix_shape), 0, 1, 0, 0},
  {&__pyx_n_s_persist, __pyx_k_persist, sizeof(__pyx_k_persist), 0, 0, 1, 1},
  {&__pyx_n_u_persist, __pyx_k_persist, sizeof(__pyx_k_persist), 0, 1, 0, 1},
  {&__pyx_n_s_pm_dimensions, __pyx_k_pm_dimensions, sizeof(__pyx_k_pm_dimensions), 0, 0, 1, 1},
  {&__pyx_n_s_pm_shape, __pyx_k_pm_shape, sizeof(__pyx_k_pm_shape), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_private_atts, __pyx_k_private_atts, sizeof(__pyx_k_private_atts), 0, 0, 1, 1},
  {&__pyx_n_s_prod, __pyx_k_prod, sizeof(__pyx_k_prod), 0, 0, 1, 1},
  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
  {&__pyx_n_s_psutil, __pyx_k_psutil, sizeof(__pyx_k_psutil), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_read_from, __pyx_k_read_from, sizeof(__pyx_k_read_from), 0, 0, 1, 1},
  {&__pyx_n_s_remote_system, __pyx_k_remote_system, sizeof(__pyx_k_remote_system), 0, 0, 1, 1},
  {&__pyx_n_s_renameDimension, __pyx_k_renameDimension, sizeof(__pyx_k_renameDimension), 0, 0, 1, 1},
  {&__pyx_n_s_renameGroup, __pyx_k_renameGroup, sizeof(__pyx_k_renameGroup), 0, 0, 1, 1},
  {&__pyx_n_s_renameVariable, __pyx_k_renameVariable, sizeof(__pyx_k_renameVariable), 0, 0, 1, 1},
  {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {&__pyx_n_s_request_array, __pyx_k_request_array, sizeof(__pyx_k_request_array), 0, 0, 1, 1},
  {&__pyx_n_s_request_file, __pyx_k_request_file, sizeof(__pyx_k_request_file), 0, 0, 1, 1},
  {&__pyx_n_s_request_object, __pyx_k_request_object, sizeof(__pyx_k_request_object), 0, 0, 1, 1},
  {&__pyx_n_u_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 1, 0, 1},
  {&__pyx_kp_u_root_group_data_model_file_forma, __pyx_k_root_group_data_model_file_forma, sizeof(__pyx_k_root_group_data_model_file_forma), 0, 1, 0, 0},
  {&__pyx_n_s_s3Dataset, __pyx_k_s3Dataset, sizeof(__pyx_k_s3Dataset), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset___dealloc, __pyx_k_s3Dataset___dealloc, sizeof(__pyx_k_s3Dataset___dealloc), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset___enter, __pyx_k_s3Dataset___enter, sizeof(__pyx_k_s3Dataset___enter), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset___exit, __pyx_k_s3Dataset___exit, sizeof(__pyx_k_s3Dataset___exit), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset___getattr, __pyx_k_s3Dataset___getattr, sizeof(__pyx_k_s3Dataset___getattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset___getitem, __pyx_k_s3Dataset___getitem, sizeof(__pyx_k_s3Dataset___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset___init, __pyx_k_s3Dataset___init, sizeof(__pyx_k_s3Dataset___init), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset___repr, __pyx_k_s3Dataset___repr, sizeof(__pyx_k_s3Dataset___repr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset___setattr, __pyx_k_s3Dataset___setattr, sizeof(__pyx_k_s3Dataset___setattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset___unicode, __pyx_k_s3Dataset___unicode, sizeof(__pyx_k_s3Dataset___unicode), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset__interpret_netCDF_file, __pyx_k_s3Dataset__interpret_netCDF_file, sizeof(__pyx_k_s3Dataset__interpret_netCDF_file), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_close, __pyx_k_s3Dataset_close, sizeof(__pyx_k_s3Dataset_close), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_createDimension, __pyx_k_s3Dataset_createDimension, sizeof(__pyx_k_s3Dataset_createDimension), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_createGroup, __pyx_k_s3Dataset_createGroup, sizeof(__pyx_k_s3Dataset_createGroup), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_createVariable, __pyx_k_s3Dataset_createVariable, sizeof(__pyx_k_s3Dataset_createVariable), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_delncattr, __pyx_k_s3Dataset_delncattr, sizeof(__pyx_k_s3Dataset_delncattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_dimensions, __pyx_k_s3Dataset_dimensions, sizeof(__pyx_k_s3Dataset_dimensions), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_file_object, __pyx_k_s3Dataset_file_object, sizeof(__pyx_k_s3Dataset_file_object), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_getncattr, __pyx_k_s3Dataset_getncattr, sizeof(__pyx_k_s3Dataset_getncattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_groups, __pyx_k_s3Dataset_groups, sizeof(__pyx_k_s3Dataset_groups), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_ncattrs, __pyx_k_s3Dataset_ncattrs, sizeof(__pyx_k_s3Dataset_ncattrs), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_renameDimension, __pyx_k_s3Dataset_renameDimension, sizeof(__pyx_k_s3Dataset_renameDimension), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_renameGroup, __pyx_k_s3Dataset_renameGroup, sizeof(__pyx_k_s3Dataset_renameGroup), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_renameVariable, __pyx_k_s3Dataset_renameVariable, sizeof(__pyx_k_s3Dataset_renameVariable), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_setncattr, __pyx_k_s3Dataset_setncattr, sizeof(__pyx_k_s3Dataset_setncattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_setncattr_string, __pyx_k_s3Dataset_setncattr_string, sizeof(__pyx_k_s3Dataset_setncattr_string), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_setncatts, __pyx_k_s3Dataset_setncatts, sizeof(__pyx_k_s3Dataset_setncatts), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dataset_variables, __pyx_k_s3Dataset_variables, sizeof(__pyx_k_s3Dataset_variables), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dimension, __pyx_k_s3Dimension, sizeof(__pyx_k_s3Dimension), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dimension___getattr, __pyx_k_s3Dimension___getattr, sizeof(__pyx_k_s3Dimension___getattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dimension___init, __pyx_k_s3Dimension___init, sizeof(__pyx_k_s3Dimension___init), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dimension___len, __pyx_k_s3Dimension___len, sizeof(__pyx_k_s3Dimension___len), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dimension___repr, __pyx_k_s3Dimension___repr, sizeof(__pyx_k_s3Dimension___repr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dimension___setattr, __pyx_k_s3Dimension___setattr, sizeof(__pyx_k_s3Dimension___setattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dimension___unicode, __pyx_k_s3Dimension___unicode, sizeof(__pyx_k_s3Dimension___unicode), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dimension_create, __pyx_k_s3Dimension_create, sizeof(__pyx_k_s3Dimension_create), 0, 0, 1, 1},
  {&__pyx_n_s_s3Dimension_size, __pyx_k_s3Dimension_size, sizeof(__pyx_k_s3Dimension_size), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group, __pyx_k_s3Group, sizeof(__pyx_k_s3Group), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group___getattr, __pyx_k_s3Group___getattr, sizeof(__pyx_k_s3Group___getattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group___getitem, __pyx_k_s3Group___getitem, sizeof(__pyx_k_s3Group___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group___init, __pyx_k_s3Group___init, sizeof(__pyx_k_s3Group___init), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group___repr, __pyx_k_s3Group___repr, sizeof(__pyx_k_s3Group___repr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group___setattr, __pyx_k_s3Group___setattr, sizeof(__pyx_k_s3Group___setattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group___unicode, __pyx_k_s3Group___unicode, sizeof(__pyx_k_s3Group___unicode), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_create, __pyx_k_s3Group_create, sizeof(__pyx_k_s3Group_create), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_createDimension, __pyx_k_s3Group_createDimension, sizeof(__pyx_k_s3Group_createDimension), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_createVariable, __pyx_k_s3Group_createVariable, sizeof(__pyx_k_s3Group_createVariable), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_delncattr, __pyx_k_s3Group_delncattr, sizeof(__pyx_k_s3Group_delncattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_dimensions, __pyx_k_s3Group_dimensions, sizeof(__pyx_k_s3Group_dimensions), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_getncattr, __pyx_k_s3Group_getncattr, sizeof(__pyx_k_s3Group_getncattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_ncattrs, __pyx_k_s3Group_ncattrs, sizeof(__pyx_k_s3Group_ncattrs), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_renameDimension, __pyx_k_s3Group_renameDimension, sizeof(__pyx_k_s3Group_renameDimension), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_renameVariable, __pyx_k_s3Group_renameVariable, sizeof(__pyx_k_s3Group_renameVariable), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_setncattr, __pyx_k_s3Group_setncattr, sizeof(__pyx_k_s3Group_setncattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_setncattr_string, __pyx_k_s3Group_setncattr_string, sizeof(__pyx_k_s3Group_setncattr_string), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_setncatts, __pyx_k_s3Group_setncatts, sizeof(__pyx_k_s3Group_setncatts), 0, 0, 1, 1},
  {&__pyx_n_s_s3Group_variables, __pyx_k_s3Group_variables, sizeof(__pyx_k_s3Group_variables), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable, __pyx_k_s3Variable, sizeof(__pyx_k_s3Variable), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable___create_subarray_ncf, __pyx_k_s3Variable___create_subarray_ncf, sizeof(__pyx_k_s3Variable___create_subarray_ncf), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable___duplicate_subarray, __pyx_k_s3Variable___duplicate_subarray, sizeof(__pyx_k_s3Variable___duplicate_subarray), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable___getattr, __pyx_k_s3Variable___getattr, sizeof(__pyx_k_s3Variable___getattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable___getitem, __pyx_k_s3Variable___getitem, sizeof(__pyx_k_s3Variable___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable___init, __pyx_k_s3Variable___init, sizeof(__pyx_k_s3Variable___init), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable___open_subarray_ncfil, __pyx_k_s3Variable___open_subarray_ncfil, sizeof(__pyx_k_s3Variable___open_subarray_ncfil), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable___repr, __pyx_k_s3Variable___repr, sizeof(__pyx_k_s3Variable___repr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable___setattr, __pyx_k_s3Variable___setattr, sizeof(__pyx_k_s3Variable___setattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable___setitem, __pyx_k_s3Variable___setitem, sizeof(__pyx_k_s3Variable___setitem), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable___unicode, __pyx_k_s3Variable___unicode, sizeof(__pyx_k_s3Variable___unicode), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable__create_subarray_ncf, __pyx_k_s3Variable__create_subarray_ncf, sizeof(__pyx_k_s3Variable__create_subarray_ncf), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable__duplicate_subarray, __pyx_k_s3Variable__duplicate_subarray, sizeof(__pyx_k_s3Variable__duplicate_subarray), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable__open_subarray_ncfil, __pyx_k_s3Variable__open_subarray_ncfil, sizeof(__pyx_k_s3Variable__open_subarray_ncfil), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable_create, __pyx_k_s3Variable_create, sizeof(__pyx_k_s3Variable_create), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable_delncattr, __pyx_k_s3Variable_delncattr, sizeof(__pyx_k_s3Variable_delncattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable_dimensions, __pyx_k_s3Variable_dimensions, sizeof(__pyx_k_s3Variable_dimensions), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable_dtype, __pyx_k_s3Variable_dtype, sizeof(__pyx_k_s3Variable_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable_file_manager, __pyx_k_s3Variable_file_manager, sizeof(__pyx_k_s3Variable_file_manager), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable_getncattr, __pyx_k_s3Variable_getncattr, sizeof(__pyx_k_s3Variable_getncattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable_ncattrs, __pyx_k_s3Variable_ncattrs, sizeof(__pyx_k_s3Variable_ncattrs), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable_setncattr, __pyx_k_s3Variable_setncattr, sizeof(__pyx_k_s3Variable_setncattr), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable_setncattr_string, __pyx_k_s3Variable_setncattr_string, sizeof(__pyx_k_s3Variable_setncattr_string), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable_setncatts, __pyx_k_s3Variable_setncatts, sizeof(__pyx_k_s3Variable_setncatts), 0, 0, 1, 1},
  {&__pyx_n_s_s3Variable_shape, __pyx_k_s3Variable_shape, sizeof(__pyx_k_s3Variable_shape), 0, 0, 1, 1},
  {&__pyx_n_s_s3_dataset, __pyx_k_s3_dataset, sizeof(__pyx_k_s3_dataset), 0, 0, 1, 1},
  {&__pyx_n_s_s3_dimensions, __pyx_k_s3_dimensions, sizeof(__pyx_k_s3_dimensions), 0, 0, 1, 1},
  {&__pyx_n_u_s3_dimensions, __pyx_k_s3_dimensions, sizeof(__pyx_k_s3_dimensions), 0, 1, 0, 1},
  {&__pyx_n_s_s3_groups, __pyx_k_s3_groups, sizeof(__pyx_k_s3_groups), 0, 0, 1, 1},
  {&__pyx_n_u_s3_groups, __pyx_k_s3_groups, sizeof(__pyx_k_s3_groups), 0, 1, 0, 1},
  {&__pyx_n_s_s3_variables, __pyx_k_s3_variables, sizeof(__pyx_k_s3_variables), 0, 0, 1, 1},
  {&__pyx_n_u_s3_variables, __pyx_k_s3_variables, sizeof(__pyx_k_s3_variables), 0, 1, 0, 1},
  {&__pyx_n_s_s3d, __pyx_k_s3d, sizeof(__pyx_k_s3d), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_setType, __pyx_k_setType, sizeof(__pyx_k_setType), 0, 0, 1, 1},
  {&__pyx_n_s_setattr, __pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 0, 1, 1},
  {&__pyx_n_s_setitem, __pyx_k_setitem, sizeof(__pyx_k_setitem), 0, 0, 1, 1},
  {&__pyx_n_s_setncattr, __pyx_k_setncattr, sizeof(__pyx_k_setncattr), 0, 0, 1, 1},
  {&__pyx_n_s_setncattr_string, __pyx_k_setncattr_string, sizeof(__pyx_k_setncattr_string), 0, 0, 1, 1},
  {&__pyx_n_s_setncatts, __pyx_k_setncatts, sizeof(__pyx_k_setncatts), 0, 0, 1, 1},
  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
  {&__pyx_n_u_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 1, 0, 1},
  {&__pyx_n_s_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_kp_u_size_2, __pyx_k_size_2, sizeof(__pyx_k_size_2), 0, 1, 0, 0},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1},
  {&__pyx_n_s_subarray_shape, __pyx_k_subarray_shape, sizeof(__pyx_k_subarray_shape), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_sys_version_info, __pyx_k_sys_version_info, sizeof(__pyx_k_sys_version_info), 0, 0, 1, 1},
  {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
  {&__pyx_n_s_target_array, __pyx_k_target_array, sizeof(__pyx_k_target_array), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
  {&__pyx_kp_u_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 1, 0, 0},
  {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1},
  {&__pyx_n_s_unlimdims, __pyx_k_unlimdims, sizeof(__pyx_k_unlimdims), 0, 0, 1, 1},
  {&__pyx_kp_u_unlimited_True, __pyx_k_unlimited_True, sizeof(__pyx_k_unlimited_True), 0, 1, 0, 0},
  {&__pyx_kp_u_unlimited_dimensions, __pyx_k_unlimited_dimensions, sizeof(__pyx_k_unlimited_dimensions), 0, 1, 0, 0},
  {&__pyx_n_s_url, __pyx_k_url, sizeof(__pyx_k_url), 0, 0, 1, 1},
  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_var, __pyx_k_var, sizeof(__pyx_k_var), 0, 0, 1, 1},
  {&__pyx_n_s_var_name, __pyx_k_var_name, sizeof(__pyx_k_var_name), 0, 0, 1, 1},
  {&__pyx_n_s_var_names_dims, __pyx_k_var_names_dims, sizeof(__pyx_k_var_names_dims), 0, 0, 1, 1},
  {&__pyx_n_s_variables, __pyx_k_variables, sizeof(__pyx_k_variables), 0, 0, 1, 1},
  {&__pyx_kp_u_variables_dimensions, __pyx_k_variables_dimensions, sizeof(__pyx_k_variables_dimensions), 0, 1, 0, 0},
  {&__pyx_n_s_varname, __pyx_k_varname, sizeof(__pyx_k_varname), 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_virtual_memory, __pyx_k_virtual_memory, sizeof(__pyx_k_virtual_memory), 0, 0, 1, 1},
  {&__pyx_n_u_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 1, 0, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_writeInitialPartitionInfo, __pyx_k_writeInitialPartitionInfo, sizeof(__pyx_k_writeInitialPartitionInfo), 0, 0, 1, 1},
  {&__pyx_n_s_writePartition, __pyx_k_writePartition, sizeof(__pyx_k_writePartition), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_zlib, __pyx_k_zlib, sizeof(__pyx_k_zlib), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 34, __pyx_L1_error)
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 106, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 330, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 1126, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 1314, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "S3netCDF4/_s3netCDF4.pyx":514
 *                 new_var.setncatts(grp[var_name].__dict__)
 *                 # copy all the data
 *                 new_var[:] = var[:]             # <<<<<<<<<<<<<<
 * 
 *         # copy dimensions
 */
  __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__4);
  __Pyx_GIVEREF(__pyx_slice__4);

  /* "S3netCDF4/_s3netCDF4.pyx":924
 *     # trim the comma, add a line break
 *     if len(dim_names_sizes) > 1:
 *         dim_names_sizes[-1] = dim_names_sizes[-1][0:-2]             # <<<<<<<<<<<<<<
 *     dim_names_sizes.append("\n")
 *     ncdump.extend(dim_names_sizes)
 */
  __pyx_slice__9 = PySlice_New(__pyx_int_0, __pyx_int_neg_2, Py_None); if (unlikely(!__pyx_slice__9)) __PYX_ERR(0, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__9);
  __Pyx_GIVEREF(__pyx_slice__9);

  /* "S3netCDF4/_s3netCDF4.pyx":949
 *         # don't add cfa groups or the root group
 *         if not(g == "root"):
 *             if (g[0:4] == "cfa_"):             # <<<<<<<<<<<<<<
 *                 cfa_group_names.append("{}, ".format(g))
 *             else:
 */
  __pyx_slice__12 = PySlice_New(__pyx_int_0, __pyx_int_4, Py_None); if (unlikely(!__pyx_slice__12)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__12);
  __Pyx_GIVEREF(__pyx_slice__12);

  /* "S3netCDF4/_s3netCDF4.pyx":1278
 *             if self._managed_object.file_object.remote_system:
 *                 # call the constructor of the netCDF4.Dataset class
 *                 self._nc_dataset = netCDF4.Dataset(             # <<<<<<<<<<<<<<
 *                     "inmemory.nc", mode=mode, clobber=clobber,
 *                     format=file_type, diskless=True, persist=False,
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_inmemory_nc); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "S3netCDF4/_s3netCDF4.pyx":1310
 *                 )
 *             # get the header data
 *             data = self._managed_object.file_object.read_from(0, 6)             # <<<<<<<<<<<<<<
 *             file_type, file_version = s3Dataset._interpret_netCDF_filetype(data)
 *             # check what the file type is a netCDF file or not
 */
  __pyx_tuple__15 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_6); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "S3netCDF4/_s3netCDF4.pyx":1568
 *         # check whether it's a netCDF file (how can we tell if it's a
 *         # NETCDF4_CLASSIC file?
 *         if data[1:4] == b'HDF':             # <<<<<<<<<<<<<<
 *             # netCDF4 (HD5 version)
 *             file_type = 'NETCDF4'
 */
  __pyx_slice__16 = PySlice_New(__pyx_int_1, __pyx_int_4, Py_None); if (unlikely(!__pyx_slice__16)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__16);
  __Pyx_GIVEREF(__pyx_slice__16);

  /* "S3netCDF4/_s3netCDF4.pyx":1576
 *             file_type = 'NETCDF4'
 *             file_version = 4
 *         elif data[0:3] == b'CDF':             # <<<<<<<<<<<<<<
 *             file_version = data[3]
 *             if file_version == 1:
 */
  __pyx_slice__21 = PySlice_New(__pyx_int_0, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__21);
  __Pyx_GIVEREF(__pyx_slice__21);

  /* "S3netCDF4/_s3netCDF4.pyx":34
 * from S3netCDF4.Managers._FileManager import FileManager, OpenFileRecord
 * 
 * class s3Dimension(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Dimension class and override some key member
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "S3netCDF4/_s3netCDF4.pyx":41
 *     """
 *     _private_atts = ["_cfa_dim", "_nc_dim"]
 *     def __init__(self, cfa_dim=None, nc_dim=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the dimension.  The variables will be loaded in by
 *         either the createDimension method(s) or the load function called from
 */
  __pyx_tuple__24 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_cfa_dim, __pyx_n_s_nc_dim, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);
  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_init, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 41, __pyx_L1_error)
  __pyx_tuple__26 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "S3netCDF4/_s3netCDF4.pyx":49
 *         self.parent = parent
 * 
 *     def create(self, parent, name, size=None,             # <<<<<<<<<<<<<<
 *                axis_type="U", metadata={}, **kwargs):
 *         """Initialise the dimension.  This adds the CFADimension structure to
 */
  __pyx_tuple__27 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_parent, __pyx_n_s_name, __pyx_n_s_size, __pyx_n_s_axis_type, __pyx_n_s_metadata, __pyx_n_s_kwargs, __pyx_n_s_nc_object, __pyx_n_s_cfa_root_group); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);
  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(6, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_create, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 49, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":79
 *         self._nc_dim = nc_object.createDimension(name, size)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the dimension and return the
 *             corresponding attribute from the _nc_dim object."""
 */
  __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);
  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_getattr, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 79, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":87
 *             return self._nc_dim.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the dimension and set the
 *             corresponding attribute in the _nc_dim object."""
 */
  __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setattr, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 87, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":103
 *             self._nc_dim._grp = value
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._nc_dim.__len__()
 * 
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);
  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_len, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 103, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":107
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self._nc_dim.__len__()
 * 
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_size, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 107, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":110
 *         return self._nc_dim.__len__()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             if sys_version_info[0] > 2:
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_repr, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 110, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":119
 *             return self._nc_dim.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_dim = self._cfa_dim
 */
  __pyx_tuple__39 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_ncdump, __pyx_n_s_cfa_dim, __pyx_n_s_cfa_meta, __pyx_n_s_m); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);
  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_unicode, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 119, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":137
 *         return "".join(ncdump)
 * 
 * class s3Variable(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Variable class and override some key member
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "S3netCDF4/_s3netCDF4.pyx":148
 *     ]
 * 
 *     def __init__(self, cfa_var=None, cfa_dim=None, nc_var=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the class, any loading of the variables will be done
 *         in the create method."""
 */
  __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_cfa_var, __pyx_n_s_cfa_dim, __pyx_n_s_nc_var, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_init, 148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 148, __pyx_L1_error)
  __pyx_tuple__44 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "S3netCDF4/_s3netCDF4.pyx":157
 * 
 *     @property
 *     def file_manager(self):             # <<<<<<<<<<<<<<
 *         """Return the parent's (or parent's parent's) file manager"""
 *         # assign the file manager
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);
  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_file_manager_2, 157, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 157, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":167
 *             return None
 * 
 *     def create(self, parent, name, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *             complevel=4, shuffle=True, fletcher32=False, contiguous=False,
 *             chunksizes=None, endian='native', least_significant_digit=None,
 */
  __pyx_tuple__47 = PyTuple_Pack(26, __pyx_n_s_self, __pyx_n_s_parent, __pyx_n_s_name, __pyx_n_s_datatype, __pyx_n_s_dimensions, __pyx_n_s_zlib, __pyx_n_s_complevel, __pyx_n_s_shuffle, __pyx_n_s_fletcher32, __pyx_n_s_contiguous, __pyx_n_s_chunksizes, __pyx_n_s_endian, __pyx_n_s_least_significant_digit, __pyx_n_s_fill_value, __pyx_n_s_chunk_cache, __pyx_n_s_subarray_shape, __pyx_n_s_max_subarray_size, __pyx_n_s_kwargs, __pyx_n_s_nc_dimensions, __pyx_n_s_s3_dataset, __pyx_n_s_nc_parent, __pyx_n_s_ncd, __pyx_n_s_cfa_root_group, __pyx_n_s_pm_dimensions, __pyx_n_s_pm_shape, __pyx_n_s_cfa_version); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);
  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(17, 0, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_create, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 167, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":295
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         """Override the shape parameter."""
 *         if hasattr(self, "_cfa_var"):
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);
  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_shape, 295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 295, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":303
 * 
 *     @property
 *     def dtype(self):             # <<<<<<<<<<<<<<
 *         """Override the dtype parameter."""
 *         if hasattr(self, "_cfa_var"):
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);
  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_dtype, 303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 303, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":311
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_var"):
 *             return tuple(self._cfa_var.getDimensions())
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);
  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_dimensions, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 311, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":318
 * 
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Variable so as to return its
 *         private variables."""
 */
  __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);
  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_getattr, 318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 318, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":333
 *             return self._nc_var.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Variable so as to assign its
 *         private variables."""
 */
  __pyx_tuple__57 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);
  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setattr, 333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 333, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":348
 *             self._nc_var.__setattr__(name, value)
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__59 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);
  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_delncattr, 348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 348, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":371
 *             self._nc_var.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_getncattr, 371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 371, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":388
 *             return self._nc_var.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);
  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_ncattrs, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 388, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":399
 *             return self._nc_var.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__65 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setncattr, 399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 399, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":410
 *             self._nc_var.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_tuple__67 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);
  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setncattr_string, 410, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 410, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":421
 *             self._nc_var.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_tuple__69 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_attdict, __pyx_n_s_k); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setncatts, 421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 421, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":436
 *             self._nc_var.setncatts(attdict)
 * 
 *     def __open_subarray_ncfile(self, index, request_object,             # <<<<<<<<<<<<<<
 *                                in_memory=False, mode="r"):
 *         """Open a subarray file, either in memory or on disk"""
 */
  __pyx_tuple__71 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_request_object, __pyx_n_s_in_memory, __pyx_n_s_mode, __pyx_n_s_s3d, __pyx_n_s_diskless, __pyx_n_s_memory, __pyx_n_s_fname, __pyx_n_s_nc_sa_dataset); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_open_subarray_ncfile, 436, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 436, __pyx_L1_error)
  __pyx_tuple__73 = PyTuple_Pack(2, ((PyObject *)Py_False), ((PyObject*)__pyx_n_u_r)); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "S3netCDF4/_s3netCDF4.pyx":482
 *         return nc_sa_dataset
 * 
 *     def __duplicate_subarray_ncfile(self, nc_in_dataset, nc_out_dataset):             # <<<<<<<<<<<<<<
 *         """Copy the contents of one subarray netCDF file into another subarray
 *         netCDF file.
 */
  __pyx_tuple__74 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_nc_in_dataset, __pyx_n_s_nc_out_dataset, __pyx_n_s_grp_name, __pyx_n_s_grp_2, __pyx_n_s_new_grp, __pyx_n_s_dim_name, __pyx_n_s_dim, __pyx_n_s_dim_len, __pyx_n_s_var_name, __pyx_n_s_var, __pyx_n_s_new_var); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_duplicate_subarray_ncfile, 482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 482, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":536
 *         return nc_out_dataset
 * 
 *     def __create_subarray_ncfile(self, index, in_memory=True, mode="w"):             # <<<<<<<<<<<<<<
 *         """Create the subarray file, either in memory or on disk."""
 *         nc_sa_dataset = self.__open_subarray_ncfile(
 */
  __pyx_tuple__76 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_in_memory, __pyx_n_s_mode, __pyx_n_s_nc_sa_dataset, __pyx_n_s_cfa_grp_2, __pyx_n_s_nc_sa_grp, __pyx_n_s_nc_grp_2, __pyx_n_s_d, __pyx_n_s_dim_name, __pyx_n_s_cfa_dim, __pyx_n_s_dtype, __pyx_n_s_nc_sa_dim_var, __pyx_n_s_nc_sa_fld_var); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(4, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_create_subarray_ncfile, 536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 536, __pyx_L1_error)
  __pyx_tuple__78 = PyTuple_Pack(2, ((PyObject *)Py_True), ((PyObject*)__pyx_n_u_w)); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "S3netCDF4/_s3netCDF4.pyx":603
 *         return nc_sa_dataset
 * 
 *     def __setitem__(self, elem, data):             # <<<<<<<<<<<<<<
 *         """Override the netCDF4.Variable __setitem__ method to assign data to
 *         the correct subarray file.
 */
  __pyx_tuple__79 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_elem, __pyx_n_s_data, __pyx_n_s_index_list, __pyx_n_s_index, __pyx_n_s_size, __pyx_n_s_open_state, __pyx_n_s_orig_mode, __pyx_n_s_open_mode, __pyx_n_s_request_object, __pyx_n_s_nc_sa_dataset, __pyx_n_s_nc_in_dataset, __pyx_n_s_cfa_grp_2, __pyx_n_s_nc_sa_grp, __pyx_n_s_nc_sa_fld_var); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);
  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setitem, 603, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 603, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":753
 *             self._nc_var.__setitem__(elem, data)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the netCDF4.Variable __getitem__ method to assign data to
 *         the correct subarray file.
 */
  __pyx_tuple__81 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_elem, __pyx_n_s_s3d, __pyx_n_s_index_list, __pyx_n_s_target_array, __pyx_n_s_index, __pyx_n_s_size, __pyx_n_s_request_object, __pyx_n_s_nc_sa_dataset, __pyx_n_s_cfa_grp_2, __pyx_n_s_nc_sa_grp, __pyx_n_s_nc_sa_fld_var); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);
  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_getitem, 753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 753, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":835
 *             return self._nc_var[elem]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             if sys_version_info[0] > 2:
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);
  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_repr, 835, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 835, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":845
 * 
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_var = self._cfa_var
 */
  __pyx_tuple__85 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_ncdump, __pyx_n_s_cfa_var, __pyx_n_s_cfa_meta, __pyx_n_s_m, __pyx_n_s_unlimdims, __pyx_n_s_dimname, __pyx_n_s_dim, __pyx_n_s_x, __pyx_n_s_x); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);
  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_unicode, 845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 845, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":892
 * 
 * # Function below is for s3Group and s3Dataset classes
 * def _group_and_dataset_repr(ncdump, cfa_obj, nc_obj):             # <<<<<<<<<<<<<<
 *     """This is a generalised function to generate a list to be used in the
 *     __repr__ strings for both s3Groups and s3Datasets, as the code is largely
 */
  __pyx_tuple__87 = PyTuple_Pack(15, __pyx_n_s_ncdump, __pyx_n_s_cfa_obj, __pyx_n_s_nc_obj, __pyx_n_s_cfa_meta, __pyx_n_s_m, __pyx_n_s_grp_2, __pyx_n_s_var_names_dims, __pyx_n_s_dim_names_sizes, __pyx_n_s_d, __pyx_n_s_cfa_dim, __pyx_n_s_v, __pyx_n_s_cfa_var, __pyx_n_s_group_names, __pyx_n_s_cfa_group_names, __pyx_n_s_g); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);
  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_group_and_dataset_repr, 892, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 892, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":965
 *     return ncdump
 * 
 * class s3Group(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Group class and override some key member
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "S3netCDF4/_s3netCDF4.pyx":974
 *                      "_s3_variables", "_s3_dimensions"]
 * 
 *     def __init__(self, nc_grp=None, cfa_grp=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the class, any loading of the variables will be done
 *         by the parser, or the CreateGroup member of s3Dataset."""
 */
  __pyx_tuple__90 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_nc_grp_2, __pyx_n_s_cfa_grp_2, __pyx_n_s_parent); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_init, 974, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 974, __pyx_L1_error)
  __pyx_tuple__92 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "S3netCDF4/_s3netCDF4.pyx":983
 *         self._s3_dimensions = {}
 * 
 *     def create(self, parent, name, **kwargs):             # <<<<<<<<<<<<<<
 *         """Initialise the group.  This adds the CFAGroup structure to the
 *         group as well as initialising the composed class."""
 */
  __pyx_tuple__93 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_parent, __pyx_n_s_name, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_create, 983, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 983, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":996
 *         self.parent = parent
 * 
 *     def createDimension(self, dimname, size=None,             # <<<<<<<<<<<<<<
 *                         axis_type="U", metadata={}):
 *         """Create a dimension in the group.  Add the CFADimension structure to
 */
  __pyx_tuple__95 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_dimname, __pyx_n_s_size, __pyx_n_s_axis_type, __pyx_n_s_metadata); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_createDimension, 996, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 996, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1014
 *         return self._s3_dimensions[dimname]
 * 
 *     def renameDimension(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the dimension by overloading the base method."""
 *         if self._cfa_grp:
 */
  __pyx_tuple__97 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_oldname, __pyx_n_s_newname); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_renameDimension, 1014, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 1014, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1020
 *         self._nc_grp.renameDimension(oldname, newname)
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *                        complevel=4, shuffle=True, fletcher32=False,
 *                        contiguous=False, chunksizes=None, endian='native',
 */
  __pyx_tuple__99 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_varname, __pyx_n_s_datatype, __pyx_n_s_dimensions, __pyx_n_s_zlib, __pyx_n_s_complevel, __pyx_n_s_shuffle, __pyx_n_s_fletcher32, __pyx_n_s_contiguous, __pyx_n_s_chunksizes, __pyx_n_s_endian, __pyx_n_s_least_significant_digit, __pyx_n_s_fill_value, __pyx_n_s_chunk_cache, __pyx_n_s_subarray_shape, __pyx_n_s_max_subarray_size); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(16, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_createVariable, 1020, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 1020, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1050
 *         return self._s3_variables[varname]
 * 
 *     def renameVariable(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the variable by overloading the base method."""
 *         if self._cfa_grp:
 */
  __pyx_tuple__101 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_oldname, __pyx_n_s_newname); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_renameVariable, 1050, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 1050, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1056
 *         self._nc_grp.renameVariable(oldname, newname)
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__103 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_delncattr, 1056, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 1056, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1071
 *             self._nc_grp.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__105 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 1071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_getncattr, 1071, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 1071, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1083
 *             return self._nc_grp.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_ncattrs, 1083, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 1083, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1092
 *             return self._nc_grp.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__109 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 1092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setncattr, 1092, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 1092, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1101
 *             self._nc_grp.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_tuple__111 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setncattr_string, 1101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 1101, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1110
 *             self._nc_grp.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_tuple__113 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_attdict, __pyx_n_s_k); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setncatts, 1110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 1110, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1120
 *             self._nc_grp.setncatts(attdict)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 */
  __pyx_tuple__115 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_getitem, 1120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 1120, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1131
 * 
 *     @property
 *     def variables(self):             # <<<<<<<<<<<<<<
 *         return self._s3_variables
 * 
 */
  __pyx_tuple__117 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);
  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_variables, 1131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 1131, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1135
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         return self._s3_dimensions
 * 
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_dimensions, 1135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 1135, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1138
 *         return self._s3_dimensions
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             if sys_version_info[0] > 2:
 */
  __pyx_tuple__121 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_repr, 1138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 1138, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1151
 *                 return self._nc_grp.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_grp = self._cfa_grp
 */
  __pyx_tuple__123 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ncdump, __pyx_n_s_cfa_grp_2, __pyx_n_s_nc_grp_2); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 1151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);
  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_unicode, 1151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 1151, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1160
 *         return "".join(ncdump)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Group so as to return its
 *         private variables."""
 */
  __pyx_tuple__125 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);
  __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_getattr, 1160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 1160, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1173
 * 
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Group so as to assign its
 *         private variables."""
 */
  __pyx_tuple__127 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 1173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setattr, 1173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 1173, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1186
 * 
 * 
 * class s3Dataset(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Dataset class and override some key member
 */
  __pyx_tuple__129 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "S3netCDF4/_s3netCDF4.pyx":1199
 * 
 *     @property
 *     def file_object(self):             # <<<<<<<<<<<<<<
 *         return self._managed_object.file_object
 * 
 */
  __pyx_tuple__130 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_file_object, 1199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 1199, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1202
 *         return self._managed_object.file_object
 * 
 *     def __init__(self, filename, mode='r', clobber=True, format='DEFAULT',             # <<<<<<<<<<<<<<
 *                  diskless=False, persist=False, keepweakref=False, memory=None,
 *                  cfa_version="0.5", **kwargs):
 */
  __pyx_tuple__132 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_mode, __pyx_n_s_clobber, __pyx_n_s_format, __pyx_n_s_diskless, __pyx_n_s_persist, __pyx_n_s_keepweakref, __pyx_n_s_memory, __pyx_n_s_cfa_version, __pyx_n_s_kwargs, __pyx_n_s_file_type, __pyx_n_s_data, __pyx_n_s_file_version, __pyx_n_s_nc_bytes, __pyx_n_s_parser); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(10, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_init, 1202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __pyx_tuple__134 = PyTuple_Pack(8, ((PyObject*)__pyx_n_u_r), ((PyObject *)Py_True), ((PyObject*)__pyx_n_u_DEFAULT), ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject*)__pyx_kp_u_0_5)); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "S3netCDF4/_s3netCDF4.pyx":1349
 *             raise APIException("Mode " + mode + " not supported.")
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Allow with s3Dataset statements."""
 *         return self
 */
  __pyx_tuple__135 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);
  __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_enter, 1349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 1349, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1353
 *         return self
 * 
 *     def __exit__(self, atype, value, traceback):             # <<<<<<<<<<<<<<
 *         """Close on exit"""
 *         self.close()
 */
  __pyx_tuple__137 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_atype, __pyx_n_s_value, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);
  __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_exit, 1353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 1353, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1357
 *         self.close()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """Close the Dataset."""
 *         # write the metadata to (all) the file(s)
 */
  __pyx_tuple__139 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_parser); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);
  __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_close, 1357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 1357, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1373
 *         self._file_manager.free_all_arrays()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """Close the dataset when no references are left to the S3Dataset"""
 *         self.close()
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);
  __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_dealloc, 1373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 1373, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1377
 *         self.close()
 * 
 *     def createDimension(self, dimname, size=None,             # <<<<<<<<<<<<<<
 *                         axis_type="U", metadata={}):
 *         """Create a dimension in the Dataset.  This just calls createDimension
 */
  __pyx_tuple__143 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_dimname, __pyx_n_s_size, __pyx_n_s_axis_type, __pyx_n_s_metadata); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);
  __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_createDimension, 1377, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 1377, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1391
 *         return self._s3_dimensions[dimname]
 * 
 *     def renameDimension(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the dimension by overloading the base method."""
 *         if not oldname in self.dimensions:
 */
  __pyx_tuple__145 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_oldname, __pyx_n_s_newname, __pyx_n_s_cfa_root_group); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);
  __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_renameDimension, 1391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 1391, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1403
 *         self._nc_dataset.renameDimension(oldname, newname)
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *                        complevel=4, shuffle=True, fletcher32=False,
 *                        contiguous=False, chunksizes=None, endian='native',
 */
  __pyx_tuple__147 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_varname, __pyx_n_s_datatype, __pyx_n_s_dimensions, __pyx_n_s_zlib, __pyx_n_s_complevel, __pyx_n_s_shuffle, __pyx_n_s_fletcher32, __pyx_n_s_contiguous, __pyx_n_s_chunksizes, __pyx_n_s_endian, __pyx_n_s_least_significant_digit, __pyx_n_s_fill_value, __pyx_n_s_chunk_cache, __pyx_n_s_subarray_shape, __pyx_n_s_max_subarray_size); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);
  __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(16, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_createVariable, 1403, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 1403, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1433
 *         return self._s3_variables[varname]
 * 
 *     def renameVariable(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the variable by overloading the base method."""
 *         # get the cfa root group
 */
  __pyx_tuple__149 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_oldname, __pyx_n_s_newname, __pyx_n_s_cfa_root_group); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);
  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_renameVariable, 1433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 1433, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1441
 *         self._nc_dataset.renameVariable(oldname, newname)
 * 
 *     def createGroup(self, groupname):             # <<<<<<<<<<<<<<
 *         """Create a group.  If this file is a CFA file then create the CFAGroup
 *         as well."""
 */
  __pyx_tuple__151 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_groupname); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);
  __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_createGroup, 1441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 1441, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1448
 *         return self._s3_groups[groupname]
 * 
 *     def renameGroup(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename a group.  If this file is a CFA file then rename the CFAGroup
 *         as well."""
 */
  __pyx_tuple__153 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_oldname, __pyx_n_s_newname); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);
  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_renameGroup, 1448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 1448, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1455
 *         self._nc_dataset.renameGroup(oldname, newname)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Dataset so as to return its
 *         private variables."""
 */
  __pyx_tuple__155 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_getattr, 1455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 1455, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1471
 *             return self._nc_dataset.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Dataset so as to assign its
 *         private variables."""
 */
  __pyx_tuple__157 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 1471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);
  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setattr, 1471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 1471, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1483
 *             self._nc_dataset.__setattr__(name, value)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 */
  __pyx_tuple__159 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_elem); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 1483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);
  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_getitem, 1483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 1483, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1496
 * 
 *     @property
 *     def groups(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the groups, and this is a cfa dataset then build
 *         # and return the dictionary of s3_groups
 */
  __pyx_tuple__161 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 1496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);
  __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_groups, 1496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 1496, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1505
 * 
 *     @property
 *     def variables(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the variables, and this is a cfa dataset then
 *         # build and return the dictionary of s3_variables
 */
  __pyx_tuple__163 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);
  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_variables, 1505, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 1505, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1514
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the dimensions, and this is a cfa dataset then
 *         # build and return the dictionary of s3_dimensions
 */
  __pyx_tuple__165 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);
  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_dimensions, 1514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 1514, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1522
 *             return self._nc_dataset.dimensions
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             if sys_version_info[0] > 2:
 */
  __pyx_tuple__167 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);
  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_repr, 1522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(0, 1522, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1531
 *             return self._nc_dataset.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         # This function is only applicable to S3Datasets with _cfa_dataset
 *         # defined.  Therefore we can use the _cfa_dataset information
 */
  __pyx_tuple__169 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ncdump, __pyx_n_s_cfa_ds, __pyx_n_s_nc_ds); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);
  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_unicode, 1531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 1531, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1546
 *         return ''.join(ncdump)
 * 
 *     def _interpret_netCDF_filetype(data):             # <<<<<<<<<<<<<<
 *         """
 *            Pass in the first four bytes from the stream and interpret the magic number.
 */
  __pyx_tuple__171 = PyTuple_Pack(3, __pyx_n_s_data, __pyx_n_s_file_version, __pyx_n_s_file_type); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_interpret_netCDF_filetype, 1546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 1546, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1591
 *         return file_type, file_version
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__173 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);
  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_delncattr, 1591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 1591, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1604
 *             self._nc_dataset.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__175 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);
  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_getncattr, 1604, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 1604, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1616
 *             return self._nc_dataset.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__177 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 1616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);
  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_ncattrs, 1616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 1616, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1625
 *             return self._nc_dataset.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_tuple__179 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);
  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setncattr, 1625, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 1625, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1634
 *             self._nc_dataset.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_tuple__181 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_value); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 1634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setncattr_string, 1634, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(0, 1634, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1643
 *             self._nc_dataset.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_tuple__183 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_attdict, __pyx_n_s_k); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_S3netCDF4__s3netCDF4_pyx, __pyx_n_s_setncatts, 1643, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC init_s3netCDF4(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC init_s3netCDF4(void)
#else
__Pyx_PyMODINIT_FUNC PyInit__s3netCDF4(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit__s3netCDF4(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec__s3netCDF4(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module '_s3netCDF4' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__s3netCDF4(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("_s3netCDF4", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_S3netCDF4___s3netCDF4) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_4, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "S3netCDF4._s3netCDF4")) {
      if (unlikely(PyDict_SetItemString(modules, "S3netCDF4._s3netCDF4", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  (void)__Pyx_modinit_type_init_code();
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "S3netCDF4/_s3netCDF4.pyx":4
 * #cython: language_level=3
 * 
 * __copyright__ = "(C) 2019-2021 Science and Technology Facilities Council"             # <<<<<<<<<<<<<<
 * __license__ = "BSD - see LICENSE file in top-level directory"
 * __authors__ = "Neil Massey"
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyright, __pyx_kp_u_C_2019_2021_Science_and_Technol) < 0) __PYX_ERR(0, 4, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":5
 * 
 * __copyright__ = "(C) 2019-2021 Science and Technology Facilities Council"
 * __license__ = "BSD - see LICENSE file in top-level directory"             # <<<<<<<<<<<<<<
 * __authors__ = "Neil Massey"
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_kp_u_BSD_see_LICENSE_file_in_top_leve) < 0) __PYX_ERR(0, 5, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":6
 * __copyright__ = "(C) 2019-2021 Science and Technology Facilities Council"
 * __license__ = "BSD - see LICENSE file in top-level directory"
 * __authors__ = "Neil Massey"             # <<<<<<<<<<<<<<
 * 
 * """
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_kp_u_Neil_Massey) < 0) __PYX_ERR(0, 6, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":15
 * """
 * 
 * from sys import version_info as sys_version_info             # <<<<<<<<<<<<<<
 * import numpy as np
 * from psutil import virtual_memory
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_version_info);
  __Pyx_GIVEREF(__pyx_n_s_version_info);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_version_info);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __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_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys_version_info, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":16
 * 
 * from sys import version_info as sys_version_info
 * import numpy as np             # <<<<<<<<<<<<<<
 * from psutil import virtual_memory
 * from os import strerror
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":17
 * from sys import version_info as sys_version_info
 * import numpy as np
 * from psutil import virtual_memory             # <<<<<<<<<<<<<<
 * from os import strerror
 * from errno import ENOENT as errno_ENOENT
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_virtual_memory);
  __Pyx_GIVEREF(__pyx_n_s_virtual_memory);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_virtual_memory);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_psutil, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __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_virtual_memory); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_virtual_memory, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":18
 * import numpy as np
 * from psutil import virtual_memory
 * from os import strerror             # <<<<<<<<<<<<<<
 * from errno import ENOENT as errno_ENOENT
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_strerror);
  __Pyx_GIVEREF(__pyx_n_s_strerror);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_strerror);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __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_strerror); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strerror, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":19
 * from psutil import virtual_memory
 * from os import strerror
 * from errno import ENOENT as errno_ENOENT             # <<<<<<<<<<<<<<
 * 
 * # This module Duplicates classes and functions from the standard UniData
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_ENOENT);
  __Pyx_GIVEREF(__pyx_n_s_ENOENT);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ENOENT);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_errno, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __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_ENOENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_errno_ENOENT, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":25
 * # and CFA functionality
 * # import as netCDF4 to avoid confusion with the S3netCDF4 module
 * import netCDF4._netCDF4 as netCDF4             # <<<<<<<<<<<<<<
 * from S3netCDF4._Exceptions import IOException, APIException
 * from S3netCDF4.CFA._CFAClasses import (
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s__22);
  __Pyx_GIVEREF(__pyx_n_s__22);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__22);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_netCDF4__netCDF4, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __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_netCDF4, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":26
 * # import as netCDF4 to avoid confusion with the S3netCDF4 module
 * import netCDF4._netCDF4 as netCDF4
 * from S3netCDF4._Exceptions import IOException, APIException             # <<<<<<<<<<<<<<
 * from S3netCDF4.CFA._CFAClasses import (
 *     CFADataset, CFAGroup, CFAVariable, CFADimension
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_IOException);
  __Pyx_GIVEREF(__pyx_n_s_IOException);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_IOException);
  __Pyx_INCREF(__pyx_n_s_APIException);
  __Pyx_GIVEREF(__pyx_n_s_APIException);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_APIException);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_S3netCDF4__Exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __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_IOException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IOException, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_APIException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_APIException, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":28
 * from S3netCDF4._Exceptions import IOException, APIException
 * from S3netCDF4.CFA._CFAClasses import (
 *     CFADataset, CFAGroup, CFAVariable, CFADimension             # <<<<<<<<<<<<<<
 * )
 * from S3netCDF4.CFA._CFAExceptions import CFAError
 */
  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_CFADataset);
  __Pyx_GIVEREF(__pyx_n_s_CFADataset);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_CFADataset);
  __Pyx_INCREF(__pyx_n_s_CFAGroup);
  __Pyx_GIVEREF(__pyx_n_s_CFAGroup);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CFAGroup);
  __Pyx_INCREF(__pyx_n_s_CFAVariable);
  __Pyx_GIVEREF(__pyx_n_s_CFAVariable);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_CFAVariable);
  __Pyx_INCREF(__pyx_n_s_CFADimension);
  __Pyx_GIVEREF(__pyx_n_s_CFADimension);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_CFADimension);

  /* "S3netCDF4/_s3netCDF4.pyx":27
 * import netCDF4._netCDF4 as netCDF4
 * from S3netCDF4._Exceptions import IOException, APIException
 * from S3netCDF4.CFA._CFAClasses import (             # <<<<<<<<<<<<<<
 *     CFADataset, CFAGroup, CFAVariable, CFADimension
 * )
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_S3netCDF4_CFA__CFAClasses, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __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_CFADataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CFADataset, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CFAGroup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CFAGroup, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CFAVariable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CFAVariable, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CFADimension); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CFADimension, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":30
 *     CFADataset, CFAGroup, CFAVariable, CFADimension
 * )
 * from S3netCDF4.CFA._CFAExceptions import CFAError             # <<<<<<<<<<<<<<
 * from S3netCDF4.CFA.Parsers._CFAnetCDFParser import CFA_netCDFParser
 * from S3netCDF4.Managers._FileManager import FileManager, OpenFileRecord
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_CFAError);
  __Pyx_GIVEREF(__pyx_n_s_CFAError);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_CFAError);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_S3netCDF4_CFA__CFAExceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __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_CFAError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CFAError, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":31
 * )
 * from S3netCDF4.CFA._CFAExceptions import CFAError
 * from S3netCDF4.CFA.Parsers._CFAnetCDFParser import CFA_netCDFParser             # <<<<<<<<<<<<<<
 * from S3netCDF4.Managers._FileManager import FileManager, OpenFileRecord
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_CFA_netCDFParser);
  __Pyx_GIVEREF(__pyx_n_s_CFA_netCDFParser);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_CFA_netCDFParser);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_S3netCDF4_CFA_Parsers__CFAnetCDF, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __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_CFA_netCDFParser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CFA_netCDFParser, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":32
 * from S3netCDF4.CFA._CFAExceptions import CFAError
 * from S3netCDF4.CFA.Parsers._CFAnetCDFParser import CFA_netCDFParser
 * from S3netCDF4.Managers._FileManager import FileManager, OpenFileRecord             # <<<<<<<<<<<<<<
 * 
 * class s3Dimension(object):
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_FileManager);
  __Pyx_GIVEREF(__pyx_n_s_FileManager);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_FileManager);
  __Pyx_INCREF(__pyx_n_s_OpenFileRecord);
  __Pyx_GIVEREF(__pyx_n_s_OpenFileRecord);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_OpenFileRecord);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_S3netCDF4_Managers__FileManager, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __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_FileManager); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FileManager, __pyx_t_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_OpenFileRecord); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OpenFileRecord, __pyx_t_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":34
 * from S3netCDF4.Managers._FileManager import FileManager, OpenFileRecord
 * 
 * class s3Dimension(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Dimension class and override some key member
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__23); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__23, __pyx_n_s_s3Dimension, __pyx_n_s_s3Dimension, (PyObject *) NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_kp_s_Duplicate_the_UniData_netCDF4_D); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "S3netCDF4/_s3netCDF4.pyx":40
 *        files.
 *     """
 *     _private_atts = ["_cfa_dim", "_nc_dim"]             # <<<<<<<<<<<<<<
 *     def __init__(self, cfa_dim=None, nc_dim=None, parent=None):
 *         """Just initialise the dimension.  The variables will be loaded in by
 */
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_u_cfa_dim_2);
  __Pyx_GIVEREF(__pyx_n_u_cfa_dim_2);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_cfa_dim_2);
  __Pyx_INCREF(__pyx_n_u_nc_dim_2);
  __Pyx_GIVEREF(__pyx_n_u_nc_dim_2);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_u_nc_dim_2);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_private_atts, __pyx_t_3) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":41
 *     """
 *     _private_atts = ["_cfa_dim", "_nc_dim"]
 *     def __init__(self, cfa_dim=None, nc_dim=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the dimension.  The variables will be loaded in by
 *         either the createDimension method(s) or the load function called from
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_1__init__, 0, __pyx_n_s_s3Dimension___init, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__26);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":49
 *         self.parent = parent
 * 
 *     def create(self, parent, name, size=None,             # <<<<<<<<<<<<<<
 *                axis_type="U", metadata={}, **kwargs):
 *         """Initialise the dimension.  This adds the CFADimension structure to
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_3create, 0, __pyx_n_s_s3Dimension_create, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 49, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":50
 * 
 *     def create(self, parent, name, size=None,
 *                axis_type="U", metadata={}, **kwargs):             # <<<<<<<<<<<<<<
 *         """Initialise the dimension.  This adds the CFADimension structure to
 *         the dimension as well as initialising the superclass."""
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_3)->__pyx_arg_metadata = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_9S3netCDF4_10_s3netCDF4_2__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_create, __pyx_t_3) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":79
 *         self._nc_dim = nc_object.createDimension(name, size)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the dimension and return the
 *             corresponding attribute from the _nc_dim object."""
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_5__getattr__, 0, __pyx_n_s_s3Dimension___getattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getattr, __pyx_t_3) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":87
 *             return self._nc_dim.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the dimension and set the
 *             corresponding attribute in the _nc_dim object."""
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_7__setattr__, 0, __pyx_n_s_s3Dimension___setattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setattr, __pyx_t_3) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":103
 *             self._nc_dim._grp = value
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._nc_dim.__len__()
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_9__len__, 0, __pyx_n_s_s3Dimension___len, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_len, __pyx_t_3) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":107
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self._nc_dim.__len__()
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_11size, 0, __pyx_n_s_s3Dimension_size, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "S3netCDF4/_s3netCDF4.pyx":106
 *         return self._nc_dim.__len__()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def size(self):
 *         return self._nc_dim.__len__()
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_size, __pyx_t_4) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":110
 *         return self._nc_dim.__len__()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_dim") and self._cfa_dim:
 *             if sys_version_info[0] > 2:
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_13__repr__, 0, __pyx_n_s_s3Dimension___repr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_4) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":119
 *             return self._nc_dim.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_dim = self._cfa_dim
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_11s3Dimension_15__unicode__, 0, __pyx_n_s_s3Dimension___unicode, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_unicode, __pyx_t_4) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":34
 * from S3netCDF4.Managers._FileManager import FileManager, OpenFileRecord
 * 
 * class s3Dimension(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Dimension class and override some key member
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_s3Dimension, __pyx_tuple__23, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_s3Dimension, __pyx_t_4) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":137
 *         return "".join(ncdump)
 * 
 * class s3Variable(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Variable class and override some key member
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__41); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__41, __pyx_n_s_s3Variable, __pyx_n_s_s3Variable, (PyObject *) NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_kp_s_Duplicate_the_UniData_netCDF4_V); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "S3netCDF4/_s3netCDF4.pyx":144
 *     """
 *     # private attributes for just the s3Variable
 *     _private_atts = [             # <<<<<<<<<<<<<<
 *         "_cfa_var", "_cfa_dim", "_nc_var", "_file_manager", "parent", "shape"
 *     ]
 */
  __pyx_t_4 = PyList_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_u_cfa_var_2);
  __Pyx_GIVEREF(__pyx_n_u_cfa_var_2);
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_cfa_var_2);
  __Pyx_INCREF(__pyx_n_u_cfa_dim_2);
  __Pyx_GIVEREF(__pyx_n_u_cfa_dim_2);
  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_cfa_dim_2);
  __Pyx_INCREF(__pyx_n_u_nc_var_2);
  __Pyx_GIVEREF(__pyx_n_u_nc_var_2);
  PyList_SET_ITEM(__pyx_t_4, 2, __pyx_n_u_nc_var_2);
  __Pyx_INCREF(__pyx_n_u_file_manager);
  __Pyx_GIVEREF(__pyx_n_u_file_manager);
  PyList_SET_ITEM(__pyx_t_4, 3, __pyx_n_u_file_manager);
  __Pyx_INCREF(__pyx_n_u_parent);
  __Pyx_GIVEREF(__pyx_n_u_parent);
  PyList_SET_ITEM(__pyx_t_4, 4, __pyx_n_u_parent);
  __Pyx_INCREF(__pyx_n_u_shape);
  __Pyx_GIVEREF(__pyx_n_u_shape);
  PyList_SET_ITEM(__pyx_t_4, 5, __pyx_n_u_shape);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_private_atts, __pyx_t_4) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":148
 *     ]
 * 
 *     def __init__(self, cfa_var=None, cfa_dim=None, nc_var=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the class, any loading of the variables will be done
 *         in the create method."""
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_1__init__, 0, __pyx_n_s_s3Variable___init, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__44);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":157
 * 
 *     @property
 *     def file_manager(self):             # <<<<<<<<<<<<<<
 *         """Return the parent's (or parent's parent's) file manager"""
 *         # assign the file manager
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_3file_manager, 0, __pyx_n_s_s3Variable_file_manager, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "S3netCDF4/_s3netCDF4.pyx":156
 *         self.parent = parent
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def file_manager(self):
 *         """Return the parent's (or parent's parent's) file manager"""
 */
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_file_manager_2, __pyx_t_3) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":167
 *             return None
 * 
 *     def create(self, parent, name, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *             complevel=4, shuffle=True, fletcher32=False, contiguous=False,
 *             chunksizes=None, endian='native', least_significant_digit=None,
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_5create, 0, __pyx_n_s_s3Variable_create, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 167, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":170
 *             complevel=4, shuffle=True, fletcher32=False, contiguous=False,
 *             chunksizes=None, endian='native', least_significant_digit=None,
 *             fill_value=None, chunk_cache=None, subarray_shape=np.array([]),             # <<<<<<<<<<<<<<
 *             max_subarray_size=0, **kwargs):
 *         """Initialise the variable.  This adds the CFAVariable structure to
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_3)->__pyx_arg_subarray_shape = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_9S3netCDF4_10_s3netCDF4_4__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_create, __pyx_t_3) < 0) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":295
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         """Override the shape parameter."""
 *         if hasattr(self, "_cfa_var"):
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_7shape, 0, __pyx_n_s_s3Variable_shape, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "S3netCDF4/_s3netCDF4.pyx":294
 *         )
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def shape(self):
 *         """Override the shape parameter."""
 */
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_shape, __pyx_t_6) < 0) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":303
 * 
 *     @property
 *     def dtype(self):             # <<<<<<<<<<<<<<
 *         """Override the dtype parameter."""
 *         if hasattr(self, "_cfa_var"):
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_9dtype, 0, __pyx_n_s_s3Variable_dtype, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "S3netCDF4/_s3netCDF4.pyx":302
 *             return self._nc_var.shape
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dtype(self):
 *         """Override the dtype parameter."""
 */
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":311
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_var"):
 *             return tuple(self._cfa_var.getDimensions())
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_11dimensions, 0, __pyx_n_s_s3Variable_dimensions, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "S3netCDF4/_s3netCDF4.pyx":310
 *             return self._nc_var.dtype
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dimensions(self):
 *         if hasattr(self, "_cfa_var"):
 */
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_dimensions, __pyx_t_6) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":318
 * 
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Variable so as to return its
 *         private variables."""
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_13__getattr__, 0, __pyx_n_s_s3Variable___getattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getattr, __pyx_t_6) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":333
 *             return self._nc_var.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Variable so as to assign its
 *         private variables."""
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_15__setattr__, 0, __pyx_n_s_s3Variable___setattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setattr, __pyx_t_6) < 0) __PYX_ERR(0, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":348
 *             self._nc_var.__setattr__(name, value)
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_17delncattr, 0, __pyx_n_s_s3Variable_delncattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_delncattr, __pyx_t_6) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":371
 *             self._nc_var.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_19getncattr, 0, __pyx_n_s_s3Variable_getncattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getncattr, __pyx_t_6) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":388
 *             return self._nc_var.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_21ncattrs, 0, __pyx_n_s_s3Variable_ncattrs, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_ncattrs, __pyx_t_6) < 0) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":399
 *             return self._nc_var.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_23setncattr, 0, __pyx_n_s_s3Variable_setncattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setncattr, __pyx_t_6) < 0) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":410
 *             self._nc_var.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_25setncattr_string, 0, __pyx_n_s_s3Variable_setncattr_string, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setncattr_string, __pyx_t_6) < 0) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":421
 *             self._nc_var.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_27setncatts, 0, __pyx_n_s_s3Variable_setncatts, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setncatts, __pyx_t_6) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":436
 *             self._nc_var.setncatts(attdict)
 * 
 *     def __open_subarray_ncfile(self, index, request_object,             # <<<<<<<<<<<<<<
 *                                in_memory=False, mode="r"):
 *         """Open a subarray file, either in memory or on disk"""
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_29__open_subarray_ncfile, 0, __pyx_n_s_s3Variable___open_subarray_ncfil, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__73);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_s3Variable__open_subarray_ncfil, __pyx_t_6) < 0) __PYX_ERR(0, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":482
 *         return nc_sa_dataset
 * 
 *     def __duplicate_subarray_ncfile(self, nc_in_dataset, nc_out_dataset):             # <<<<<<<<<<<<<<
 *         """Copy the contents of one subarray netCDF file into another subarray
 *         netCDF file.
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_31__duplicate_subarray_ncfile, 0, __pyx_n_s_s3Variable___duplicate_subarray, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_s3Variable__duplicate_subarray, __pyx_t_6) < 0) __PYX_ERR(0, 482, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":536
 *         return nc_out_dataset
 * 
 *     def __create_subarray_ncfile(self, index, in_memory=True, mode="w"):             # <<<<<<<<<<<<<<
 *         """Create the subarray file, either in memory or on disk."""
 *         nc_sa_dataset = self.__open_subarray_ncfile(
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_33__create_subarray_ncfile, 0, __pyx_n_s_s3Variable___create_subarray_ncf, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__78);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_s3Variable__create_subarray_ncf, __pyx_t_6) < 0) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":603
 *         return nc_sa_dataset
 * 
 *     def __setitem__(self, elem, data):             # <<<<<<<<<<<<<<
 *         """Override the netCDF4.Variable __setitem__ method to assign data to
 *         the correct subarray file.
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_35__setitem__, 0, __pyx_n_s_s3Variable___setitem, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setitem, __pyx_t_6) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":753
 *             self._nc_var.__setitem__(elem, data)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the netCDF4.Variable __getitem__ method to assign data to
 *         the correct subarray file.
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_37__getitem__, 0, __pyx_n_s_s3Variable___getitem, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_6) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":835
 *             return self._nc_var[elem]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_var") and self._cfa_var:
 *             if sys_version_info[0] > 2:
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_39__repr__, 0, __pyx_n_s_s3Variable___repr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_6) < 0) __PYX_ERR(0, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":845
 * 
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_var = self._cfa_var
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_10s3Variable_41__unicode__, 0, __pyx_n_s_s3Variable___unicode, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_unicode, __pyx_t_6) < 0) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":137
 *         return "".join(ncdump)
 * 
 * class s3Variable(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Variable class and override some key member
 */
  __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_s3Variable, __pyx_tuple__41, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_s3Variable, __pyx_t_6) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":892
 * 
 * # Function below is for s3Group and s3Dataset classes
 * def _group_and_dataset_repr(ncdump, cfa_obj, nc_obj):             # <<<<<<<<<<<<<<
 *     """This is a generalised function to generate a list to be used in the
 *     __repr__ strings for both s3Groups and s3Datasets, as the code is largely
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_1_group_and_dataset_repr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_group_and_dataset_repr, __pyx_t_1) < 0) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":965
 *     return ncdump
 * 
 * class s3Group(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Group class and override some key member
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__89); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__89, __pyx_n_s_s3Group, __pyx_n_s_s3Group, (PyObject *) NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_kp_s_Duplicate_the_UniData_netCDF4_G); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "S3netCDF4/_s3netCDF4.pyx":971
 *        files.
 *     """
 *     _private_atts = ["_nc_grp", "_cfa_grp", "parent",             # <<<<<<<<<<<<<<
 *                      "_s3_variables", "_s3_dimensions"]
 * 
 */
  __pyx_t_6 = PyList_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_n_u_nc_grp);
  __Pyx_GIVEREF(__pyx_n_u_nc_grp);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_u_nc_grp);
  __Pyx_INCREF(__pyx_n_u_cfa_grp);
  __Pyx_GIVEREF(__pyx_n_u_cfa_grp);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_cfa_grp);
  __Pyx_INCREF(__pyx_n_u_parent);
  __Pyx_GIVEREF(__pyx_n_u_parent);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_n_u_parent);
  __Pyx_INCREF(__pyx_n_u_s3_variables);
  __Pyx_GIVEREF(__pyx_n_u_s3_variables);
  PyList_SET_ITEM(__pyx_t_6, 3, __pyx_n_u_s3_variables);
  __Pyx_INCREF(__pyx_n_u_s3_dimensions);
  __Pyx_GIVEREF(__pyx_n_u_s3_dimensions);
  PyList_SET_ITEM(__pyx_t_6, 4, __pyx_n_u_s3_dimensions);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_private_atts, __pyx_t_6) < 0) __PYX_ERR(0, 971, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":974
 *                      "_s3_variables", "_s3_dimensions"]
 * 
 *     def __init__(self, nc_grp=None, cfa_grp=None, parent=None):             # <<<<<<<<<<<<<<
 *         """Just initialise the class, any loading of the variables will be done
 *         by the parser, or the CreateGroup member of s3Dataset."""
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_1__init__, 0, __pyx_n_s_s3Group___init, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__92);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 974, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":983
 *         self._s3_dimensions = {}
 * 
 *     def create(self, parent, name, **kwargs):             # <<<<<<<<<<<<<<
 *         """Initialise the group.  This adds the CFAGroup structure to the
 *         group as well as initialising the composed class."""
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_3create, 0, __pyx_n_s_s3Group_create, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_create, __pyx_t_6) < 0) __PYX_ERR(0, 983, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":996
 *         self.parent = parent
 * 
 *     def createDimension(self, dimname, size=None,             # <<<<<<<<<<<<<<
 *                         axis_type="U", metadata={}):
 *         """Create a dimension in the group.  Add the CFADimension structure to
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_5createDimension, 0, __pyx_n_s_s3Group_createDimension, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 996, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":997
 * 
 *     def createDimension(self, dimname, size=None,
 *                         axis_type="U", metadata={}):             # <<<<<<<<<<<<<<
 *         """Create a dimension in the group.  Add the CFADimension structure to
 *         the group by calling createDimension on self._cfa_grp."""
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_6)->__pyx_arg_metadata = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_9S3netCDF4_10_s3netCDF4_6__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_createDimension, __pyx_t_6) < 0) __PYX_ERR(0, 996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1014
 *         return self._s3_dimensions[dimname]
 * 
 *     def renameDimension(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the dimension by overloading the base method."""
 *         if self._cfa_grp:
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_7renameDimension, 0, __pyx_n_s_s3Group_renameDimension, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_renameDimension, __pyx_t_6) < 0) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1020
 *         self._nc_grp.renameDimension(oldname, newname)
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *                        complevel=4, shuffle=True, fletcher32=False,
 *                        contiguous=False, chunksizes=None, endian='native',
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_9createVariable, 0, __pyx_n_s_s3Group_createVariable, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults3), 1)) __PYX_ERR(0, 1020, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1024
 *                        contiguous=False, chunksizes=None, endian='native',
 *                        least_significant_digit=None, fill_value=None,
 *                        chunk_cache=None, subarray_shape=np.array([]),             # <<<<<<<<<<<<<<
 *                        max_subarray_size=0):
 *         """Create a variable in the Group.  Add the CFAVariable structure to
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_6)->__pyx_arg_subarray_shape = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_9S3netCDF4_10_s3netCDF4_8__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_createVariable, __pyx_t_6) < 0) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1050
 *         return self._s3_variables[varname]
 * 
 *     def renameVariable(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the variable by overloading the base method."""
 *         if self._cfa_grp:
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_11renameVariable, 0, __pyx_n_s_s3Group_renameVariable, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_renameVariable, __pyx_t_6) < 0) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1056
 *         self._nc_grp.renameVariable(oldname, newname)
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_13delncattr, 0, __pyx_n_s_s3Group_delncattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_delncattr, __pyx_t_6) < 0) __PYX_ERR(0, 1056, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1071
 *             self._nc_grp.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_15getncattr, 0, __pyx_n_s_s3Group_getncattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getncattr, __pyx_t_6) < 0) __PYX_ERR(0, 1071, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1083
 *             return self._nc_grp.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_17ncattrs, 0, __pyx_n_s_s3Group_ncattrs, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_ncattrs, __pyx_t_6) < 0) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1092
 *             return self._nc_grp.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_19setncattr, 0, __pyx_n_s_s3Group_setncattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setncattr, __pyx_t_6) < 0) __PYX_ERR(0, 1092, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1101
 *             self._nc_grp.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_21setncattr_string, 0, __pyx_n_s_s3Group_setncattr_string, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setncattr_string, __pyx_t_6) < 0) __PYX_ERR(0, 1101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1110
 *             self._nc_grp.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_23setncatts, 0, __pyx_n_s_s3Group_setncatts, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setncatts, __pyx_t_6) < 0) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1120
 *             self._nc_grp.setncatts(attdict)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_25__getitem__, 0, __pyx_n_s_s3Group___getitem, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_6) < 0) __PYX_ERR(0, 1120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1131
 * 
 *     @property
 *     def variables(self):             # <<<<<<<<<<<<<<
 *         return self._s3_variables
 * 
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_27variables, 0, __pyx_n_s_s3Group_variables, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "S3netCDF4/_s3netCDF4.pyx":1130
 *             )
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def variables(self):
 *         return self._s3_variables
 */
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_variables, __pyx_t_5) < 0) __PYX_ERR(0, 1131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1135
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         return self._s3_dimensions
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_29dimensions, 0, __pyx_n_s_s3Group_dimensions, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "S3netCDF4/_s3netCDF4.pyx":1134
 *         return self._s3_variables
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dimensions(self):
 *         return self._s3_dimensions
 */
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_dimensions, __pyx_t_6) < 0) __PYX_ERR(0, 1135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1138
 *         return self._s3_dimensions
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_grp") and self._cfa_grp:
 *             if sys_version_info[0] > 2:
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_31__repr__, 0, __pyx_n_s_s3Group___repr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_6) < 0) __PYX_ERR(0, 1138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1151
 *                 return self._nc_grp.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         ncdump = ['{}\n'.format(type(self))]
 *         cfa_grp = self._cfa_grp
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_33__unicode__, 0, __pyx_n_s_s3Group___unicode, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_unicode, __pyx_t_6) < 0) __PYX_ERR(0, 1151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1160
 *         return "".join(ncdump)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Group so as to return its
 *         private variables."""
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_35__getattr__, 0, __pyx_n_s_s3Group___getattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getattr, __pyx_t_6) < 0) __PYX_ERR(0, 1160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1173
 * 
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Group so as to assign its
 *         private variables."""
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_7s3Group_37__setattr__, 0, __pyx_n_s_s3Group___setattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setattr, __pyx_t_6) < 0) __PYX_ERR(0, 1173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":965
 *     return ncdump
 * 
 * class s3Group(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Group class and override some key member
 */
  __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_s3Group, __pyx_tuple__89, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_s3Group, __pyx_t_6) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1186
 * 
 * 
 * class s3Dataset(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Dataset class and override some key member
 */
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__129); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__129, __pyx_n_s_s3Dataset, __pyx_n_s_s3Dataset, (PyObject *) NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_kp_s_Duplicate_the_UniData_netCDF4_D_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "S3netCDF4/_s3netCDF4.pyx":1193
 *     """
 * 
 *     _private_atts = ['_managed_object', '_file_manager',             # <<<<<<<<<<<<<<
 *                      '_mode', '_cfa_dataset', '_nc_dataset', '_creation_params',
 *                      '_s3_groups', '_s3_dimensions', '_s3_variables'
 */
  __pyx_t_6 = PyList_New(9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_n_u_managed_object);
  __Pyx_GIVEREF(__pyx_n_u_managed_object);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_u_managed_object);
  __Pyx_INCREF(__pyx_n_u_file_manager);
  __Pyx_GIVEREF(__pyx_n_u_file_manager);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_n_u_file_manager);
  __Pyx_INCREF(__pyx_n_u_mode_2);
  __Pyx_GIVEREF(__pyx_n_u_mode_2);
  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_n_u_mode_2);
  __Pyx_INCREF(__pyx_n_u_cfa_dataset);
  __Pyx_GIVEREF(__pyx_n_u_cfa_dataset);
  PyList_SET_ITEM(__pyx_t_6, 3, __pyx_n_u_cfa_dataset);
  __Pyx_INCREF(__pyx_n_u_nc_dataset);
  __Pyx_GIVEREF(__pyx_n_u_nc_dataset);
  PyList_SET_ITEM(__pyx_t_6, 4, __pyx_n_u_nc_dataset);
  __Pyx_INCREF(__pyx_n_u_creation_params);
  __Pyx_GIVEREF(__pyx_n_u_creation_params);
  PyList_SET_ITEM(__pyx_t_6, 5, __pyx_n_u_creation_params);
  __Pyx_INCREF(__pyx_n_u_s3_groups);
  __Pyx_GIVEREF(__pyx_n_u_s3_groups);
  PyList_SET_ITEM(__pyx_t_6, 6, __pyx_n_u_s3_groups);
  __Pyx_INCREF(__pyx_n_u_s3_dimensions);
  __Pyx_GIVEREF(__pyx_n_u_s3_dimensions);
  PyList_SET_ITEM(__pyx_t_6, 7, __pyx_n_u_s3_dimensions);
  __Pyx_INCREF(__pyx_n_u_s3_variables);
  __Pyx_GIVEREF(__pyx_n_u_s3_variables);
  PyList_SET_ITEM(__pyx_t_6, 8, __pyx_n_u_s3_variables);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_private_atts, __pyx_t_6) < 0) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1199
 * 
 *     @property
 *     def file_object(self):             # <<<<<<<<<<<<<<
 *         return self._managed_object.file_object
 * 
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_1file_object, 0, __pyx_n_s_s3Dataset_file_object, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "S3netCDF4/_s3netCDF4.pyx":1198
 *                     ]
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def file_object(self):
 *         return self._managed_object.file_object
 */
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_file_object, __pyx_t_5) < 0) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1202
 *         return self._managed_object.file_object
 * 
 *     def __init__(self, filename, mode='r', clobber=True, format='DEFAULT',             # <<<<<<<<<<<<<<
 *                  diskless=False, persist=False, keepweakref=False, memory=None,
 *                  cfa_version="0.5", **kwargs):
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_3__init__, 0, __pyx_n_s_s3Dataset___init, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__134);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1349
 *             raise APIException("Mode " + mode + " not supported.")
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         """Allow with s3Dataset statements."""
 *         return self
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_5__enter__, 0, __pyx_n_s_s3Dataset___enter, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_enter, __pyx_t_5) < 0) __PYX_ERR(0, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1353
 *         return self
 * 
 *     def __exit__(self, atype, value, traceback):             # <<<<<<<<<<<<<<
 *         """Close on exit"""
 *         self.close()
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_7__exit__, 0, __pyx_n_s_s3Dataset___exit, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_exit, __pyx_t_5) < 0) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1357
 *         self.close()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """Close the Dataset."""
 *         # write the metadata to (all) the file(s)
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_9close, 0, __pyx_n_s_s3Dataset_close, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_close, __pyx_t_5) < 0) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1373
 *         self._file_manager.free_all_arrays()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         """Close the dataset when no references are left to the S3Dataset"""
 *         self.close()
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_11__dealloc__, 0, __pyx_n_s_s3Dataset___dealloc, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_dealloc, __pyx_t_5) < 0) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1377
 *         self.close()
 * 
 *     def createDimension(self, dimname, size=None,             # <<<<<<<<<<<<<<
 *                         axis_type="U", metadata={}):
 *         """Create a dimension in the Dataset.  This just calls createDimension
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_13createDimension, 0, __pyx_n_s_s3Dataset_createDimension, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults4), 1)) __PYX_ERR(0, 1377, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1378
 * 
 *     def createDimension(self, dimname, size=None,
 *                         axis_type="U", metadata={}):             # <<<<<<<<<<<<<<
 *         """Create a dimension in the Dataset.  This just calls createDimension
 *         on the root group"""
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_5)->__pyx_arg_metadata = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_9S3netCDF4_10_s3netCDF4_10__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_createDimension, __pyx_t_5) < 0) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1391
 *         return self._s3_dimensions[dimname]
 * 
 *     def renameDimension(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the dimension by overloading the base method."""
 *         if not oldname in self.dimensions:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_15renameDimension, 0, __pyx_n_s_s3Dataset_renameDimension, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_renameDimension, __pyx_t_5) < 0) __PYX_ERR(0, 1391, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1403
 *         self._nc_dataset.renameDimension(oldname, newname)
 * 
 *     def createVariable(self, varname, datatype, dimensions=(), zlib=False,             # <<<<<<<<<<<<<<
 *                        complevel=4, shuffle=True, fletcher32=False,
 *                        contiguous=False, chunksizes=None, endian='native',
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_17createVariable, 0, __pyx_n_s_s3Dataset_createVariable, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults5), 1)) __PYX_ERR(0, 1403, __pyx_L1_error)

  /* "S3netCDF4/_s3netCDF4.pyx":1407
 *                        contiguous=False, chunksizes=None, endian='native',
 *                        least_significant_digit=None, fill_value=None,
 *                        chunk_cache=None, subarray_shape=np.array([]),             # <<<<<<<<<<<<<<
 *                        max_subarray_size=0):
 *         """Create a variable in the Dataset.  Add the CFAVariable structure to
 */
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_5)->__pyx_arg_subarray_shape = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_9S3netCDF4_10_s3netCDF4_12__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_createVariable, __pyx_t_5) < 0) __PYX_ERR(0, 1403, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1433
 *         return self._s3_variables[varname]
 * 
 *     def renameVariable(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename the variable by overloading the base method."""
 *         # get the cfa root group
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_19renameVariable, 0, __pyx_n_s_s3Dataset_renameVariable, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_renameVariable, __pyx_t_5) < 0) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1441
 *         self._nc_dataset.renameVariable(oldname, newname)
 * 
 *     def createGroup(self, groupname):             # <<<<<<<<<<<<<<
 *         """Create a group.  If this file is a CFA file then create the CFAGroup
 *         as well."""
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_21createGroup, 0, __pyx_n_s_s3Dataset_createGroup, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_createGroup, __pyx_t_5) < 0) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1448
 *         return self._s3_groups[groupname]
 * 
 *     def renameGroup(self, oldname, newname):             # <<<<<<<<<<<<<<
 *         """Rename a group.  If this file is a CFA file then rename the CFAGroup
 *         as well."""
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_23renameGroup, 0, __pyx_n_s_s3Dataset_renameGroup, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_renameGroup, __pyx_t_5) < 0) __PYX_ERR(0, 1448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1455
 *         self._nc_dataset.renameGroup(oldname, newname)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         """Override the __getattr__ for the Dataset so as to return its
 *         private variables."""
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_25__getattr__, 0, __pyx_n_s_s3Dataset___getattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getattr, __pyx_t_5) < 0) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1471
 *             return self._nc_dataset.__getattr__(name)
 * 
 *     def __setattr__(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override the __setattr__ for the Dataset so as to assign its
 *         private variables."""
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_27__setattr__, 0, __pyx_n_s_s3Dataset___setattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setattr, __pyx_t_5) < 0) __PYX_ERR(0, 1471, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1483
 *             self._nc_dataset.__setattr__(name, value)
 * 
 *     def __getitem__(self, elem):             # <<<<<<<<<<<<<<
 *         """Override the __getitem__ for the Dataset to return the group or
 *         variable with the name of elem"""
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_29__getitem__, 0, __pyx_n_s_s3Dataset___getitem, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_5) < 0) __PYX_ERR(0, 1483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1496
 * 
 *     @property
 *     def groups(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the groups, and this is a cfa dataset then build
 *         # and return the dictionary of s3_groups
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_31groups, 0, __pyx_n_s_s3Dataset_groups, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "S3netCDF4/_s3netCDF4.pyx":1495
 *             )
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def groups(self):
 *         # if we are requesting the groups, and this is a cfa dataset then build
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_groups, __pyx_t_4) < 0) __PYX_ERR(0, 1496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1505
 * 
 *     @property
 *     def variables(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the variables, and this is a cfa dataset then
 *         # build and return the dictionary of s3_variables
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_33variables, 0, __pyx_n_s_s3Dataset_variables, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "S3netCDF4/_s3netCDF4.pyx":1504
 *             return self._nc_dataset.groups
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def variables(self):
 *         # if we are requesting the variables, and this is a cfa dataset then
 */
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_variables, __pyx_t_5) < 0) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1514
 * 
 *     @property
 *     def dimensions(self):             # <<<<<<<<<<<<<<
 *         # if we are requesting the dimensions, and this is a cfa dataset then
 *         # build and return the dictionary of s3_dimensions
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_35dimensions, 0, __pyx_n_s_s3Dataset_dimensions, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "S3netCDF4/_s3netCDF4.pyx":1513
 *             return self._nc_dataset.variables
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dimensions(self):
 *         # if we are requesting the dimensions, and this is a cfa dataset then
 */
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_dimensions, __pyx_t_4) < 0) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1522
 *             return self._nc_dataset.dimensions
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if hasattr(self, "_cfa_dataset") and self._cfa_dataset:
 *             if sys_version_info[0] > 2:
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_37__repr__, 0, __pyx_n_s_s3Dataset___repr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_4) < 0) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1531
 *             return self._nc_dataset.__repr__()
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<<
 *         # This function is only applicable to S3Datasets with _cfa_dataset
 *         # defined.  Therefore we can use the _cfa_dataset information
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_39__unicode__, 0, __pyx_n_s_s3Dataset___unicode, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_unicode, __pyx_t_4) < 0) __PYX_ERR(0, 1531, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1546
 *         return ''.join(ncdump)
 * 
 *     def _interpret_netCDF_filetype(data):             # <<<<<<<<<<<<<<
 *         """
 *            Pass in the first four bytes from the stream and interpret the magic number.
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_41_interpret_netCDF_filetype, 0, __pyx_n_s_s3Dataset__interpret_netCDF_file, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_interpret_netCDF_filetype, __pyx_t_4) < 0) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1591
 *         return file_type, file_version
 * 
 *     def delncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override delncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_43delncattr, 0, __pyx_n_s_s3Dataset_delncattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_delncattr, __pyx_t_4) < 0) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1604
 *             self._nc_dataset.delncattr(name)
 * 
 *     def getncattr(self, name):             # <<<<<<<<<<<<<<
 *         """Override getncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_45getncattr, 0, __pyx_n_s_s3Dataset_getncattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getncattr, __pyx_t_4) < 0) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1616
 *             return self._nc_dataset.getncattr(name)
 * 
 *     def ncattrs(self):             # <<<<<<<<<<<<<<
 *         """Override ncattrs function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_47ncattrs, 0, __pyx_n_s_s3Dataset_ncattrs, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_ncattrs, __pyx_t_4) < 0) __PYX_ERR(0, 1616, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1625
 *             return self._nc_dataset.ncattrs()
 * 
 *     def setncattr(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr function to manipulate the metadata dictionary,
 *         rather than the netCDF file.  The attributes are copied from the
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_49setncattr, 0, __pyx_n_s_s3Dataset_setncattr, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setncattr, __pyx_t_4) < 0) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1634
 *             self._nc_dataset.setncattr(name, value)
 * 
 *     def setncattr_string(self, name, value):             # <<<<<<<<<<<<<<
 *         """Override setncattr_string function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_51setncattr_string, 0, __pyx_n_s_s3Dataset_setncattr_string, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setncattr_string, __pyx_t_4) < 0) __PYX_ERR(0, 1634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1643
 *             self._nc_dataset.setncattr_string(name, value)
 * 
 *     def setncatts(self, attdict):             # <<<<<<<<<<<<<<
 *         """Override setncattrs function to manipulate the metadata
 *         dictionary, rather than the netCDF file.  The attributes are copied from
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9S3netCDF4_10_s3netCDF4_9s3Dataset_53setncatts, 0, __pyx_n_s_s3Dataset_setncatts, NULL, __pyx_n_s_S3netCDF4__s3netCDF4, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setncatts, __pyx_t_4) < 0) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1186
 * 
 * 
 * class s3Dataset(object):             # <<<<<<<<<<<<<<
 *     """
 *        Duplicate the UniData netCDF4 Dataset class and override some key member
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_s3Dataset, __pyx_tuple__129, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_s3Dataset, __pyx_t_4) < 0) __PYX_ERR(0, 1186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "S3netCDF4/_s3netCDF4.pyx":1
 * #!python             # <<<<<<<<<<<<<<
 * #cython: language_level=3
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init S3netCDF4._s3netCDF4", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init S3netCDF4._s3netCDF4");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

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

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
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);
}
#endif

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (__Pyx_PyFastCFunction_Check(func)) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

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

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = Py_TYPE(iter)->tp_iternext;
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        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;
}

/* SliceObject */
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_ass_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_ass_slice(obj, cstart, cstop, value);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_ass_subscript))
#endif
    {
        int result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        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;
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #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
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        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;
#ifdef HAVE_LONG_LONG
                    } 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;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } 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;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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;
#ifdef HAVE_LONG_LONG
                    } 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;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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;
#ifdef HAVE_LONG_LONG
                    } 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;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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;
#ifdef HAVE_LONG_LONG
                    } 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;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                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;
#ifdef HAVE_LONG_LONG
                    } 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;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #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

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* append */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* SetItemInt */
static 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_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
#else
    if (is_list || PySequence_Check(o))
#endif
    {
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* MergeKeywords */
static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
    PyObject *iter, *key = NULL, *value = NULL;
    int source_is_dict, result;
    Py_ssize_t orig_length, ppos = 0;
    iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_n_s_items, &orig_length, &source_is_dict);
    if (unlikely(!iter)) {
        PyObject *args;
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        args = PyTuple_Pack(1, source_mapping);
        if (likely(args)) {
            PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL);
            Py_DECREF(args);
            if (likely(fallback)) {
                iter = __Pyx_dict_iterator(fallback, 1, __pyx_n_s_items, &orig_length, &source_is_dict);
                Py_DECREF(fallback);
            }
        }
        if (unlikely(!iter)) goto bad;
    }
    while (1) {
        result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict);
        if (unlikely(result < 0)) goto bad;
        if (!result) break;
        if (unlikely(PyDict_Contains(kwdict, key))) {
            __Pyx_RaiseDoubleKeywordsError("function", key);
            result = -1;
        } else {
            result = PyDict_SetItem(kwdict, key, value);
        }
        Py_DECREF(key);
        Py_DECREF(value);
        if (unlikely(result < 0)) goto bad;
    }
    Py_XDECREF(iter);
    return 0;
bad:
    Py_XDECREF(iter);
    return -1;
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long 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
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) 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));
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunctionShared */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    if (unlikely(op == NULL))
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
#if PY_MAJOR_VERSION < 3
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
#endif
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
