/* Generated by Cython 0.29.27 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "src/viur/datastore/simdjson.h"
        ],
        "extra_compile_args": [
            "-std=c++11"
        ],
        "include_dirs": [
            "src/viur/datastore"
        ],
        "language": "c++",
        "name": "viur.datastore.transport",
        "sources": [
            "src/viur/datastore/transport.pyx",
            "src/viur/datastore/simdjson.cpp"
        ]
    },
    "module_name": "viur.datastore.transport"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_27"
#define CYTHON_HEX_VERSION 0x001D1BF0
#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 || PY_VERSION_HEX >= 0x030B00A2
    #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 (PY_VERSION_HEX < 0x030B00A1)
  #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
  #if PY_MAJOR_VERSION < 3
    #include "longintrepr.h"
  #endif
  #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 __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #else
    #define CYTHON_INLINE inline
  #endif
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    T *operator&() { return ptr; }
    operator T&() { return *ptr; }
    template<typename U> bool operator ==(U other) { return *ptr == other; }
    template<typename U> bool operator !=(U other) { return *ptr != other; }
  private:
    T *ptr;
};

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if PY_VERSION_HEX >= 0x030B00A1
    static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
        PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
        PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
        const char *fn_cstr=NULL;
        const char *name_cstr=NULL;
        PyCodeObject* co=NULL;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        if (!(kwds=PyDict_New())) goto end;
        if (!(argcount=PyLong_FromLong(a))) goto end;
        if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
        if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
        if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
        if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
        if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
        if (!(nlocals=PyLong_FromLong(l))) goto end;
        if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
        if (!(stacksize=PyLong_FromLong(s))) goto end;
        if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
        if (!(flags=PyLong_FromLong(f))) goto end;
        if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
        if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
        if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
        if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
        if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
        if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
        if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
        Py_XDECREF((PyObject*)co);
        co = (PyCodeObject*)call_result;
        call_result = NULL;
        if (0) {
            cleanup_code_too:
            Py_XDECREF((PyObject*)co);
            co = NULL;
        }
        end:
        Py_XDECREF(kwds);
        Py_XDECREF(argcount);
        Py_XDECREF(posonlyargcount);
        Py_XDECREF(kwonlyargcount);
        Py_XDECREF(nlocals);
        Py_XDECREF(stacksize);
        Py_XDECREF(replace);
        Py_XDECREF(call_result);
        Py_XDECREF(empty);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return co;
    }
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if defined(PyUnicode_IS_READY)
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #else
  #define __Pyx_PyUnicode_READY(op)       (0)
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  #endif
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_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__viur__datastore__transport
#define __PYX_HAVE_API__viur__datastore__transport
/* Early includes */
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "string_view"
#include "simdjson.h"
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#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);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#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[] = {
  "src/viur/datastore/transport.pyx",
  "type.pxd",
};

/*--- Type declarations ---*/
struct __pyx_opt_args_4viur_9datastore_9transport_toEntityStructure;

/* "viur/datastore/transport.pyx":278
 * 	return key
 * 
 * cdef inline object toEntityStructure(simdjsonElement v, boolean_type isInitial = False):             # <<<<<<<<<<<<<<
 * 	"""
 * 		Parses a simdJsonElement into the corresponding python datatypes.
 */
struct __pyx_opt_args_4viur_9datastore_9transport_toEntityStructure {
  int __pyx_n;
  bool isInitial;
};

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

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

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

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

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

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

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

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#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

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

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

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

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

/* 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
#if CYTHON_FAST_PYCALL
  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 // CYTHON_FAST_PYCALL
#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);

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

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

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

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

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

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

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

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

/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);

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

/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

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

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

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

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

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

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

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

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

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

/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject* none = _PyList_Extend((PyListObject*)L, v);
    if (unlikely(!none))
        return -1;
    Py_DECREF(none);
    return 0;
#else
    return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
#endif
}

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

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

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

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

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

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

/* py_dict_pop.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value);

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

/* SliceTupleAndList.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
#else
#define __Pyx_PyList_GetSlice(seq, start, stop)   PySequence_GetSlice(seq, start, stop)
#define __Pyx_PyTuple_GetSlice(seq, start, stop)  PySequence_GetSlice(seq, start, stop)
#endif

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

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

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

/* CppExceptionConversion.proto */
#ifndef __Pyx_CppExn2PyErr
#include <new>
#include <typeinfo>
#include <stdexcept>
#include <ios>
static void __Pyx_CppExn2PyErr() {
  try {
    if (PyErr_Occurred())
      ; // let the latest Python exn pass through and ignore the current one
    else
      throw;
  } catch (const std::bad_alloc& exn) {
    PyErr_SetString(PyExc_MemoryError, exn.what());
  } catch (const std::bad_cast& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::bad_typeid& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::domain_error& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::invalid_argument& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::ios_base::failure& exn) {
    PyErr_SetString(PyExc_IOError, exn.what());
  } catch (const std::out_of_range& exn) {
    PyErr_SetString(PyExc_IndexError, exn.what());
  } catch (const std::overflow_error& exn) {
    PyErr_SetString(PyExc_OverflowError, exn.what());
  } catch (const std::range_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::underflow_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::exception& exn) {
    PyErr_SetString(PyExc_RuntimeError, exn.what());
  }
  catch (...)
  {
    PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  }
}
#endif

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value);

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

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

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

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


/* Module declarations from 'libcpp' */

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

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

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

/* Module declarations from '__builtin__' */

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

/* Module declarations from 'cpython' */

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

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

/* Module declarations from 'viur.datastore.transport' */
static CYTHON_INLINE PyObject *__pyx_f_4viur_9datastore_9transport_toPyStr(std::string_view); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_4viur_9datastore_9transport_parseKey(simdjson::dom::element); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_4viur_9datastore_9transport_toEntityStructure(simdjson::dom::element, struct __pyx_opt_args_4viur_9datastore_9transport_toEntityStructure *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_4viur_9datastore_9transport_toPythonStructure(simdjson::dom::element); /*proto*/
#define __Pyx_MODULE_NAME "viur.datastore.transport"
extern int __pyx_module_is_main_viur__datastore__transport;
int __pyx_module_is_main_viur__datastore__transport = 0;

/* Implementation of 'viur.datastore.transport' */
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_print;
static const char __pyx_k_[] = " (";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_v[] = "v";
static const char __pyx_k_x[] = "x";
static const char __pyx_k__3[] = ".";
static const char __pyx_k__5[] = " ";
static const char __pyx_k__6[] = "=";
static const char __pyx_k__7[] = "<";
static const char __pyx_k__8[] = "<=";
static const char __pyx_k__9[] = ">";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_op[] = "op";
static const char __pyx_k_AND[] = "AND";
static const char __pyx_k_Any[] = "Any";
static const char __pyx_k_Get[] = "Get";
static const char __pyx_k_Key[] = "Key";
static const char __pyx_k_Put[] = "Put";
static const char __pyx_k__10[] = ">=";
static const char __pyx_k__37[] = "_";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_idx[] = "idx";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_req[] = "req";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_set[] = "set";
static const char __pyx_k_url[] = "url";
static const char __pyx_k_utc[] = "utc";
static const char __pyx_k_List[] = "List";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_auth[] = "auth";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_json[] = "json";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_kind[] = "kind";
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_path[] = "path";
static const char __pyx_k_post[] = "post";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_ASCII[] = "ASCII";
static const char __pyx_k_EQUAL[] = "EQUAL";
static const char __pyx_k_UTF_8[] = "UTF-8";
static const char __pyx_k_Union[] = "Union";
static const char __pyx_k_debug[] = "debug";
static const char __pyx_k_dumps[] = "dumps";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_limit[] = "limit";
static const char __pyx_k_loads[] = "loads";
static const char __pyx_k_order[] = "order";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_query[] = "query";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_Delete[] = "Delete";
static const char __pyx_k_Entity[] = "Entity";
static const char __pyx_k_STRONG[] = "STRONG";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_base64[] = "base64";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_delete[] = "delete";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_extend[] = "extend";
static const char __pyx_k_filter[] = "filter";
static const char __pyx_k_google[] = "google";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_oldTxn[] = "oldTxn";
static const char __pyx_k_orders[] = "orders";
static const char __pyx_k_parent[] = "parent";
static const char __pyx_k_parser[] = "parser";
static const char __pyx_k_pprint[] = "pprint";
static const char __pyx_k_pysize[] = "pysize";
static const char __pyx_k_scopes[] = "scopes";
static const char __pyx_k_txnKey[] = "txnKey";
static const char __pyx_k_typing[] = "typing";
static const char __pyx_k_tzinfo[] = "tzinfo";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_upsert[] = "upsert";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_arrayIt[] = "arrayIt";
static const char __pyx_k_content[] = "content";
static const char __pyx_k_default[] = "default";
static const char __pyx_k_dictKey[] = "dictKey";
static const char __pyx_k_element[] = "element";
static const char __pyx_k_filters[] = "filters";
static const char __pyx_k_isMulti[] = "isMulti";
static const char __pyx_k_keyList[] = "keyList";
static const char __pyx_k_logging[] = "logging";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_resDict[] = "resDict";
static const char __pyx_k_resList[] = "resList";
static const char __pyx_k_version[] = "version";
static const char __pyx_k_warning[] = "warning";
static const char __pyx_k_callback[] = "callback";
static const char __pyx_k_data_ptr[] = "data_ptr";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_distinct[] = "distinct";
static const char __pyx_k_entities[] = "entities";
static const char __pyx_k_keyValue[] = "keyValue";
static const char __pyx_k_postData[] = "postData";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_requests[] = "requests";
static const char __pyx_k_strftime[] = "strftime";
static const char __pyx_k_strptime[] = "strptime";
static const char __pyx_k_timezone[] = "timezone";
static const char __pyx_k_ASCENDING[] = "ASCENDING";
static const char __pyx_k_Collision[] = "Collision";
static const char __pyx_k_LESS_THAN[] = "LESS_THAN";
static const char __pyx_k_arrayElem[] = "arrayElem";
static const char __pyx_k_b64decode[] = "b64decode";
static const char __pyx_k_b64encode[] = "b64encode";
static const char __pyx_k_blobValue[] = "blobValue";
static const char __pyx_k_dictValue[] = "dictValue";
static const char __pyx_k_direction[] = "direction";
static const char __pyx_k_endCursor[] = "endCursor";
static const char __pyx_k_keyToPath[] = "keyToPath";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_mutations[] = "mutations";
static const char __pyx_k_nullValue[] = "nullValue";
static const char __pyx_k_projectID[] = "projectID";
static const char __pyx_k_readWrite[] = "readWrite";
static const char __pyx_k_sortOrder[] = "sortOrder";
static const char __pyx_k_transport[] = "transport";
static const char __pyx_k_DESCENDING[] = "DESCENDING";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_arrayValue[] = "arrayValue";
static const char __pyx_k_astimezone[] = "astimezone";
static const char __pyx_k_currentTxn[] = "currentTxn";
static const char __pyx_k_distinctOn[] = "distinctOn";
static const char __pyx_k_filterList[] = "filterList";
static const char __pyx_k_project_id[] = "project_id";
static const char __pyx_k_properties[] = "properties";
static const char __pyx_k_txnOptions[] = "txnOptions";
static const char __pyx_k_AllocateIDs[] = "AllocateIDs";
static const char __pyx_k_credentials[] = "credentials";
static const char __pyx_k_distinctKey[] = "distinctKey";
static const char __pyx_k_doubleValue[] = "doubleValue";
static const char __pyx_k_entityValue[] = "entityValue";
static const char __pyx_k_flipResults[] = "flipResults";
static const char __pyx_k_google_auth[] = "google.auth";
static const char __pyx_k_partitionId[] = "partitionId";
static const char __pyx_k_readOptions[] = "readOptions";
static const char __pyx_k_rollbackTxn[] = "_rollbackTxn";
static const char __pyx_k_singleValue[] = "singleValue";
static const char __pyx_k_startCursor[] = "startCursor";
static const char __pyx_k_status_code[] = "status_code";
static const char __pyx_k_stringValue[] = "stringValue";
static const char __pyx_k_transaction[] = "transaction";
static const char __pyx_k_GREATER_THAN[] = "GREATER_THAN";
static const char __pyx_k_Invalid_op_s[] = "Invalid op %s";
static const char __pyx_k_NOT_FINISHED[] = "NOT_FINISHED";
static const char __pyx_k_Unknown_type[] = "Unknown type";
static const char __pyx_k_Y_m_dT_H_M_S[] = "%Y-%m-%dT%H:%M:%S";
static const char __pyx_k_booleanValue[] = "booleanValue";
static const char __pyx_k_integerValue[] = "integerValue";
static const char __pyx_k_TRANSACTIONAL[] = "TRANSACTIONAL";
static const char __pyx_k_currentCursor[] = "currentCursor";
static const char __pyx_k_http_internal[] = "_http_internal";
static const char __pyx_k_requestedKeys[] = "requestedKeys";
static const char __pyx_k_RecursionError[] = "RecursionError";
static const char __pyx_k_Y_m_dT_H_M_S_f[] = "%Y-%m-%dT%H:%M:%S.%f";
static const char __pyx_k_affectedEntity[] = "affectedEntity";
static const char __pyx_k_innerArrayElem[] = "innerArrayElem";
static const char __pyx_k_propertyFilter[] = "propertyFilter";
static const char __pyx_k_timestampValue[] = "timestampValue";
static const char __pyx_k_ConnectionError[] = "ConnectionError";
static const char __pyx_k_QueryDefinition[] = "QueryDefinition";
static const char __pyx_k_Y_m_dT_H_M_S_fZ[] = "%Y-%m-%dT%H:%M:%S.%fZ";
static const char __pyx_k_allowOverriding[] = "__allowOverriding__";
static const char __pyx_k_compositeFilter[] = "compositeFilter";
static const char __pyx_k_queryDefinition[] = "queryDefinition";
static const char __pyx_k_readConsistency[] = "readConsistency";
static const char __pyx_k_refresh_timeout[] = "refresh_timeout";
static const char __pyx_k_runSingleFilter[] = "runSingleFilter";
static const char __pyx_k_RunInTransaction[] = "RunInTransaction";
static const char __pyx_k_affectedEntities[] = "affectedEntities";
static const char __pyx_k_is_not_supported[] = ") is not supported";
static const char __pyx_k_pythonPropToJson[] = "pythonPropToJson";
static const char __pyx_k_AuthorizedSession[] = "AuthorizedSession";
static const char __pyx_k_NON_TRANSACTIONAL[] = "NON_TRANSACTIONAL";
static const char __pyx_k_allowOverriding_2[] = "allowOverriding";
static const char __pyx_k_LESS_THAN_OR_EQUAL[] = "LESS_THAN_OR_EQUAL";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_currentTransaction[] = "currentTransaction";
static const char __pyx_k_excludeFromIndexes[] = "excludeFromIndexes";
static const char __pyx_k_excludedProperties[] = "excludedProperties";
static const char __pyx_k_transactionOptions[] = "transactionOptions";
static const char __pyx_k_internalStartCursor[] = "internalStartCursor";
static const char __pyx_k_previousTransaction[] = "previousTransaction";
static const char __pyx_k_requests_exceptions[] = "requests.exceptions";
static const char __pyx_k_authenticatedRequest[] = "authenticatedRequest";
static const char __pyx_k_exclude_from_indexes[] = "exclude_from_indexes";
static const char __pyx_k_viur_datastore_types[] = "viur.datastore.types";
static const char __pyx_k_GREATER_THAN_OR_EQUAL[] = "GREATER_THAN_OR_EQUAL";
static const char __pyx_k_RequestsConnectionError[] = "RequestsConnectionError";
static const char __pyx_k_viur_datastore_transport[] = "viur.datastore.transport";
static const char __pyx_k_INVALID_RESPONSE_RECEIVED[] = "INVALID RESPONSE RECEIVED";
static const char __pyx_k_INVALID_STATUS_CODE_RECEIVED[] = "INVALID STATUS CODE RECEIVED";
static const char __pyx_k_Invalid_key_in_entity_json_s[] = "Invalid key in entity json: %s";
static const char __pyx_k_No_mutation_results_received[] = "No mutation-results received";
static const char __pyx_k_Transaction_collision_retrying[] = "Transaction collision, retrying...";
static const char __pyx_k_Cannot_call_runInTransaction_whi[] = "Cannot call runInTransaction while inside a transaction!";
static const char __pyx_k_Empty_response_received_from_Dat[] = "Empty response received from Datastore API";
static const char __pyx_k_Invalid_data_received_from_Datas[] = "Invalid data received from Datastore API";
static const char __pyx_k_Invalid_number_of_mutation_resul[] = "Invalid number of mutation-results received";
static const char __pyx_k_Invalid_status_code_received_fro[] = "Invalid status code received from Datastore API";
static const char __pyx_k_Received_an_unexpected_key_updat[] = "Received an unexpected key-update";
static const char __pyx_k_Retrying_http_post_request_to_da[] = "Retrying http post request to datastore";
static const char __pyx_k_https_datastore_googleapis_com_v[] = "https://datastore.googleapis.com/v1/projects/%s:runQuery";
static const char __pyx_k_https_www_googleapis_com_auth_da[] = "https://www.googleapis.com/auth/datastore";
static const char __pyx_k_src_viur_datastore_transport_pyx[] = "src/viur/datastore/transport.pyx";
static const char __pyx_k_https_datastore_googleapis_com_v_2[] = "https://datastore.googleapis.com/v1/projects/%s:lookup";
static const char __pyx_k_https_datastore_googleapis_com_v_3[] = "https://datastore.googleapis.com/v1/projects/%s:commit";
static const char __pyx_k_https_datastore_googleapis_com_v_4[] = "https://datastore.googleapis.com/v1/projects/%s:beginTransaction";
static const char __pyx_k_https_datastore_googleapis_com_v_5[] = "https://datastore.googleapis.com/v1/projects/%s:rollback";
static const char __pyx_k_https_datastore_googleapis_com_v_6[] = "https://datastore.googleapis.com/v1/projects/%s:allocateIds";
static PyObject *__pyx_kp_u_;
static PyObject *__pyx_n_u_AND;
static PyObject *__pyx_n_u_ASCENDING;
static PyObject *__pyx_n_u_ASCII;
static PyObject *__pyx_n_s_AllocateIDs;
static PyObject *__pyx_n_s_Any;
static PyObject *__pyx_n_s_AuthorizedSession;
static PyObject *__pyx_kp_u_Cannot_call_runInTransaction_whi;
static PyObject *__pyx_n_s_Collision;
static PyObject *__pyx_n_s_ConnectionError;
static PyObject *__pyx_n_u_DESCENDING;
static PyObject *__pyx_n_s_Delete;
static PyObject *__pyx_n_u_EQUAL;
static PyObject *__pyx_kp_u_Empty_response_received_from_Dat;
static PyObject *__pyx_n_s_Entity;
static PyObject *__pyx_n_u_GREATER_THAN;
static PyObject *__pyx_n_u_GREATER_THAN_OR_EQUAL;
static PyObject *__pyx_n_s_Get;
static PyObject *__pyx_kp_u_INVALID_RESPONSE_RECEIVED;
static PyObject *__pyx_kp_u_INVALID_STATUS_CODE_RECEIVED;
static PyObject *__pyx_kp_u_Invalid_data_received_from_Datas;
static PyObject *__pyx_kp_u_Invalid_key_in_entity_json_s;
static PyObject *__pyx_kp_u_Invalid_number_of_mutation_resul;
static PyObject *__pyx_kp_u_Invalid_op_s;
static PyObject *__pyx_kp_u_Invalid_status_code_received_fro;
static PyObject *__pyx_n_s_Key;
static PyObject *__pyx_n_u_LESS_THAN;
static PyObject *__pyx_n_u_LESS_THAN_OR_EQUAL;
static PyObject *__pyx_n_s_List;
static PyObject *__pyx_n_u_NON_TRANSACTIONAL;
static PyObject *__pyx_n_u_NOT_FINISHED;
static PyObject *__pyx_kp_u_No_mutation_results_received;
static PyObject *__pyx_n_s_Put;
static PyObject *__pyx_n_s_QueryDefinition;
static PyObject *__pyx_kp_u_Received_an_unexpected_key_updat;
static PyObject *__pyx_n_s_RecursionError;
static PyObject *__pyx_n_s_RequestsConnectionError;
static PyObject *__pyx_kp_u_Retrying_http_post_request_to_da;
static PyObject *__pyx_n_s_RunInTransaction;
static PyObject *__pyx_n_u_STRONG;
static PyObject *__pyx_n_u_TRANSACTIONAL;
static PyObject *__pyx_kp_u_Transaction_collision_retrying;
static PyObject *__pyx_kp_u_UTF_8;
static PyObject *__pyx_n_s_Union;
static PyObject *__pyx_kp_u_Unknown_type;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_u_Y_m_dT_H_M_S;
static PyObject *__pyx_kp_u_Y_m_dT_H_M_S_f;
static PyObject *__pyx_kp_u_Y_m_dT_H_M_S_fZ;
static PyObject *__pyx_kp_u__10;
static PyObject *__pyx_kp_u__3;
static PyObject *__pyx_n_s__37;
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_kp_u__9;
static PyObject *__pyx_n_u_affectedEntities;
static PyObject *__pyx_n_s_affectedEntity;
static PyObject *__pyx_n_u_allowOverriding;
static PyObject *__pyx_n_s_allowOverriding_2;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_arrayElem;
static PyObject *__pyx_n_s_arrayIt;
static PyObject *__pyx_n_u_arrayValue;
static PyObject *__pyx_n_s_astimezone;
static PyObject *__pyx_n_s_auth;
static PyObject *__pyx_n_s_authenticatedRequest;
static PyObject *__pyx_n_s_b64decode;
static PyObject *__pyx_n_s_b64encode;
static PyObject *__pyx_n_s_base64;
static PyObject *__pyx_n_u_blobValue;
static PyObject *__pyx_n_u_booleanValue;
static PyObject *__pyx_n_s_callback;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_u_compositeFilter;
static PyObject *__pyx_n_s_content;
static PyObject *__pyx_n_s_credentials;
static PyObject *__pyx_n_s_currentCursor;
static PyObject *__pyx_n_s_currentTransaction;
static PyObject *__pyx_n_s_currentTxn;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_data_ptr;
static PyObject *__pyx_n_s_datetime;
static PyObject *__pyx_n_s_debug;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_default;
static PyObject *__pyx_n_u_delete;
static PyObject *__pyx_n_s_dictKey;
static PyObject *__pyx_n_s_dictValue;
static PyObject *__pyx_n_u_direction;
static PyObject *__pyx_n_s_distinct;
static PyObject *__pyx_n_s_distinctKey;
static PyObject *__pyx_n_u_distinctOn;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_u_doubleValue;
static PyObject *__pyx_n_s_dumps;
static PyObject *__pyx_n_s_element;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_endCursor;
static PyObject *__pyx_n_u_endCursor;
static PyObject *__pyx_n_s_entities;
static PyObject *__pyx_n_u_entityValue;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_u_excludeFromIndexes;
static PyObject *__pyx_n_s_exclude_from_indexes;
static PyObject *__pyx_n_s_excludedProperties;
static PyObject *__pyx_n_s_extend;
static PyObject *__pyx_n_u_filter;
static PyObject *__pyx_n_s_filterList;
static PyObject *__pyx_n_s_filters;
static PyObject *__pyx_n_u_filters;
static PyObject *__pyx_n_s_flipResults;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_google;
static PyObject *__pyx_n_s_google_auth;
static PyObject *__pyx_n_s_http_internal;
static PyObject *__pyx_kp_u_https_datastore_googleapis_com_v;
static PyObject *__pyx_kp_u_https_datastore_googleapis_com_v_2;
static PyObject *__pyx_kp_u_https_datastore_googleapis_com_v_3;
static PyObject *__pyx_kp_u_https_datastore_googleapis_com_v_4;
static PyObject *__pyx_kp_u_https_datastore_googleapis_com_v_5;
static PyObject *__pyx_kp_u_https_datastore_googleapis_com_v_6;
static PyObject *__pyx_kp_u_https_www_googleapis_com_auth_da;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_u_id;
static PyObject *__pyx_n_s_idx;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_innerArrayElem;
static PyObject *__pyx_n_u_integerValue;
static PyObject *__pyx_n_s_internalStartCursor;
static PyObject *__pyx_n_s_isMulti;
static PyObject *__pyx_kp_u_is_not_supported;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_json;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_u_key;
static PyObject *__pyx_n_s_keyList;
static PyObject *__pyx_n_s_keyToPath;
static PyObject *__pyx_n_u_keyValue;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_u_keys;
static PyObject *__pyx_n_s_kind;
static PyObject *__pyx_n_u_kind;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_limit;
static PyObject *__pyx_n_u_limit;
static PyObject *__pyx_n_s_loads;
static PyObject *__pyx_n_s_logging;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_u_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_u_mutations;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_u_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_u_nullValue;
static PyObject *__pyx_n_s_oldTxn;
static PyObject *__pyx_n_s_op;
static PyObject *__pyx_n_u_op;
static PyObject *__pyx_n_u_order;
static PyObject *__pyx_n_s_orders;
static PyObject *__pyx_n_s_parent;
static PyObject *__pyx_n_s_parser;
static PyObject *__pyx_n_u_partitionId;
static PyObject *__pyx_n_u_path;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_post;
static PyObject *__pyx_n_s_postData;
static PyObject *__pyx_n_s_pprint;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_u_previousTransaction;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_projectID;
static PyObject *__pyx_n_u_project_id;
static PyObject *__pyx_n_s_properties;
static PyObject *__pyx_n_u_properties;
static PyObject *__pyx_n_u_property;
static PyObject *__pyx_n_u_propertyFilter;
static PyObject *__pyx_n_s_pysize;
static PyObject *__pyx_n_s_pythonPropToJson;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_u_query;
static PyObject *__pyx_n_s_queryDefinition;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_u_readConsistency;
static PyObject *__pyx_n_s_readOptions;
static PyObject *__pyx_n_u_readOptions;
static PyObject *__pyx_n_u_readWrite;
static PyObject *__pyx_n_s_refresh_timeout;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_req;
static PyObject *__pyx_n_s_requestedKeys;
static PyObject *__pyx_n_s_requests;
static PyObject *__pyx_n_s_requests_exceptions;
static PyObject *__pyx_n_s_res;
static PyObject *__pyx_n_s_resDict;
static PyObject *__pyx_n_s_resList;
static PyObject *__pyx_n_s_rollbackTxn;
static PyObject *__pyx_n_s_runSingleFilter;
static PyObject *__pyx_n_s_scopes;
static PyObject *__pyx_n_s_set;
static PyObject *__pyx_n_s_singleValue;
static PyObject *__pyx_n_s_sortOrder;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_kp_s_src_viur_datastore_transport_pyx;
static PyObject *__pyx_n_s_startCursor;
static PyObject *__pyx_n_u_startCursor;
static PyObject *__pyx_n_s_status_code;
static PyObject *__pyx_n_s_strftime;
static PyObject *__pyx_n_u_stringValue;
static PyObject *__pyx_n_s_strptime;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_u_timestampValue;
static PyObject *__pyx_n_s_timezone;
static PyObject *__pyx_n_u_transaction;
static PyObject *__pyx_n_u_transactionOptions;
static PyObject *__pyx_n_s_transport;
static PyObject *__pyx_n_s_txnKey;
static PyObject *__pyx_n_s_txnOptions;
static PyObject *__pyx_n_s_typing;
static PyObject *__pyx_n_s_tzinfo;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_u_upsert;
static PyObject *__pyx_n_s_url;
static PyObject *__pyx_n_s_utc;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_u_value;
static PyObject *__pyx_n_u_values;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_viur_datastore_transport;
static PyObject *__pyx_n_s_viur_datastore_types;
static PyObject *__pyx_n_s_warning;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_pf_4viur_9datastore_9transport_authenticatedRequest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_4viur_9datastore_9transport_2keyToPath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_4viur_9datastore_9transport_4pythonPropToJson(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_4viur_9datastore_9transport_6runSingleFilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_queryDefinition, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_4viur_9datastore_9transport_8Get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_4viur_9datastore_9transport_10Delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_4viur_9datastore_9transport_12Put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_entities); /* proto */
static PyObject *__pyx_pf_4viur_9datastore_9transport_14RunInTransaction(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_4viur_9datastore_9transport_16_rollbackTxn(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_txnKey); /* proto */
static PyObject *__pyx_pf_4viur_9datastore_9transport_18AllocateIDs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_keys); /* proto */
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, &__pyx_n_s_update, 0, 0, 0};
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_200;
static PyObject *__pyx_int_300;
static PyObject *__pyx_int_409;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_slice__2;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_slice__14;
static PyObject *__pyx_slice__15;
static PyObject *__pyx_slice__16;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__25;
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__38;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_codeobj__24;
static PyObject *__pyx_codeobj__26;
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__39;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__43;
/* Late includes */

/* "viur/datastore/transport.pyx":103
 * )
 * 
 * def authenticatedRequest(url:str, data: bytes) -> requests.Response:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs one http request to the datastore rest api, authenticated with the current projects service account.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4viur_9datastore_9transport_1authenticatedRequest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4viur_9datastore_9transport_authenticatedRequest[] = "\n\t\tRuns one http request to the datastore rest api, authenticated with the current projects service account.\n\t\tWill retry up to three times in case the connection cannot be established the first time.\n\n\t\t:param url: The url to post the data to\n\t\t:param data:: The data to include in the post request\n\t\t:return: The Response object\n\t";
static PyMethodDef __pyx_mdef_4viur_9datastore_9transport_1authenticatedRequest = {"authenticatedRequest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4viur_9datastore_9transport_1authenticatedRequest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4viur_9datastore_9transport_authenticatedRequest};
static PyObject *__pyx_pw_4viur_9datastore_9transport_1authenticatedRequest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_url = 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("authenticatedRequest (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_url,&__pyx_n_s_data,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_url)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("authenticatedRequest", 1, 2, 2, 1); __PYX_ERR(0, 103, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "authenticatedRequest") < 0)) __PYX_ERR(0, 103, __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_url = ((PyObject*)values[0]);
    __pyx_v_data = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("authenticatedRequest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 103, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("viur.datastore.transport.authenticatedRequest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_url), (&PyUnicode_Type), 1, "url", 1))) __PYX_ERR(0, 103, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) __PYX_ERR(0, 103, __pyx_L1_error)
  __pyx_r = __pyx_pf_4viur_9datastore_9transport_authenticatedRequest(__pyx_self, __pyx_v_url, __pyx_v_data);

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

static PyObject *__pyx_pf_4viur_9datastore_9transport_authenticatedRequest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_url, PyObject *__pyx_v_data) {
  long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("authenticatedRequest", 0);

  /* "viur/datastore/transport.pyx":112
 * 		:return: The Response object
 * 	"""
 * 	for i in range(0, 3):             # <<<<<<<<<<<<<<
 * 		try:
 * 			return _http_internal.post(
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "viur/datastore/transport.pyx":113
 * 	"""
 * 	for i in range(0, 3):
 * 		try:             # <<<<<<<<<<<<<<
 * 			return _http_internal.post(
 * 				url=url,
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "viur/datastore/transport.pyx":114
 * 	for i in range(0, 3):
 * 		try:
 * 			return _http_internal.post(             # <<<<<<<<<<<<<<
 * 				url=url,
 * 				data=data,
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_http_internal); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_post); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "viur/datastore/transport.pyx":115
 * 		try:
 * 			return _http_internal.post(
 * 				url=url,             # <<<<<<<<<<<<<<
 * 				data=data,
 * 			)
 */
        __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_url, __pyx_v_url) < 0) __PYX_ERR(0, 115, __pyx_L5_error)

        /* "viur/datastore/transport.pyx":116
 * 			return _http_internal.post(
 * 				url=url,
 * 				data=data,             # <<<<<<<<<<<<<<
 * 			)
 * 		except RequestsConnectionError:
 */
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_data, __pyx_v_data) < 0) __PYX_ERR(0, 115, __pyx_L5_error)

        /* "viur/datastore/transport.pyx":114
 * 	for i in range(0, 3):
 * 		try:
 * 			return _http_internal.post(             # <<<<<<<<<<<<<<
 * 				url=url,
 * 				data=data,
 */
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L9_try_return;

        /* "viur/datastore/transport.pyx":113
 * 	"""
 * 	for i in range(0, 3):
 * 		try:             # <<<<<<<<<<<<<<
 * 			return _http_internal.post(
 * 				url=url,
 */
      }
      __pyx_L5_error:;
      __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;

      /* "viur/datastore/transport.pyx":118
 * 				data=data,
 * 			)
 * 		except RequestsConnectionError:             # <<<<<<<<<<<<<<
 * 			logging.debug("Retrying http post request to datastore")
 * 			if i == 2:
 */
      __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_5, &__pyx_t_6);
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_RequestsConnectionError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 118, __pyx_L7_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_7, __pyx_t_8);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_ErrRestore(__pyx_t_7, __pyx_t_5, __pyx_t_6);
      __pyx_t_7 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
      if (__pyx_t_9) {
        __Pyx_AddTraceback("viur.datastore.transport.authenticatedRequest", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 118, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_7);

        /* "viur/datastore/transport.pyx":119
 * 			)
 * 		except RequestsConnectionError:
 * 			logging.debug("Retrying http post request to datastore")             # <<<<<<<<<<<<<<
 * 			if i == 2:
 * 				raise
 */
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_logging); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 119, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_debug); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
          }
        }
        __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_kp_u_Retrying_http_post_request_to_da) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_kp_u_Retrying_http_post_request_to_da);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "viur/datastore/transport.pyx":120
 * 		except RequestsConnectionError:
 * 			logging.debug("Retrying http post request to datastore")
 * 			if i == 2:             # <<<<<<<<<<<<<<
 * 				raise
 * 			continue
 */
        __pyx_t_12 = ((__pyx_v_i == 2) != 0);
        if (unlikely(__pyx_t_12)) {

          /* "viur/datastore/transport.pyx":121
 * 			logging.debug("Retrying http post request to datastore")
 * 			if i == 2:
 * 				raise             # <<<<<<<<<<<<<<
 * 			continue
 * 
 */
          __Pyx_GIVEREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_5, __pyx_t_7);
          __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_7 = 0; 
          __PYX_ERR(0, 121, __pyx_L7_except_error)

          /* "viur/datastore/transport.pyx":120
 * 		except RequestsConnectionError:
 * 			logging.debug("Retrying http post request to datastore")
 * 			if i == 2:             # <<<<<<<<<<<<<<
 * 				raise
 * 			continue
 */
        }

        /* "viur/datastore/transport.pyx":122
 * 			if i == 2:
 * 				raise
 * 			continue             # <<<<<<<<<<<<<<
 * 
 * def keyToPath(key: Key) -> List[dict]:
 */
        goto __pyx_L14_except_continue;
        __pyx_L14_except_continue:;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L11_try_continue;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "viur/datastore/transport.pyx":113
 * 	"""
 * 	for i in range(0, 3):
 * 		try:             # <<<<<<<<<<<<<<
 * 			return _http_internal.post(
 * 				url=url,
 */
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L1_error;
      __pyx_L11_try_continue:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L3_continue;
      __pyx_L9_try_return:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L0;
    }
    __pyx_L3_continue:;
  }

  /* "viur/datastore/transport.pyx":103
 * )
 * 
 * def authenticatedRequest(url:str, data: bytes) -> requests.Response:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs one http request to the datastore rest api, authenticated with the current projects service account.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("viur.datastore.transport.authenticatedRequest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":124
 * 			continue
 * 
 * def keyToPath(key: Key) -> List[dict]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Converts a Key object to the PathElements expected by the rest API.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4viur_9datastore_9transport_3keyToPath(PyObject *__pyx_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_4viur_9datastore_9transport_2keyToPath[] = "\n\t\tConverts a Key object to the PathElements expected by the rest API.\n\t\tSee https://cloud.google.com/datastore/docs/reference/data/rest/v1/Key#PathElement\n\n\t\t:param key: The key object to convert\n\t\t:return: The list of path elements corresponding to this key\n\t";
static PyMethodDef __pyx_mdef_4viur_9datastore_9transport_3keyToPath = {"keyToPath", (PyCFunction)__pyx_pw_4viur_9datastore_9transport_3keyToPath, METH_O, __pyx_doc_4viur_9datastore_9transport_2keyToPath};
static PyObject *__pyx_pw_4viur_9datastore_9transport_3keyToPath(PyObject *__pyx_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("keyToPath (wrapper)", 0);
  __pyx_r = __pyx_pf_4viur_9datastore_9transport_2keyToPath(__pyx_self, ((PyObject *)__pyx_v_key));

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

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

  /* "viur/datastore/transport.pyx":132
 * 		:return: The list of path elements corresponding to this key
 * 	"""
 * 	res = []             # <<<<<<<<<<<<<<
 * 	while key:
 * 		res.insert(0,
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":133
 * 	"""
 * 	res = []
 * 	while key:             # <<<<<<<<<<<<<<
 * 		res.insert(0,
 * 				   {
 */
  while (1) {
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 133, __pyx_L1_error)
    if (!__pyx_t_2) break;

    /* "viur/datastore/transport.pyx":138
 * 					   "kind": key.kind,
 * 					   "id": key.id,
 * 				   } if key.id else {             # <<<<<<<<<<<<<<
 * 					   "kind": key.kind,
 * 					   "name": key.name
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __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, 138, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "viur/datastore/transport.pyx":136
 * 		res.insert(0,
 * 				   {
 * 					   "kind": key.kind,             # <<<<<<<<<<<<<<
 * 					   "id": key.id,
 * 				   } if key.id else {
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_kind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_kind, __pyx_t_4) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "viur/datastore/transport.pyx":137
 * 				   {
 * 					   "kind": key.kind,
 * 					   "id": key.id,             # <<<<<<<<<<<<<<
 * 				   } if key.id else {
 * 					   "kind": key.kind,
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_id, __pyx_t_4) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
    } else {

      /* "viur/datastore/transport.pyx":141
 * 					   "kind": key.kind,
 * 					   "name": key.name
 * 				   } if key.name else {             # <<<<<<<<<<<<<<
 * 					   "kind": key.kind,
 * 				   }
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 141, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_5) {

        /* "viur/datastore/transport.pyx":139
 * 					   "id": key.id,
 * 				   } if key.id else {
 * 					   "kind": key.kind,             # <<<<<<<<<<<<<<
 * 					   "name": key.name
 * 				   } if key.name else {
 */
        __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_kind, __pyx_t_6) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "viur/datastore/transport.pyx":140
 * 				   } if key.id else {
 * 					   "kind": key.kind,
 * 					   "name": key.name             # <<<<<<<<<<<<<<
 * 				   } if key.name else {
 * 					   "kind": key.kind,
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_name, __pyx_t_6) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_3 = __pyx_t_4;
        __pyx_t_4 = 0;
      } else {

        /* "viur/datastore/transport.pyx":142
 * 					   "name": key.name
 * 				   } if key.name else {
 * 					   "kind": key.kind,             # <<<<<<<<<<<<<<
 * 				   }
 * 				   )
 */
        __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_kind, __pyx_t_6) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_3 = __pyx_t_4;
        __pyx_t_4 = 0;
      }
      __pyx_t_1 = __pyx_t_3;
      __pyx_t_3 = 0;
    }

    /* "viur/datastore/transport.pyx":134
 * 	res = []
 * 	while key:
 * 		res.insert(0,             # <<<<<<<<<<<<<<
 * 				   {
 * 					   "kind": key.kind,
 */
    __pyx_t_7 = PyList_Insert(__pyx_v_res, 0, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 134, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "viur/datastore/transport.pyx":145
 * 				   }
 * 				   )
 * 		key = key.parent             # <<<<<<<<<<<<<<
 * 	return res
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "viur/datastore/transport.pyx":146
 * 				   )
 * 		key = key.parent
 * 	return res             # <<<<<<<<<<<<<<
 * 
 * def pythonPropToJson(v) -> dict:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "viur/datastore/transport.pyx":124
 * 			continue
 * 
 * def keyToPath(key: Key) -> List[dict]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Converts a Key object to the PathElements expected by the rest API.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("viur.datastore.transport.keyToPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":148
 * 	return res
 * 
 * def pythonPropToJson(v) -> dict:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Convert a python type to the object representation expected by the datastore rest API.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4viur_9datastore_9transport_5pythonPropToJson(PyObject *__pyx_self, PyObject *__pyx_v_v); /*proto*/
static char __pyx_doc_4viur_9datastore_9transport_4pythonPropToJson[] = "\n\t\tConvert a python type to the object representation expected by the datastore rest API.\n\t\tSee https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/runQuery#Value\n\n\t\t:param v: The python object to convert\n\t\t:return: The representation of that object as expected by the rest api.\n\t";
static PyMethodDef __pyx_mdef_4viur_9datastore_9transport_5pythonPropToJson = {"pythonPropToJson", (PyCFunction)__pyx_pw_4viur_9datastore_9transport_5pythonPropToJson, METH_O, __pyx_doc_4viur_9datastore_9transport_4pythonPropToJson};
static PyObject *__pyx_pw_4viur_9datastore_9transport_5pythonPropToJson(PyObject *__pyx_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pythonPropToJson (wrapper)", 0);
  __pyx_r = __pyx_pf_4viur_9datastore_9transport_4pythonPropToJson(__pyx_self, ((PyObject *)__pyx_v_v));

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

static PyObject *__pyx_pf_4viur_9datastore_9transport_4pythonPropToJson(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_v_excludedProperties = 0;
  PyObject *__pyx_v_properties = NULL;
  PyObject *__pyx_v_dictKey = NULL;
  PyObject *__pyx_v_dictValue = NULL;
  PyObject *__pyx_v_resList = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_resDict = NULL;
  PyObject *__pyx_7genexpr__pyx_v_dictKey = NULL;
  PyObject *__pyx_7genexpr__pyx_v_dictValue = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_x = 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;
  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)(PyObject *);
  int __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  Py_UCS4 __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pythonPropToJson", 0);

  /* "viur/datastore/transport.pyx":156
 * 		:return: The representation of that object as expected by the rest api.
 * 	"""
 * 	if v is True or v is False:             # <<<<<<<<<<<<<<
 * 		return {
 * 			"booleanValue": v
 */
  __pyx_t_2 = (__pyx_v_v == Py_True);
  __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_3 = (__pyx_v_v == Py_False);
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "viur/datastore/transport.pyx":157
 * 	"""
 * 	if v is True or v is False:
 * 		return {             # <<<<<<<<<<<<<<
 * 			"booleanValue": v
 * 		}
 */
    __Pyx_XDECREF(__pyx_r);

    /* "viur/datastore/transport.pyx":158
 * 	if v is True or v is False:
 * 		return {
 * 			"booleanValue": v             # <<<<<<<<<<<<<<
 * 		}
 * 	elif v is None:
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_booleanValue, __pyx_v_v) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":156
 * 		:return: The representation of that object as expected by the rest api.
 * 	"""
 * 	if v is True or v is False:             # <<<<<<<<<<<<<<
 * 		return {
 * 			"booleanValue": v
 */
  }

  /* "viur/datastore/transport.pyx":160
 * 			"booleanValue": v
 * 		}
 * 	elif v is None:             # <<<<<<<<<<<<<<
 * 		return {"nullValue": None}
 * 	elif isinstance(v, int):
 */
  __pyx_t_1 = (__pyx_v_v == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "viur/datastore/transport.pyx":161
 * 		}
 * 	elif v is None:
 * 		return {"nullValue": None}             # <<<<<<<<<<<<<<
 * 	elif isinstance(v, int):
 * 		return {
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_nullValue, Py_None) < 0) __PYX_ERR(0, 161, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":160
 * 			"booleanValue": v
 * 		}
 * 	elif v is None:             # <<<<<<<<<<<<<<
 * 		return {"nullValue": None}
 * 	elif isinstance(v, int):
 */
  }

  /* "viur/datastore/transport.pyx":162
 * 	elif v is None:
 * 		return {"nullValue": None}
 * 	elif isinstance(v, int):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"integerValue": str(v)
 */
  __pyx_t_2 = PyInt_Check(__pyx_v_v); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "viur/datastore/transport.pyx":163
 * 		return {"nullValue": None}
 * 	elif isinstance(v, int):
 * 		return {             # <<<<<<<<<<<<<<
 * 			"integerValue": str(v)
 * 		}
 */
    __Pyx_XDECREF(__pyx_r);

    /* "viur/datastore/transport.pyx":164
 * 	elif isinstance(v, int):
 * 		return {
 * 			"integerValue": str(v)             # <<<<<<<<<<<<<<
 * 		}
 * 	elif isinstance(v, float):
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_integerValue, __pyx_t_5) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":162
 * 	elif v is None:
 * 		return {"nullValue": None}
 * 	elif isinstance(v, int):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"integerValue": str(v)
 */
  }

  /* "viur/datastore/transport.pyx":166
 * 			"integerValue": str(v)
 * 		}
 * 	elif isinstance(v, float):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"doubleValue": v
 */
  __pyx_t_1 = PyFloat_Check(__pyx_v_v); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "viur/datastore/transport.pyx":167
 * 		}
 * 	elif isinstance(v, float):
 * 		return {             # <<<<<<<<<<<<<<
 * 			"doubleValue": v
 * 		}
 */
    __Pyx_XDECREF(__pyx_r);

    /* "viur/datastore/transport.pyx":168
 * 	elif isinstance(v, float):
 * 		return {
 * 			"doubleValue": v             # <<<<<<<<<<<<<<
 * 		}
 * 	elif isinstance(v, str):
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_doubleValue, __pyx_v_v) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":166
 * 			"integerValue": str(v)
 * 		}
 * 	elif isinstance(v, float):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"doubleValue": v
 */
  }

  /* "viur/datastore/transport.pyx":170
 * 			"doubleValue": v
 * 		}
 * 	elif isinstance(v, str):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"stringValue": v
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_v); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "viur/datastore/transport.pyx":171
 * 		}
 * 	elif isinstance(v, str):
 * 		return {             # <<<<<<<<<<<<<<
 * 			"stringValue": v
 * 		}
 */
    __Pyx_XDECREF(__pyx_r);

    /* "viur/datastore/transport.pyx":172
 * 	elif isinstance(v, str):
 * 		return {
 * 			"stringValue": v             # <<<<<<<<<<<<<<
 * 		}
 * 	elif isinstance(v, Key):
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_stringValue, __pyx_v_v) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":170
 * 			"doubleValue": v
 * 		}
 * 	elif isinstance(v, str):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"stringValue": v
 */
  }

  /* "viur/datastore/transport.pyx":174
 * 			"stringValue": v
 * 		}
 * 	elif isinstance(v, Key):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"keyValue": {
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_v, __pyx_t_4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "viur/datastore/transport.pyx":175
 * 		}
 * 	elif isinstance(v, Key):
 * 		return {             # <<<<<<<<<<<<<<
 * 			"keyValue": {
 * 				"partitionId": {
 */
    __Pyx_XDECREF(__pyx_r);

    /* "viur/datastore/transport.pyx":176
 * 	elif isinstance(v, Key):
 * 		return {
 * 			"keyValue": {             # <<<<<<<<<<<<<<
 * 				"partitionId": {
 * 					"project_id": projectID,
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "viur/datastore/transport.pyx":177
 * 		return {
 * 			"keyValue": {
 * 				"partitionId": {             # <<<<<<<<<<<<<<
 * 					"project_id": projectID,
 * 				},
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "viur/datastore/transport.pyx":178
 * 			"keyValue": {
 * 				"partitionId": {
 * 					"project_id": projectID,             # <<<<<<<<<<<<<<
 * 				},
 * 				"path": keyToPath(v)
 */
    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_projectID); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_project_id, __pyx_t_7) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_partitionId, __pyx_t_6) < 0) __PYX_ERR(0, 177, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "viur/datastore/transport.pyx":180
 * 					"project_id": projectID,
 * 				},
 * 				"path": keyToPath(v)             # <<<<<<<<<<<<<<
 * 			}
 * 		}
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_keyToPath); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_v);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_path, __pyx_t_6) < 0) __PYX_ERR(0, 177, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_keyValue, __pyx_t_5) < 0) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":174
 * 			"stringValue": v
 * 		}
 * 	elif isinstance(v, Key):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"keyValue": {
 */
  }

  /* "viur/datastore/transport.pyx":183
 * 			}
 * 		}
 * 	elif isinstance(v, datetime):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"timestampValue": v.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_v, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "viur/datastore/transport.pyx":184
 * 		}
 * 	elif isinstance(v, datetime):
 * 		return {             # <<<<<<<<<<<<<<
 * 			"timestampValue": v.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
 * 		}
 */
    __Pyx_XDECREF(__pyx_r);

    /* "viur/datastore/transport.pyx":185
 * 	elif isinstance(v, datetime):
 * 		return {
 * 			"timestampValue": v.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%fZ")             # <<<<<<<<<<<<<<
 * 		}
 * 	elif isinstance(v, Entity):
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_astimezone); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_timezone); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_utc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 185, __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_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_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __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_6)) __PYX_ERR(0, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strftime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __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_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_kp_u_Y_m_dT_H_M_S_fZ) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_u_Y_m_dT_H_M_S_fZ);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_timestampValue, __pyx_t_5) < 0) __PYX_ERR(0, 185, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":183
 * 			}
 * 		}
 * 	elif isinstance(v, datetime):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"timestampValue": v.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
 */
  }

  /* "viur/datastore/transport.pyx":187
 * 			"timestampValue": v.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
 * 		}
 * 	elif isinstance(v, Entity):             # <<<<<<<<<<<<<<
 * 		excludedProperties: set = set(v.exclude_from_indexes)
 * 		properties = {}
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Entity); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_v, __pyx_t_4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "viur/datastore/transport.pyx":188
 * 		}
 * 	elif isinstance(v, Entity):
 * 		excludedProperties: set = set(v.exclude_from_indexes)             # <<<<<<<<<<<<<<
 * 		properties = {}
 * 		for dictKey, dictValue in v.items():
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_exclude_from_indexes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_excludedProperties = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "viur/datastore/transport.pyx":189
 * 	elif isinstance(v, Entity):
 * 		excludedProperties: set = set(v.exclude_from_indexes)
 * 		properties = {}             # <<<<<<<<<<<<<<
 * 		for dictKey, dictValue in v.items():
 * 			if isinstance(dictValue, list) and dictKey in excludedProperties:
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_properties = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "viur/datastore/transport.pyx":190
 * 		excludedProperties: set = set(v.exclude_from_indexes)
 * 		properties = {}
 * 		for dictKey, dictValue in v.items():             # <<<<<<<<<<<<<<
 * 			if isinstance(dictValue, list) and dictKey in excludedProperties:
 * 				# Lists cannot be not indexed (but each of its value can be). So we have to forward our not-indexed
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_v == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 190, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_v, 0, __pyx_n_s_items, (&__pyx_t_11), (&__pyx_t_12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5);
    __pyx_t_5 = __pyx_t_4;
    __pyx_t_4 = 0;
    while (1) {
      __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_11, &__pyx_t_10, &__pyx_t_4, &__pyx_t_7, NULL, __pyx_t_12);
      if (unlikely(__pyx_t_13 == 0)) break;
      if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_dictKey, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_dictValue, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "viur/datastore/transport.pyx":191
 * 		properties = {}
 * 		for dictKey, dictValue in v.items():
 * 			if isinstance(dictValue, list) and dictKey in excludedProperties:             # <<<<<<<<<<<<<<
 * 				# Lists cannot be not indexed (but each of its value can be). So we have to forward our not-indexed
 * 				# flag to our children. See https://github.com/googleapis/google-cloud-node/issues/2615.
 */
      __pyx_t_1 = PyList_Check(__pyx_v_dictValue); 
      __pyx_t_3 = (__pyx_t_1 != 0);
      if (__pyx_t_3) {
      } else {
        __pyx_t_2 = __pyx_t_3;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_v_dictKey, __pyx_v_excludedProperties, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
      __pyx_t_1 = (__pyx_t_3 != 0);
      __pyx_t_2 = __pyx_t_1;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_2) {

        /* "viur/datastore/transport.pyx":194
 * 				# Lists cannot be not indexed (but each of its value can be). So we have to forward our not-indexed
 * 				# flag to our children. See https://github.com/googleapis/google-cloud-node/issues/2615.
 * 				resList = []             # <<<<<<<<<<<<<<
 * 				for value in dictValue:
 * 					resDict = pythonPropToJson(value)
 */
        __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 194, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_XDECREF_SET(__pyx_v_resList, ((PyObject*)__pyx_t_7));
        __pyx_t_7 = 0;

        /* "viur/datastore/transport.pyx":195
 * 				# flag to our children. See https://github.com/googleapis/google-cloud-node/issues/2615.
 * 				resList = []
 * 				for value in dictValue:             # <<<<<<<<<<<<<<
 * 					resDict = pythonPropToJson(value)
 * 					resDict["excludeFromIndexes"] = True
 */
        if (likely(PyList_CheckExact(__pyx_v_dictValue)) || PyTuple_CheckExact(__pyx_v_dictValue)) {
          __pyx_t_7 = __pyx_v_dictValue; __Pyx_INCREF(__pyx_t_7); __pyx_t_14 = 0;
          __pyx_t_15 = NULL;
        } else {
          __pyx_t_14 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_dictValue); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 195, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_15 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 195, __pyx_L1_error)
        }
        for (;;) {
          if (likely(!__pyx_t_15)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 195, __pyx_L1_error)
              #else
              __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            } else {
              if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 195, __pyx_L1_error)
              #else
              __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              #endif
            }
          } else {
            __pyx_t_4 = __pyx_t_15(__pyx_t_7);
            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, 195, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "viur/datastore/transport.pyx":196
 * 				resList = []
 * 				for value in dictValue:
 * 					resDict = pythonPropToJson(value)             # <<<<<<<<<<<<<<
 * 					resDict["excludeFromIndexes"] = True
 * 					resList.append(resDict)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pythonPropToJson); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_9 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(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_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_value);
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF_SET(__pyx_v_resDict, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "viur/datastore/transport.pyx":197
 * 				for value in dictValue:
 * 					resDict = pythonPropToJson(value)
 * 					resDict["excludeFromIndexes"] = True             # <<<<<<<<<<<<<<
 * 					resList.append(resDict)
 * 				properties[dictKey] = {
 */
          if (unlikely(PyObject_SetItem(__pyx_v_resDict, __pyx_n_u_excludeFromIndexes, Py_True) < 0)) __PYX_ERR(0, 197, __pyx_L1_error)

          /* "viur/datastore/transport.pyx":198
 * 					resDict = pythonPropToJson(value)
 * 					resDict["excludeFromIndexes"] = True
 * 					resList.append(resDict)             # <<<<<<<<<<<<<<
 * 				properties[dictKey] = {
 * 					"arrayValue": {
 */
          __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_resList, __pyx_v_resDict); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 198, __pyx_L1_error)

          /* "viur/datastore/transport.pyx":195
 * 				# flag to our children. See https://github.com/googleapis/google-cloud-node/issues/2615.
 * 				resList = []
 * 				for value in dictValue:             # <<<<<<<<<<<<<<
 * 					resDict = pythonPropToJson(value)
 * 					resDict["excludeFromIndexes"] = True
 */
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "viur/datastore/transport.pyx":200
 * 					resList.append(resDict)
 * 				properties[dictKey] = {
 * 					"arrayValue": {             # <<<<<<<<<<<<<<
 * 						"values": resList
 * 					}
 */
        __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 200, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);

        /* "viur/datastore/transport.pyx":201
 * 				properties[dictKey] = {
 * 					"arrayValue": {
 * 						"values": resList             # <<<<<<<<<<<<<<
 * 					}
 * 				}
 */
        __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_values, __pyx_v_resList) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_arrayValue, __pyx_t_4) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "viur/datastore/transport.pyx":199
 * 					resDict["excludeFromIndexes"] = True
 * 					resList.append(resDict)
 * 				properties[dictKey] = {             # <<<<<<<<<<<<<<
 * 					"arrayValue": {
 * 						"values": resList
 */
        if (unlikely(PyDict_SetItem(__pyx_v_properties, __pyx_v_dictKey, __pyx_t_7) < 0)) __PYX_ERR(0, 199, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "viur/datastore/transport.pyx":191
 * 		properties = {}
 * 		for dictKey, dictValue in v.items():
 * 			if isinstance(dictValue, list) and dictKey in excludedProperties:             # <<<<<<<<<<<<<<
 * 				# Lists cannot be not indexed (but each of its value can be). So we have to forward our not-indexed
 * 				# flag to our children. See https://github.com/googleapis/google-cloud-node/issues/2615.
 */
        goto __pyx_L8;
      }

      /* "viur/datastore/transport.pyx":205
 * 				}
 * 			else:
 * 				resDict = pythonPropToJson(dictValue)             # <<<<<<<<<<<<<<
 * 				if dictKey in excludedProperties:
 * 					resDict["excludeFromIndexes"] = True
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pythonPropToJson); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_dictValue) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_dictValue);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 205, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_resDict, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "viur/datastore/transport.pyx":206
 * 			else:
 * 				resDict = pythonPropToJson(dictValue)
 * 				if dictKey in excludedProperties:             # <<<<<<<<<<<<<<
 * 					resDict["excludeFromIndexes"] = True
 * 				properties[dictKey] = resDict
 */
        __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_dictKey, __pyx_v_excludedProperties, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 206, __pyx_L1_error)
        __pyx_t_1 = (__pyx_t_2 != 0);
        if (__pyx_t_1) {

          /* "viur/datastore/transport.pyx":207
 * 				resDict = pythonPropToJson(dictValue)
 * 				if dictKey in excludedProperties:
 * 					resDict["excludeFromIndexes"] = True             # <<<<<<<<<<<<<<
 * 				properties[dictKey] = resDict
 * 		return {
 */
          if (unlikely(PyObject_SetItem(__pyx_v_resDict, __pyx_n_u_excludeFromIndexes, Py_True) < 0)) __PYX_ERR(0, 207, __pyx_L1_error)

          /* "viur/datastore/transport.pyx":206
 * 			else:
 * 				resDict = pythonPropToJson(dictValue)
 * 				if dictKey in excludedProperties:             # <<<<<<<<<<<<<<
 * 					resDict["excludeFromIndexes"] = True
 * 				properties[dictKey] = resDict
 */
        }

        /* "viur/datastore/transport.pyx":208
 * 				if dictKey in excludedProperties:
 * 					resDict["excludeFromIndexes"] = True
 * 				properties[dictKey] = resDict             # <<<<<<<<<<<<<<
 * 		return {
 * 			"entityValue": {
 */
        if (unlikely(PyDict_SetItem(__pyx_v_properties, __pyx_v_dictKey, __pyx_v_resDict) < 0)) __PYX_ERR(0, 208, __pyx_L1_error)
      }
      __pyx_L8:;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "viur/datastore/transport.pyx":209
 * 					resDict["excludeFromIndexes"] = True
 * 				properties[dictKey] = resDict
 * 		return {             # <<<<<<<<<<<<<<
 * 			"entityValue": {
 * 				"key": pythonPropToJson(v.key)["keyValue"] if isinstance(v, Entity) and v.key else None,
 */
    __Pyx_XDECREF(__pyx_r);

    /* "viur/datastore/transport.pyx":210
 * 				properties[dictKey] = resDict
 * 		return {
 * 			"entityValue": {             # <<<<<<<<<<<<<<
 * 				"key": pythonPropToJson(v.key)["keyValue"] if isinstance(v, Entity) and v.key else None,
 * 				"properties": properties
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "viur/datastore/transport.pyx":211
 * 		return {
 * 			"entityValue": {
 * 				"key": pythonPropToJson(v.key)["keyValue"] if isinstance(v, Entity) and v.key else None,             # <<<<<<<<<<<<<<
 * 				"properties": properties
 * 			}
 */
    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Entity); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_v, __pyx_t_6); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L14_bool_binop_done;
    }
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_1 = __pyx_t_3;
    __pyx_L14_bool_binop_done:;
    if (__pyx_t_1) {
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pythonPropToJson); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_key); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_17 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_17)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_17);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      __pyx_t_6 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_17, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8);
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_u_keyValue); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 211, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_4 = __pyx_t_9;
      __pyx_t_9 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_4 = Py_None;
    }
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_key, __pyx_t_4) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "viur/datastore/transport.pyx":212
 * 			"entityValue": {
 * 				"key": pythonPropToJson(v.key)["keyValue"] if isinstance(v, Entity) and v.key else None,
 * 				"properties": properties             # <<<<<<<<<<<<<<
 * 			}
 * 		}
 */
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_properties, __pyx_v_properties) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_entityValue, __pyx_t_7) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":187
 * 			"timestampValue": v.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
 * 		}
 * 	elif isinstance(v, Entity):             # <<<<<<<<<<<<<<
 * 		excludedProperties: set = set(v.exclude_from_indexes)
 * 		properties = {}
 */
  }

  /* "viur/datastore/transport.pyx":215
 * 			}
 * 		}
 * 	elif isinstance(v, dict):             # <<<<<<<<<<<<<<
 * 		# We hande dicts separately as they don't have keys nor can keys be excluded from being indexed
 * 		return {
 */
  __pyx_t_1 = PyDict_Check(__pyx_v_v); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "viur/datastore/transport.pyx":217
 * 	elif isinstance(v, dict):
 * 		# We hande dicts separately as they don't have keys nor can keys be excluded from being indexed
 * 		return {             # <<<<<<<<<<<<<<
 * 			"entityValue": {
 * 				"key": None,
 */
    __Pyx_XDECREF(__pyx_r);

    /* "viur/datastore/transport.pyx":218
 * 		# We hande dicts separately as they don't have keys nor can keys be excluded from being indexed
 * 		return {
 * 			"entityValue": {             # <<<<<<<<<<<<<<
 * 				"key": None,
 * 				"properties": {
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "viur/datastore/transport.pyx":219
 * 		return {
 * 			"entityValue": {
 * 				"key": None,             # <<<<<<<<<<<<<<
 * 				"properties": {
 * 					dictKey: pythonPropToJson(dictValue) for dictKey, dictValue in v.items()
 */
    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_key, Py_None) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
    { /* enter inner scope */

      /* "viur/datastore/transport.pyx":220
 * 			"entityValue": {
 * 				"key": None,
 * 				"properties": {             # <<<<<<<<<<<<<<
 * 					dictKey: pythonPropToJson(dictValue) for dictKey, dictValue in v.items()
 * 				}
 */
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "viur/datastore/transport.pyx":221
 * 				"key": None,
 * 				"properties": {
 * 					dictKey: pythonPropToJson(dictValue) for dictKey, dictValue in v.items()             # <<<<<<<<<<<<<<
 * 				}
 * 			}
 */
      __pyx_t_11 = 0;
      if (unlikely(__pyx_v_v == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
        __PYX_ERR(0, 221, __pyx_L18_error)
      }
      __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_v, 0, __pyx_n_s_items, (&__pyx_t_10), (&__pyx_t_12)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_9);
      __pyx_t_9 = __pyx_t_6;
      __pyx_t_6 = 0;
      while (1) {
        __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_10, &__pyx_t_11, &__pyx_t_6, &__pyx_t_8, NULL, __pyx_t_12);
        if (unlikely(__pyx_t_13 == 0)) break;
        if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 221, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_dictKey, __pyx_t_6);
        __pyx_t_6 = 0;
        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_dictValue, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pythonPropToJson); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_17 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_17)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_8 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_17, __pyx_7genexpr__pyx_v_dictValue) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_7genexpr__pyx_v_dictValue);
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 221, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_7genexpr__pyx_v_dictKey, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 221, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_dictKey); __pyx_7genexpr__pyx_v_dictKey = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_dictValue); __pyx_7genexpr__pyx_v_dictValue = 0;
      goto __pyx_L21_exit_scope;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_dictKey); __pyx_7genexpr__pyx_v_dictKey = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_dictValue); __pyx_7genexpr__pyx_v_dictValue = 0;
      goto __pyx_L1_error;
      __pyx_L21_exit_scope:;
    } /* exit inner scope */
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_properties, __pyx_t_4) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_entityValue, __pyx_t_7) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":215
 * 			}
 * 		}
 * 	elif isinstance(v, dict):             # <<<<<<<<<<<<<<
 * 		# We hande dicts separately as they don't have keys nor can keys be excluded from being indexed
 * 		return {
 */
  }

  /* "viur/datastore/transport.pyx":225
 * 			}
 * 		}
 * 	elif isinstance(v, list):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"arrayValue": {
 */
  __pyx_t_3 = PyList_Check(__pyx_v_v); 
  __pyx_t_1 = (__pyx_t_3 != 0);
  if (__pyx_t_1) {

    /* "viur/datastore/transport.pyx":226
 * 		}
 * 	elif isinstance(v, list):
 * 		return {             # <<<<<<<<<<<<<<
 * 			"arrayValue": {
 * 				"values": [pythonPropToJson(x) for x in v]
 */
    __Pyx_XDECREF(__pyx_r);

    /* "viur/datastore/transport.pyx":227
 * 	elif isinstance(v, list):
 * 		return {
 * 			"arrayValue": {             # <<<<<<<<<<<<<<
 * 				"values": [pythonPropToJson(x) for x in v]
 * 			}
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "viur/datastore/transport.pyx":228
 * 		return {
 * 			"arrayValue": {
 * 				"values": [pythonPropToJson(x) for x in v]             # <<<<<<<<<<<<<<
 * 			}
 * 		}
 */
    __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    { /* enter inner scope */
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L24_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (likely(PyList_CheckExact(__pyx_v_v)) || PyTuple_CheckExact(__pyx_v_v)) {
        __pyx_t_9 = __pyx_v_v; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0;
        __pyx_t_15 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_v); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 228, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_15 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 228, __pyx_L24_error)
      }
      for (;;) {
        if (likely(!__pyx_t_15)) {
          if (likely(PyList_CheckExact(__pyx_t_9))) {
            if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 228, __pyx_L24_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 228, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 228, __pyx_L24_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 228, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_15(__pyx_t_9);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 228, __pyx_L24_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_x, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pythonPropToJson); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_17 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_17)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_8 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_17, __pyx_8genexpr1__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_8genexpr1__pyx_v_x);
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 228, __pyx_L24_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 228, __pyx_L24_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
      goto __pyx_L27_exit_scope;
      __pyx_L24_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
      goto __pyx_L1_error;
      __pyx_L27_exit_scope:;
    } /* exit inner scope */
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_values, __pyx_t_4) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_arrayValue, __pyx_t_7) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":225
 * 			}
 * 		}
 * 	elif isinstance(v, list):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"arrayValue": {
 */
  }

  /* "viur/datastore/transport.pyx":231
 * 			}
 * 		}
 * 	elif isinstance(v, bytes):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"blobValue": b64encode(v).decode("ASCII")
 */
  __pyx_t_1 = PyBytes_Check(__pyx_v_v); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "viur/datastore/transport.pyx":232
 * 		}
 * 	elif isinstance(v, bytes):
 * 		return {             # <<<<<<<<<<<<<<
 * 			"blobValue": b64encode(v).decode("ASCII")
 * 		}
 */
    __Pyx_XDECREF(__pyx_r);

    /* "viur/datastore/transport.pyx":233
 * 	elif isinstance(v, bytes):
 * 		return {
 * 			"blobValue": b64encode(v).decode("ASCII")             # <<<<<<<<<<<<<<
 * 		}
 * 	assert False, "%s (%s) is not supported" % (v, type(v))
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_b64encode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __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_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_v);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __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_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_4, __pyx_n_u_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_n_u_ASCII);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_blobValue, __pyx_t_7) < 0) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":231
 * 			}
 * 		}
 * 	elif isinstance(v, bytes):             # <<<<<<<<<<<<<<
 * 		return {
 * 			"blobValue": b64encode(v).decode("ASCII")
 */
  }

  /* "viur/datastore/transport.pyx":235
 * 			"blobValue": b64encode(v).decode("ASCII")
 * 		}
 * 	assert False, "%s (%s) is not supported" % (v, type(v))             # <<<<<<<<<<<<<<
 * 
 * cdef inline object toPyStr(stringView strView):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!0)) {
      __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = 0;
      __pyx_t_18 = 127;
      __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_v), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_18;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_);
      __pyx_t_10 += 2;
      __Pyx_GIVEREF(__pyx_kp_u_);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_kp_u_);
      __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_v))), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_18;
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_kp_u_is_not_supported);
      __pyx_t_10 += 18;
      __Pyx_GIVEREF(__pyx_kp_u_is_not_supported);
      PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_kp_u_is_not_supported);
      __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_5, 4, __pyx_t_10, __pyx_t_18); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      PyErr_SetObject(PyExc_AssertionError, __pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_ERR(0, 235, __pyx_L1_error)
    }
  }
  #endif

  /* "viur/datastore/transport.pyx":148
 * 	return res
 * 
 * def pythonPropToJson(v) -> dict:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Convert a python type to the object representation expected by the datastore rest API.
 */

  /* function exit code */
  __pyx_r = ((PyObject*)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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("viur.datastore.transport.pythonPropToJson", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_excludedProperties);
  __Pyx_XDECREF(__pyx_v_properties);
  __Pyx_XDECREF(__pyx_v_dictKey);
  __Pyx_XDECREF(__pyx_v_dictValue);
  __Pyx_XDECREF(__pyx_v_resList);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_resDict);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_dictKey);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_dictValue);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":237
 * 	assert False, "%s (%s) is not supported" % (v, type(v))
 * 
 * cdef inline object toPyStr(stringView strView):             # <<<<<<<<<<<<<<
 * 	"""
 * 		Converts a cpp stringview to a python str object
 */

static CYTHON_INLINE PyObject *__pyx_f_4viur_9datastore_9transport_toPyStr(std::string_view __pyx_v_strView) {
  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("toPyStr", 0);

  /* "viur/datastore/transport.pyx":243
 * 		:return: The corresponding python string object
 * 	"""
 * 	return PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 * 		strView.data(),
 * 		strView.length()
 */
  __Pyx_XDECREF(__pyx_r);

  /* "viur/datastore/transport.pyx":245
 * 	return PyUnicode_FromStringAndSize(
 * 		strView.data(),
 * 		strView.length()             # <<<<<<<<<<<<<<
 * 	)
 * 
 */
  __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_v_strView.data(), __pyx_v_strView.length()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "viur/datastore/transport.pyx":237
 * 	assert False, "%s (%s) is not supported" % (v, type(v))
 * 
 * cdef inline object toPyStr(stringView strView):             # <<<<<<<<<<<<<<
 * 	"""
 * 		Converts a cpp stringview to a python str object
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("viur.datastore.transport.toPyStr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":248
 * 	)
 * 
 * cdef inline object parseKey(simdjsonElement v):             # <<<<<<<<<<<<<<
 * 	"""
 * 		Parses a simdJsonObject representing a key to a datastore.Key instance.
 */

static CYTHON_INLINE PyObject *__pyx_f_4viur_9datastore_9transport_parseKey(simdjson::dom::element __pyx_v_v) {
  simdjson::dom::array __pyx_v_arr;
  simdjson::dom::array::iterator __pyx_v_arrayIt;
  simdjson::dom::array::iterator __pyx_v_arrayItEnd;
  PyObject *__pyx_v_pathArgs = NULL;
  simdjson::dom::element __pyx_v_element;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_pathElem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  simdjson::dom::element __pyx_t_2;
  simdjson::dom::array __pyx_t_3;
  int __pyx_t_4;
  std::string_view __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parseKey", 0);

  /* "viur/datastore/transport.pyx":257
 * 	cdef simdjsonArray arr
 * 	cdef simdjsonArray.iterator arrayIt, arrayItEnd
 * 	pathArgs = []             # <<<<<<<<<<<<<<
 * 	arr = v.at_key("path").get_array()
 * 	arrayIt = arr.begin()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pathArgs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":258
 * 	cdef simdjsonArray.iterator arrayIt, arrayItEnd
 * 	pathArgs = []
 * 	arr = v.at_key("path").get_array()             # <<<<<<<<<<<<<<
 * 	arrayIt = arr.begin()
 * 	arrayItEnd = arr.end()
 */
  try {
    __pyx_t_2 = __pyx_v_v.at_key(((char const *)"path"));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 258, __pyx_L1_error)
  }
  try {
    __pyx_t_3 = __pyx_t_2.get_array();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 258, __pyx_L1_error)
  }
  __pyx_v_arr = __pyx_t_3;

  /* "viur/datastore/transport.pyx":259
 * 	pathArgs = []
 * 	arr = v.at_key("path").get_array()
 * 	arrayIt = arr.begin()             # <<<<<<<<<<<<<<
 * 	arrayItEnd = arr.end()
 * 	while arrayIt != arrayItEnd:
 */
  __pyx_v_arrayIt = __pyx_v_arr.begin();

  /* "viur/datastore/transport.pyx":260
 * 	arr = v.at_key("path").get_array()
 * 	arrayIt = arr.begin()
 * 	arrayItEnd = arr.end()             # <<<<<<<<<<<<<<
 * 	while arrayIt != arrayItEnd:
 * 		element = dereference(arrayIt)
 */
  __pyx_v_arrayItEnd = __pyx_v_arr.end();

  /* "viur/datastore/transport.pyx":261
 * 	arrayIt = arr.begin()
 * 	arrayItEnd = arr.end()
 * 	while arrayIt != arrayItEnd:             # <<<<<<<<<<<<<<
 * 		element = dereference(arrayIt)
 * 		if element.at("id").error() == SUCCESS:
 */
  while (1) {
    __pyx_t_4 = ((__pyx_v_arrayIt != __pyx_v_arrayItEnd) != 0);
    if (!__pyx_t_4) break;

    /* "viur/datastore/transport.pyx":262
 * 	arrayItEnd = arr.end()
 * 	while arrayIt != arrayItEnd:
 * 		element = dereference(arrayIt)             # <<<<<<<<<<<<<<
 * 		if element.at("id").error() == SUCCESS:
 * 			pathArgs.append(
 */
    __pyx_v_element = (*__pyx_v_arrayIt);

    /* "viur/datastore/transport.pyx":263
 * 	while arrayIt != arrayItEnd:
 * 		element = dereference(arrayIt)
 * 		if element.at("id").error() == SUCCESS:             # <<<<<<<<<<<<<<
 * 			pathArgs.append(
 * 				(toPyStr(element.at_key("kind").get_string()), int(toPyStr(element.at_key("id").get_string())))
 */
    __pyx_t_4 = ((__pyx_v_element.at(((char const *)"id")).error() == simdjson::error_code::SUCCESS) != 0);
    if (__pyx_t_4) {

      /* "viur/datastore/transport.pyx":265
 * 		if element.at("id").error() == SUCCESS:
 * 			pathArgs.append(
 * 				(toPyStr(element.at_key("kind").get_string()), int(toPyStr(element.at_key("id").get_string())))             # <<<<<<<<<<<<<<
 * 			)
 * 		else:
 */
      try {
        __pyx_t_2 = __pyx_v_element.at_key(((char const *)"kind"));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 265, __pyx_L1_error)
      }
      try {
        __pyx_t_5 = __pyx_t_2.get_string();
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 265, __pyx_L1_error)
      }
      __pyx_t_1 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      try {
        __pyx_t_2 = __pyx_v_element.at_key(((char const *)"id"));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 265, __pyx_L1_error)
      }
      try {
        __pyx_t_5 = __pyx_t_2.get_string();
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 265, __pyx_L1_error)
      }
      __pyx_t_6 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
      __pyx_t_1 = 0;
      __pyx_t_7 = 0;

      /* "viur/datastore/transport.pyx":264
 * 		element = dereference(arrayIt)
 * 		if element.at("id").error() == SUCCESS:
 * 			pathArgs.append(             # <<<<<<<<<<<<<<
 * 				(toPyStr(element.at_key("kind").get_string()), int(toPyStr(element.at_key("id").get_string())))
 * 			)
 */
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_pathArgs, __pyx_t_6); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 264, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "viur/datastore/transport.pyx":263
 * 	while arrayIt != arrayItEnd:
 * 		element = dereference(arrayIt)
 * 		if element.at("id").error() == SUCCESS:             # <<<<<<<<<<<<<<
 * 			pathArgs.append(
 * 				(toPyStr(element.at_key("kind").get_string()), int(toPyStr(element.at_key("id").get_string())))
 */
      goto __pyx_L5;
    }

    /* "viur/datastore/transport.pyx":269
 * 		else:
 * 			# We don't expect to read incomplete keys from the datastore :)
 * 			pathArgs.append(             # <<<<<<<<<<<<<<
 * 				(toPyStr(element.at_key("kind").get_string()), toPyStr(element.at_key("name").get_string()))
 * 			)
 */
    /*else*/ {

      /* "viur/datastore/transport.pyx":270
 * 			# We don't expect to read incomplete keys from the datastore :)
 * 			pathArgs.append(
 * 				(toPyStr(element.at_key("kind").get_string()), toPyStr(element.at_key("name").get_string()))             # <<<<<<<<<<<<<<
 * 			)
 * 		preincrement(arrayIt)
 */
      try {
        __pyx_t_2 = __pyx_v_element.at_key(((char const *)"kind"));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 270, __pyx_L1_error)
      }
      try {
        __pyx_t_5 = __pyx_t_2.get_string();
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 270, __pyx_L1_error)
      }
      __pyx_t_6 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      try {
        __pyx_t_2 = __pyx_v_element.at_key(((char const *)"name"));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 270, __pyx_L1_error)
      }
      try {
        __pyx_t_5 = __pyx_t_2.get_string();
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 270, __pyx_L1_error)
      }
      __pyx_t_7 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;

      /* "viur/datastore/transport.pyx":269
 * 		else:
 * 			# We don't expect to read incomplete keys from the datastore :)
 * 			pathArgs.append(             # <<<<<<<<<<<<<<
 * 				(toPyStr(element.at_key("kind").get_string()), toPyStr(element.at_key("name").get_string()))
 * 			)
 */
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_pathArgs, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 269, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "viur/datastore/transport.pyx":272
 * 				(toPyStr(element.at_key("kind").get_string()), toPyStr(element.at_key("name").get_string()))
 * 			)
 * 		preincrement(arrayIt)             # <<<<<<<<<<<<<<
 * 	key = None
 * 	for pathElem in pathArgs:
 */
    (void)((++__pyx_v_arrayIt));
  }

  /* "viur/datastore/transport.pyx":273
 * 			)
 * 		preincrement(arrayIt)
 * 	key = None             # <<<<<<<<<<<<<<
 * 	for pathElem in pathArgs:
 * 		key = Key(*pathElem, parent=key)
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_key = Py_None;

  /* "viur/datastore/transport.pyx":274
 * 		preincrement(arrayIt)
 * 	key = None
 * 	for pathElem in pathArgs:             # <<<<<<<<<<<<<<
 * 		key = Key(*pathElem, parent=key)
 * 	return key
 */
  __pyx_t_1 = __pyx_v_pathArgs; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
  for (;;) {
    if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 274, __pyx_L1_error)
    #else
    __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_pathElem, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "viur/datastore/transport.pyx":275
 * 	key = None
 * 	for pathElem in pathArgs:
 * 		key = Key(*pathElem, parent=key)             # <<<<<<<<<<<<<<
 * 	return key
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Key); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_pathElem); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_parent, __pyx_v_key) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "viur/datastore/transport.pyx":274
 * 		preincrement(arrayIt)
 * 	key = None
 * 	for pathElem in pathArgs:             # <<<<<<<<<<<<<<
 * 		key = Key(*pathElem, parent=key)
 * 	return key
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":276
 * 	for pathElem in pathArgs:
 * 		key = Key(*pathElem, parent=key)
 * 	return key             # <<<<<<<<<<<<<<
 * 
 * cdef inline object toEntityStructure(simdjsonElement v, boolean_type isInitial = False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_key);
  __pyx_r = __pyx_v_key;
  goto __pyx_L0;

  /* "viur/datastore/transport.pyx":248
 * 	)
 * 
 * cdef inline object parseKey(simdjsonElement v):             # <<<<<<<<<<<<<<
 * 	"""
 * 		Parses a simdJsonObject representing a key to a datastore.Key instance.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("viur.datastore.transport.parseKey", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pathArgs);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_pathElem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":278
 * 	return key
 * 
 * cdef inline object toEntityStructure(simdjsonElement v, boolean_type isInitial = False):             # <<<<<<<<<<<<<<
 * 	"""
 * 		Parses a simdJsonElement into the corresponding python datatypes.
 */

static CYTHON_INLINE PyObject *__pyx_f_4viur_9datastore_9transport_toEntityStructure(simdjson::dom::element __pyx_v_v, struct __pyx_opt_args_4viur_9datastore_9transport_toEntityStructure *__pyx_optional_args) {
  bool __pyx_v_isInitial = ((bool)0);
  enum simdjson::dom::element_type __pyx_v_et;
  simdjson::dom::array::iterator __pyx_v_arrayIt;
  simdjson::dom::array::iterator __pyx_v_arrayItEnd;
  simdjson::dom::object::iterator __pyx_v_objIterStart;
  simdjson::dom::object::iterator __pyx_v_objIterStartInner;
  simdjson::dom::object::iterator __pyx_v_objIterEnd;
  simdjson::dom::object::iterator __pyx_v_objIterEndInner;
  simdjson::dom::element __pyx_v_element;
  simdjson::dom::object __pyx_v_outerObject;
  simdjson::dom::object __pyx_v_innerObject;
  std::string_view __pyx_v_strView;
  simdjson::simdjson_result<simdjson::dom::element> __pyx_v_tmpResult;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_excludeList = NULL;
  simdjson::dom::array __pyx_v_arr;
  int __pyx_v_allExcluded;
  PyObject *__pyx_v_dateStr = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_entity = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum simdjson::dom::element_type __pyx_t_1;
  simdjson::dom::object __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  simdjson::dom::array __pyx_t_8;
  bool __pyx_t_9;
  int __pyx_t_10;
  std::string_view __pyx_t_11;
  double __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  simdjson::dom::element __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toEntityStructure", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_isInitial = __pyx_optional_args->isInitial;
    }
  }

  /* "viur/datastore/transport.pyx":288
 * 			to avoid additional loops over objects.
 * 	"""
 * 	cdef simdjsonElementType et = v.type()             # <<<<<<<<<<<<<<
 * 	cdef simdjsonArray.iterator arrayIt, arrayItEnd
 * 	cdef simdjsonObject.iterator objIterStart, objIterStartInner, objIterEnd, objIterEndInner
 */
  try {
    __pyx_t_1 = __pyx_v_v.type();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 288, __pyx_L1_error)
  }
  __pyx_v_et = __pyx_t_1;

  /* "viur/datastore/transport.pyx":295
 * 	cdef stringView strView, bytesView
 * 	cdef simdjsonResult tmpResult
 * 	if et == OBJECT:             # <<<<<<<<<<<<<<
 * 		outerObject = v.get_object()
 * 		objIterStart = outerObject.begin()
 */
  switch (__pyx_v_et) {
    case simdjson::dom::element_type::OBJECT:

    /* "viur/datastore/transport.pyx":296
 * 	cdef simdjsonResult tmpResult
 * 	if et == OBJECT:
 * 		outerObject = v.get_object()             # <<<<<<<<<<<<<<
 * 		objIterStart = outerObject.begin()
 * 		objIterEnd = outerObject.end()
 */
    try {
      __pyx_t_2 = __pyx_v_v.get_object();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 296, __pyx_L1_error)
    }
    __pyx_v_outerObject = __pyx_t_2;

    /* "viur/datastore/transport.pyx":297
 * 	if et == OBJECT:
 * 		outerObject = v.get_object()
 * 		objIterStart = outerObject.begin()             # <<<<<<<<<<<<<<
 * 		objIterEnd = outerObject.end()
 * 		while objIterStart != objIterEnd:
 */
    __pyx_v_objIterStart = __pyx_v_outerObject.begin();

    /* "viur/datastore/transport.pyx":298
 * 		outerObject = v.get_object()
 * 		objIterStart = outerObject.begin()
 * 		objIterEnd = outerObject.end()             # <<<<<<<<<<<<<<
 * 		while objIterStart != objIterEnd:
 * 			strView = objIterStart.key()
 */
    __pyx_v_objIterEnd = __pyx_v_outerObject.end();

    /* "viur/datastore/transport.pyx":299
 * 		objIterStart = outerObject.begin()
 * 		objIterEnd = outerObject.end()
 * 		while objIterStart != objIterEnd:             # <<<<<<<<<<<<<<
 * 			strView = objIterStart.key()
 * 			if strView.compare("entity") == 0 or strView.compare("entityValue") == 0:
 */
    while (1) {
      __pyx_t_3 = ((__pyx_v_objIterStart != __pyx_v_objIterEnd) != 0);
      if (!__pyx_t_3) break;

      /* "viur/datastore/transport.pyx":300
 * 		objIterEnd = outerObject.end()
 * 		while objIterStart != objIterEnd:
 * 			strView = objIterStart.key()             # <<<<<<<<<<<<<<
 * 			if strView.compare("entity") == 0 or strView.compare("entityValue") == 0:
 * 				e = Entity()
 */
      __pyx_v_strView = __pyx_v_objIterStart.key();

      /* "viur/datastore/transport.pyx":301
 * 		while objIterStart != objIterEnd:
 * 			strView = objIterStart.key()
 * 			if strView.compare("entity") == 0 or strView.compare("entityValue") == 0:             # <<<<<<<<<<<<<<
 * 				e = Entity()
 * 				excludeList = set()
 */
      __pyx_t_4 = ((__pyx_v_strView.compare(((char *)"entity")) == 0) != 0);
      if (!__pyx_t_4) {
      } else {
        __pyx_t_3 = __pyx_t_4;
        goto __pyx_L6_bool_binop_done;
      }
      __pyx_t_4 = ((__pyx_v_strView.compare(((char *)"entityValue")) == 0) != 0);
      __pyx_t_3 = __pyx_t_4;
      __pyx_L6_bool_binop_done:;
      if (__pyx_t_3) {

        /* "viur/datastore/transport.pyx":302
 * 			strView = objIterStart.key()
 * 			if strView.compare("entity") == 0 or strView.compare("entityValue") == 0:
 * 				e = Entity()             # <<<<<<<<<<<<<<
 * 				excludeList = set()
 * 				tmpResult = objIterStart.value().at("key")
 */
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Entity); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(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, 302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_e = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "viur/datastore/transport.pyx":303
 * 			if strView.compare("entity") == 0 or strView.compare("entityValue") == 0:
 * 				e = Entity()
 * 				excludeList = set()             # <<<<<<<<<<<<<<
 * 				tmpResult = objIterStart.value().at("key")
 * 				if tmpResult.error() == SUCCESS:
 */
        __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_v_excludeList = ((PyObject*)__pyx_t_5);
        __pyx_t_5 = 0;

        /* "viur/datastore/transport.pyx":304
 * 				e = Entity()
 * 				excludeList = set()
 * 				tmpResult = objIterStart.value().at("key")             # <<<<<<<<<<<<<<
 * 				if tmpResult.error() == SUCCESS:
 * 					e.key = parseKey(tmpResult.value())
 */
        __pyx_v_tmpResult = __pyx_v_objIterStart.value().at(((char const *)"key"));

        /* "viur/datastore/transport.pyx":305
 * 				excludeList = set()
 * 				tmpResult = objIterStart.value().at("key")
 * 				if tmpResult.error() == SUCCESS:             # <<<<<<<<<<<<<<
 * 					e.key = parseKey(tmpResult.value())
 * 				tmpResult = objIterStart.value().at("properties")
 */
        __pyx_t_3 = ((__pyx_v_tmpResult.error() == simdjson::error_code::SUCCESS) != 0);
        if (__pyx_t_3) {

          /* "viur/datastore/transport.pyx":306
 * 				tmpResult = objIterStart.value().at("key")
 * 				if tmpResult.error() == SUCCESS:
 * 					e.key = parseKey(tmpResult.value())             # <<<<<<<<<<<<<<
 * 				tmpResult = objIterStart.value().at("properties")
 * 				if tmpResult.error() == SUCCESS:
 */
          __pyx_t_5 = __pyx_f_4viur_9datastore_9transport_parseKey(__pyx_v_tmpResult.value()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_e, __pyx_n_s_key, __pyx_t_5) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "viur/datastore/transport.pyx":305
 * 				excludeList = set()
 * 				tmpResult = objIterStart.value().at("key")
 * 				if tmpResult.error() == SUCCESS:             # <<<<<<<<<<<<<<
 * 					e.key = parseKey(tmpResult.value())
 * 				tmpResult = objIterStart.value().at("properties")
 */
        }

        /* "viur/datastore/transport.pyx":307
 * 				if tmpResult.error() == SUCCESS:
 * 					e.key = parseKey(tmpResult.value())
 * 				tmpResult = objIterStart.value().at("properties")             # <<<<<<<<<<<<<<
 * 				if tmpResult.error() == SUCCESS:
 * 					innerObject = tmpResult.value().get_object()
 */
        __pyx_v_tmpResult = __pyx_v_objIterStart.value().at(((char const *)"properties"));

        /* "viur/datastore/transport.pyx":308
 * 					e.key = parseKey(tmpResult.value())
 * 				tmpResult = objIterStart.value().at("properties")
 * 				if tmpResult.error() == SUCCESS:             # <<<<<<<<<<<<<<
 * 					innerObject = tmpResult.value().get_object()
 * 					objIterStartInner = innerObject.begin()
 */
        __pyx_t_3 = ((__pyx_v_tmpResult.error() == simdjson::error_code::SUCCESS) != 0);
        if (__pyx_t_3) {

          /* "viur/datastore/transport.pyx":309
 * 				tmpResult = objIterStart.value().at("properties")
 * 				if tmpResult.error() == SUCCESS:
 * 					innerObject = tmpResult.value().get_object()             # <<<<<<<<<<<<<<
 * 					objIterStartInner = innerObject.begin()
 * 					objIterEndInner = innerObject.end()
 */
          try {
            __pyx_t_2 = __pyx_v_tmpResult.value().get_object();
          } catch(...) {
            __Pyx_CppExn2PyErr();
            __PYX_ERR(0, 309, __pyx_L1_error)
          }
          __pyx_v_innerObject = __pyx_t_2;

          /* "viur/datastore/transport.pyx":310
 * 				if tmpResult.error() == SUCCESS:
 * 					innerObject = tmpResult.value().get_object()
 * 					objIterStartInner = innerObject.begin()             # <<<<<<<<<<<<<<
 * 					objIterEndInner = innerObject.end()
 * 					while objIterStartInner != objIterEndInner:
 */
          __pyx_v_objIterStartInner = __pyx_v_innerObject.begin();

          /* "viur/datastore/transport.pyx":311
 * 					innerObject = tmpResult.value().get_object()
 * 					objIterStartInner = innerObject.begin()
 * 					objIterEndInner = innerObject.end()             # <<<<<<<<<<<<<<
 * 					while objIterStartInner != objIterEndInner:
 * 						e[toPyStr(objIterStartInner.key())] = toEntityStructure(objIterStartInner.value())
 */
          __pyx_v_objIterEndInner = __pyx_v_innerObject.end();

          /* "viur/datastore/transport.pyx":312
 * 					objIterStartInner = innerObject.begin()
 * 					objIterEndInner = innerObject.end()
 * 					while objIterStartInner != objIterEndInner:             # <<<<<<<<<<<<<<
 * 						e[toPyStr(objIterStartInner.key())] = toEntityStructure(objIterStartInner.value())
 * 						if objIterStartInner.value().at("arrayValue").error() == SUCCESS and \
 */
          while (1) {
            __pyx_t_3 = ((__pyx_v_objIterStartInner != __pyx_v_objIterEndInner) != 0);
            if (!__pyx_t_3) break;

            /* "viur/datastore/transport.pyx":313
 * 					objIterEndInner = innerObject.end()
 * 					while objIterStartInner != objIterEndInner:
 * 						e[toPyStr(objIterStartInner.key())] = toEntityStructure(objIterStartInner.value())             # <<<<<<<<<<<<<<
 * 						if objIterStartInner.value().at("arrayValue").error() == SUCCESS and \
 * 							objIterStartInner.value().at("arrayValue").value().at("values").error() == SUCCESS:
 */
            __pyx_t_5 = __pyx_f_4viur_9datastore_9transport_toEntityStructure(__pyx_v_objIterStartInner.value(), NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_6 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_v_objIterStartInner.key()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            if (unlikely(PyObject_SetItem(__pyx_v_e, __pyx_t_6, __pyx_t_5) < 0)) __PYX_ERR(0, 313, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "viur/datastore/transport.pyx":314
 * 					while objIterStartInner != objIterEndInner:
 * 						e[toPyStr(objIterStartInner.key())] = toEntityStructure(objIterStartInner.value())
 * 						if objIterStartInner.value().at("arrayValue").error() == SUCCESS and \             # <<<<<<<<<<<<<<
 * 							objIterStartInner.value().at("arrayValue").value().at("values").error() == SUCCESS:
 * 							# We have to collect the non-indexed flag from the children of lists
 */
            __pyx_t_4 = ((__pyx_v_objIterStartInner.value().at(((char const *)"arrayValue")).error() == simdjson::error_code::SUCCESS) != 0);
            if (__pyx_t_4) {
            } else {
              __pyx_t_3 = __pyx_t_4;
              goto __pyx_L13_bool_binop_done;
            }

            /* "viur/datastore/transport.pyx":315
 * 						e[toPyStr(objIterStartInner.key())] = toEntityStructure(objIterStartInner.value())
 * 						if objIterStartInner.value().at("arrayValue").error() == SUCCESS and \
 * 							objIterStartInner.value().at("arrayValue").value().at("values").error() == SUCCESS:             # <<<<<<<<<<<<<<
 * 							# We have to collect the non-indexed flag from the children of lists
 * 							arr = objIterStartInner.value().at("arrayValue").value().at("values").value().get_array()
 */
            __pyx_t_4 = ((__pyx_v_objIterStartInner.value().at(((char const *)"arrayValue")).value().at(((char const *)"values")).error() == simdjson::error_code::SUCCESS) != 0);
            __pyx_t_3 = __pyx_t_4;
            __pyx_L13_bool_binop_done:;

            /* "viur/datastore/transport.pyx":314
 * 					while objIterStartInner != objIterEndInner:
 * 						e[toPyStr(objIterStartInner.key())] = toEntityStructure(objIterStartInner.value())
 * 						if objIterStartInner.value().at("arrayValue").error() == SUCCESS and \             # <<<<<<<<<<<<<<
 * 							objIterStartInner.value().at("arrayValue").value().at("values").error() == SUCCESS:
 * 							# We have to collect the non-indexed flag from the children of lists
 */
            if (__pyx_t_3) {

              /* "viur/datastore/transport.pyx":317
 * 							objIterStartInner.value().at("arrayValue").value().at("values").error() == SUCCESS:
 * 							# We have to collect the non-indexed flag from the children of lists
 * 							arr = objIterStartInner.value().at("arrayValue").value().at("values").value().get_array()             # <<<<<<<<<<<<<<
 * 							arrayIt = arr.begin()
 * 							arrayItEnd = arr.end()
 */
              try {
                __pyx_t_8 = __pyx_v_objIterStartInner.value().at(((char const *)"arrayValue")).value().at(((char const *)"values")).value().get_array();
              } catch(...) {
                __Pyx_CppExn2PyErr();
                __PYX_ERR(0, 317, __pyx_L1_error)
              }
              __pyx_v_arr = __pyx_t_8;

              /* "viur/datastore/transport.pyx":318
 * 							# We have to collect the non-indexed flag from the children of lists
 * 							arr = objIterStartInner.value().at("arrayValue").value().at("values").value().get_array()
 * 							arrayIt = arr.begin()             # <<<<<<<<<<<<<<
 * 							arrayItEnd = arr.end()
 * 							allExcluded = True
 */
              __pyx_v_arrayIt = __pyx_v_arr.begin();

              /* "viur/datastore/transport.pyx":319
 * 							arr = objIterStartInner.value().at("arrayValue").value().at("values").value().get_array()
 * 							arrayIt = arr.begin()
 * 							arrayItEnd = arr.end()             # <<<<<<<<<<<<<<
 * 							allExcluded = True
 * 							while arrayIt != arrayItEnd:
 */
              __pyx_v_arrayItEnd = __pyx_v_arr.end();

              /* "viur/datastore/transport.pyx":320
 * 							arrayIt = arr.begin()
 * 							arrayItEnd = arr.end()
 * 							allExcluded = True             # <<<<<<<<<<<<<<
 * 							while arrayIt != arrayItEnd:
 * 								element = dereference(arrayIt)
 */
              __pyx_v_allExcluded = 1;

              /* "viur/datastore/transport.pyx":321
 * 							arrayItEnd = arr.end()
 * 							allExcluded = True
 * 							while arrayIt != arrayItEnd:             # <<<<<<<<<<<<<<
 * 								element = dereference(arrayIt)
 * 								tmpResult = element.at("excludeFromIndexes")
 */
              while (1) {
                __pyx_t_3 = ((__pyx_v_arrayIt != __pyx_v_arrayItEnd) != 0);
                if (!__pyx_t_3) break;

                /* "viur/datastore/transport.pyx":322
 * 							allExcluded = True
 * 							while arrayIt != arrayItEnd:
 * 								element = dereference(arrayIt)             # <<<<<<<<<<<<<<
 * 								tmpResult = element.at("excludeFromIndexes")
 * 								if tmpResult.error() != SUCCESS or not tmpResult.value().get_bool():
 */
                __pyx_v_element = (*__pyx_v_arrayIt);

                /* "viur/datastore/transport.pyx":323
 * 							while arrayIt != arrayItEnd:
 * 								element = dereference(arrayIt)
 * 								tmpResult = element.at("excludeFromIndexes")             # <<<<<<<<<<<<<<
 * 								if tmpResult.error() != SUCCESS or not tmpResult.value().get_bool():
 * 									allExcluded = False
 */
                __pyx_v_tmpResult = __pyx_v_element.at(((char const *)"excludeFromIndexes"));

                /* "viur/datastore/transport.pyx":324
 * 								element = dereference(arrayIt)
 * 								tmpResult = element.at("excludeFromIndexes")
 * 								if tmpResult.error() != SUCCESS or not tmpResult.value().get_bool():             # <<<<<<<<<<<<<<
 * 									allExcluded = False
 * 									break
 */
                __pyx_t_4 = ((__pyx_v_tmpResult.error() != simdjson::error_code::SUCCESS) != 0);
                if (!__pyx_t_4) {
                } else {
                  __pyx_t_3 = __pyx_t_4;
                  goto __pyx_L18_bool_binop_done;
                }
                try {
                  __pyx_t_9 = __pyx_v_tmpResult.value().get_bool();
                } catch(...) {
                  __Pyx_CppExn2PyErr();
                  __PYX_ERR(0, 324, __pyx_L1_error)
                }
                __pyx_t_4 = ((!(__pyx_t_9 != 0)) != 0);
                __pyx_t_3 = __pyx_t_4;
                __pyx_L18_bool_binop_done:;
                if (__pyx_t_3) {

                  /* "viur/datastore/transport.pyx":325
 * 								tmpResult = element.at("excludeFromIndexes")
 * 								if tmpResult.error() != SUCCESS or not tmpResult.value().get_bool():
 * 									allExcluded = False             # <<<<<<<<<<<<<<
 * 									break
 * 								preincrement(arrayIt)
 */
                  __pyx_v_allExcluded = 0;

                  /* "viur/datastore/transport.pyx":326
 * 								if tmpResult.error() != SUCCESS or not tmpResult.value().get_bool():
 * 									allExcluded = False
 * 									break             # <<<<<<<<<<<<<<
 * 								preincrement(arrayIt)
 * 							if allExcluded:
 */
                  goto __pyx_L16_break;

                  /* "viur/datastore/transport.pyx":324
 * 								element = dereference(arrayIt)
 * 								tmpResult = element.at("excludeFromIndexes")
 * 								if tmpResult.error() != SUCCESS or not tmpResult.value().get_bool():             # <<<<<<<<<<<<<<
 * 									allExcluded = False
 * 									break
 */
                }

                /* "viur/datastore/transport.pyx":327
 * 									allExcluded = False
 * 									break
 * 								preincrement(arrayIt)             # <<<<<<<<<<<<<<
 * 							if allExcluded:
 * 								excludeList.add(toPyStr(objIterStartInner.key()))
 */
                (void)((++__pyx_v_arrayIt));
              }
              __pyx_L16_break:;

              /* "viur/datastore/transport.pyx":328
 * 									break
 * 								preincrement(arrayIt)
 * 							if allExcluded:             # <<<<<<<<<<<<<<
 * 								excludeList.add(toPyStr(objIterStartInner.key()))
 * 						else:
 */
              __pyx_t_3 = (__pyx_v_allExcluded != 0);
              if (__pyx_t_3) {

                /* "viur/datastore/transport.pyx":329
 * 								preincrement(arrayIt)
 * 							if allExcluded:
 * 								excludeList.add(toPyStr(objIterStartInner.key()))             # <<<<<<<<<<<<<<
 * 						else:
 * 							# For *all* other datatypes, we can simply check the dict it's defined in
 */
                __pyx_t_5 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_v_objIterStartInner.key()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_10 = PySet_Add(__pyx_v_excludeList, __pyx_t_5); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 329, __pyx_L1_error)
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                /* "viur/datastore/transport.pyx":328
 * 									break
 * 								preincrement(arrayIt)
 * 							if allExcluded:             # <<<<<<<<<<<<<<
 * 								excludeList.add(toPyStr(objIterStartInner.key()))
 * 						else:
 */
              }

              /* "viur/datastore/transport.pyx":314
 * 					while objIterStartInner != objIterEndInner:
 * 						e[toPyStr(objIterStartInner.key())] = toEntityStructure(objIterStartInner.value())
 * 						if objIterStartInner.value().at("arrayValue").error() == SUCCESS and \             # <<<<<<<<<<<<<<
 * 							objIterStartInner.value().at("arrayValue").value().at("values").error() == SUCCESS:
 * 							# We have to collect the non-indexed flag from the children of lists
 */
              goto __pyx_L12;
            }

            /* "viur/datastore/transport.pyx":332
 * 						else:
 * 							# For *all* other datatypes, we can simply check the dict it's defined in
 * 							tmpResult = objIterStartInner.value().at("excludeFromIndexes")             # <<<<<<<<<<<<<<
 * 							if tmpResult.error() == SUCCESS and tmpResult.value().get_bool():
 * 								excludeList.add(toPyStr(objIterStartInner.key()))
 */
            /*else*/ {
              __pyx_v_tmpResult = __pyx_v_objIterStartInner.value().at(((char const *)"excludeFromIndexes"));

              /* "viur/datastore/transport.pyx":333
 * 							# For *all* other datatypes, we can simply check the dict it's defined in
 * 							tmpResult = objIterStartInner.value().at("excludeFromIndexes")
 * 							if tmpResult.error() == SUCCESS and tmpResult.value().get_bool():             # <<<<<<<<<<<<<<
 * 								excludeList.add(toPyStr(objIterStartInner.key()))
 * 						preincrement(objIterStartInner)
 */
              __pyx_t_4 = ((__pyx_v_tmpResult.error() == simdjson::error_code::SUCCESS) != 0);
              if (__pyx_t_4) {
              } else {
                __pyx_t_3 = __pyx_t_4;
                goto __pyx_L22_bool_binop_done;
              }
              try {
                __pyx_t_9 = __pyx_v_tmpResult.value().get_bool();
              } catch(...) {
                __Pyx_CppExn2PyErr();
                __PYX_ERR(0, 333, __pyx_L1_error)
              }
              __pyx_t_4 = (__pyx_t_9 != 0);
              __pyx_t_3 = __pyx_t_4;
              __pyx_L22_bool_binop_done:;
              if (__pyx_t_3) {

                /* "viur/datastore/transport.pyx":334
 * 							tmpResult = objIterStartInner.value().at("excludeFromIndexes")
 * 							if tmpResult.error() == SUCCESS and tmpResult.value().get_bool():
 * 								excludeList.add(toPyStr(objIterStartInner.key()))             # <<<<<<<<<<<<<<
 * 						preincrement(objIterStartInner)
 * 				e.exclude_from_indexes = excludeList
 */
                __pyx_t_5 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_v_objIterStartInner.key()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_10 = PySet_Add(__pyx_v_excludeList, __pyx_t_5); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 334, __pyx_L1_error)
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                /* "viur/datastore/transport.pyx":333
 * 							# For *all* other datatypes, we can simply check the dict it's defined in
 * 							tmpResult = objIterStartInner.value().at("excludeFromIndexes")
 * 							if tmpResult.error() == SUCCESS and tmpResult.value().get_bool():             # <<<<<<<<<<<<<<
 * 								excludeList.add(toPyStr(objIterStartInner.key()))
 * 						preincrement(objIterStartInner)
 */
              }
            }
            __pyx_L12:;

            /* "viur/datastore/transport.pyx":335
 * 							if tmpResult.error() == SUCCESS and tmpResult.value().get_bool():
 * 								excludeList.add(toPyStr(objIterStartInner.key()))
 * 						preincrement(objIterStartInner)             # <<<<<<<<<<<<<<
 * 				e.exclude_from_indexes = excludeList
 * 				return e
 */
            (void)((++__pyx_v_objIterStartInner));
          }

          /* "viur/datastore/transport.pyx":308
 * 					e.key = parseKey(tmpResult.value())
 * 				tmpResult = objIterStart.value().at("properties")
 * 				if tmpResult.error() == SUCCESS:             # <<<<<<<<<<<<<<
 * 					innerObject = tmpResult.value().get_object()
 * 					objIterStartInner = innerObject.begin()
 */
        }

        /* "viur/datastore/transport.pyx":336
 * 								excludeList.add(toPyStr(objIterStartInner.key()))
 * 						preincrement(objIterStartInner)
 * 				e.exclude_from_indexes = excludeList             # <<<<<<<<<<<<<<
 * 				return e
 * 			elif (strView.compare("nullValue") == 0):
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_e, __pyx_n_s_exclude_from_indexes, __pyx_v_excludeList) < 0) __PYX_ERR(0, 336, __pyx_L1_error)

        /* "viur/datastore/transport.pyx":337
 * 						preincrement(objIterStartInner)
 * 				e.exclude_from_indexes = excludeList
 * 				return e             # <<<<<<<<<<<<<<
 * 			elif (strView.compare("nullValue") == 0):
 * 				return None
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_e);
        __pyx_r = __pyx_v_e;
        goto __pyx_L0;

        /* "viur/datastore/transport.pyx":301
 * 		while objIterStart != objIterEnd:
 * 			strView = objIterStart.key()
 * 			if strView.compare("entity") == 0 or strView.compare("entityValue") == 0:             # <<<<<<<<<<<<<<
 * 				e = Entity()
 * 				excludeList = set()
 */
      }

      /* "viur/datastore/transport.pyx":338
 * 				e.exclude_from_indexes = excludeList
 * 				return e
 * 			elif (strView.compare("nullValue") == 0):             # <<<<<<<<<<<<<<
 * 				return None
 * 			elif (strView.compare("stringValue") == 0):
 */
      __pyx_t_3 = ((__pyx_v_strView.compare(((char *)"nullValue")) == 0) != 0);
      if (__pyx_t_3) {

        /* "viur/datastore/transport.pyx":339
 * 				return e
 * 			elif (strView.compare("nullValue") == 0):
 * 				return None             # <<<<<<<<<<<<<<
 * 			elif (strView.compare("stringValue") == 0):
 * 				return toPyStr(objIterStart.value().get_string())
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

        /* "viur/datastore/transport.pyx":338
 * 				e.exclude_from_indexes = excludeList
 * 				return e
 * 			elif (strView.compare("nullValue") == 0):             # <<<<<<<<<<<<<<
 * 				return None
 * 			elif (strView.compare("stringValue") == 0):
 */
      }

      /* "viur/datastore/transport.pyx":340
 * 			elif (strView.compare("nullValue") == 0):
 * 				return None
 * 			elif (strView.compare("stringValue") == 0):             # <<<<<<<<<<<<<<
 * 				return toPyStr(objIterStart.value().get_string())
 * 			elif (strView.compare("doubleValue") == 0):
 */
      __pyx_t_3 = ((__pyx_v_strView.compare(((char *)"stringValue")) == 0) != 0);
      if (__pyx_t_3) {

        /* "viur/datastore/transport.pyx":341
 * 				return None
 * 			elif (strView.compare("stringValue") == 0):
 * 				return toPyStr(objIterStart.value().get_string())             # <<<<<<<<<<<<<<
 * 			elif (strView.compare("doubleValue") == 0):
 * 				return objIterStart.value().get_double()
 */
        __Pyx_XDECREF(__pyx_r);
        try {
          __pyx_t_11 = __pyx_v_objIterStart.value().get_string();
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 341, __pyx_L1_error)
        }
        __pyx_t_5 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;

        /* "viur/datastore/transport.pyx":340
 * 			elif (strView.compare("nullValue") == 0):
 * 				return None
 * 			elif (strView.compare("stringValue") == 0):             # <<<<<<<<<<<<<<
 * 				return toPyStr(objIterStart.value().get_string())
 * 			elif (strView.compare("doubleValue") == 0):
 */
      }

      /* "viur/datastore/transport.pyx":342
 * 			elif (strView.compare("stringValue") == 0):
 * 				return toPyStr(objIterStart.value().get_string())
 * 			elif (strView.compare("doubleValue") == 0):             # <<<<<<<<<<<<<<
 * 				return objIterStart.value().get_double()
 * 			elif (strView.compare("integerValue") == 0):
 */
      __pyx_t_3 = ((__pyx_v_strView.compare(((char *)"doubleValue")) == 0) != 0);
      if (__pyx_t_3) {

        /* "viur/datastore/transport.pyx":343
 * 				return toPyStr(objIterStart.value().get_string())
 * 			elif (strView.compare("doubleValue") == 0):
 * 				return objIterStart.value().get_double()             # <<<<<<<<<<<<<<
 * 			elif (strView.compare("integerValue") == 0):
 * 				return int(toPyStr(objIterStart.value().get_string()))
 */
        __Pyx_XDECREF(__pyx_r);
        try {
          __pyx_t_12 = __pyx_v_objIterStart.value().get_double();
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 343, __pyx_L1_error)
        }
        __pyx_t_5 = PyFloat_FromDouble(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;

        /* "viur/datastore/transport.pyx":342
 * 			elif (strView.compare("stringValue") == 0):
 * 				return toPyStr(objIterStart.value().get_string())
 * 			elif (strView.compare("doubleValue") == 0):             # <<<<<<<<<<<<<<
 * 				return objIterStart.value().get_double()
 * 			elif (strView.compare("integerValue") == 0):
 */
      }

      /* "viur/datastore/transport.pyx":344
 * 			elif (strView.compare("doubleValue") == 0):
 * 				return objIterStart.value().get_double()
 * 			elif (strView.compare("integerValue") == 0):             # <<<<<<<<<<<<<<
 * 				return int(toPyStr(objIterStart.value().get_string()))
 * 			elif (strView.compare("arrayValue") == 0):
 */
      __pyx_t_3 = ((__pyx_v_strView.compare(((char *)"integerValue")) == 0) != 0);
      if (__pyx_t_3) {

        /* "viur/datastore/transport.pyx":345
 * 				return objIterStart.value().get_double()
 * 			elif (strView.compare("integerValue") == 0):
 * 				return int(toPyStr(objIterStart.value().get_string()))             # <<<<<<<<<<<<<<
 * 			elif (strView.compare("arrayValue") == 0):
 * 				tmpResult = objIterStart.value().at("values")
 */
        __Pyx_XDECREF(__pyx_r);
        try {
          __pyx_t_11 = __pyx_v_objIterStart.value().get_string();
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 345, __pyx_L1_error)
        }
        __pyx_t_5 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L0;

        /* "viur/datastore/transport.pyx":344
 * 			elif (strView.compare("doubleValue") == 0):
 * 				return objIterStart.value().get_double()
 * 			elif (strView.compare("integerValue") == 0):             # <<<<<<<<<<<<<<
 * 				return int(toPyStr(objIterStart.value().get_string()))
 * 			elif (strView.compare("arrayValue") == 0):
 */
      }

      /* "viur/datastore/transport.pyx":346
 * 			elif (strView.compare("integerValue") == 0):
 * 				return int(toPyStr(objIterStart.value().get_string()))
 * 			elif (strView.compare("arrayValue") == 0):             # <<<<<<<<<<<<<<
 * 				tmpResult = objIterStart.value().at("values")
 * 				if tmpResult.error() == SUCCESS:
 */
      __pyx_t_3 = ((__pyx_v_strView.compare(((char *)"arrayValue")) == 0) != 0);
      if (__pyx_t_3) {

        /* "viur/datastore/transport.pyx":347
 * 				return int(toPyStr(objIterStart.value().get_string()))
 * 			elif (strView.compare("arrayValue") == 0):
 * 				tmpResult = objIterStart.value().at("values")             # <<<<<<<<<<<<<<
 * 				if tmpResult.error() == SUCCESS:
 * 					return toEntityStructure(tmpResult.value())
 */
        __pyx_v_tmpResult = __pyx_v_objIterStart.value().at(((char const *)"values"));

        /* "viur/datastore/transport.pyx":348
 * 			elif (strView.compare("arrayValue") == 0):
 * 				tmpResult = objIterStart.value().at("values")
 * 				if tmpResult.error() == SUCCESS:             # <<<<<<<<<<<<<<
 * 					return toEntityStructure(tmpResult.value())
 * 				else:
 */
        __pyx_t_3 = ((__pyx_v_tmpResult.error() == simdjson::error_code::SUCCESS) != 0);
        if (__pyx_t_3) {

          /* "viur/datastore/transport.pyx":349
 * 				tmpResult = objIterStart.value().at("values")
 * 				if tmpResult.error() == SUCCESS:
 * 					return toEntityStructure(tmpResult.value())             # <<<<<<<<<<<<<<
 * 				else:
 * 					return []
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_6 = __pyx_f_4viur_9datastore_9transport_toEntityStructure(__pyx_v_tmpResult.value(), NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_r = __pyx_t_6;
          __pyx_t_6 = 0;
          goto __pyx_L0;

          /* "viur/datastore/transport.pyx":348
 * 			elif (strView.compare("arrayValue") == 0):
 * 				tmpResult = objIterStart.value().at("values")
 * 				if tmpResult.error() == SUCCESS:             # <<<<<<<<<<<<<<
 * 					return toEntityStructure(tmpResult.value())
 * 				else:
 */
        }

        /* "viur/datastore/transport.pyx":351
 * 					return toEntityStructure(tmpResult.value())
 * 				else:
 * 					return []             # <<<<<<<<<<<<<<
 * 			elif (strView.compare("booleanValue") == 0):
 * 				return objIterStart.value().get_bool()
 */
        /*else*/ {
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_r = __pyx_t_6;
          __pyx_t_6 = 0;
          goto __pyx_L0;
        }

        /* "viur/datastore/transport.pyx":346
 * 			elif (strView.compare("integerValue") == 0):
 * 				return int(toPyStr(objIterStart.value().get_string()))
 * 			elif (strView.compare("arrayValue") == 0):             # <<<<<<<<<<<<<<
 * 				tmpResult = objIterStart.value().at("values")
 * 				if tmpResult.error() == SUCCESS:
 */
      }

      /* "viur/datastore/transport.pyx":352
 * 				else:
 * 					return []
 * 			elif (strView.compare("booleanValue") == 0):             # <<<<<<<<<<<<<<
 * 				return objIterStart.value().get_bool()
 * 			elif (strView.compare("timestampValue") == 0):
 */
      __pyx_t_3 = ((__pyx_v_strView.compare(((char *)"booleanValue")) == 0) != 0);
      if (__pyx_t_3) {

        /* "viur/datastore/transport.pyx":353
 * 					return []
 * 			elif (strView.compare("booleanValue") == 0):
 * 				return objIterStart.value().get_bool()             # <<<<<<<<<<<<<<
 * 			elif (strView.compare("timestampValue") == 0):
 * 				dateStr = toPyStr(objIterStart.value().get_string())[:-1]  # Strip "Z" at the end
 */
        __Pyx_XDECREF(__pyx_r);
        try {
          __pyx_t_9 = __pyx_v_objIterStart.value().get_bool();
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 353, __pyx_L1_error)
        }
        __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_r = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L0;

        /* "viur/datastore/transport.pyx":352
 * 				else:
 * 					return []
 * 			elif (strView.compare("booleanValue") == 0):             # <<<<<<<<<<<<<<
 * 				return objIterStart.value().get_bool()
 * 			elif (strView.compare("timestampValue") == 0):
 */
      }

      /* "viur/datastore/transport.pyx":354
 * 			elif (strView.compare("booleanValue") == 0):
 * 				return objIterStart.value().get_bool()
 * 			elif (strView.compare("timestampValue") == 0):             # <<<<<<<<<<<<<<
 * 				dateStr = toPyStr(objIterStart.value().get_string())[:-1]  # Strip "Z" at the end
 * 				if "." in dateStr:  # With milli-seconds
 */
      __pyx_t_3 = ((__pyx_v_strView.compare(((char *)"timestampValue")) == 0) != 0);
      if (__pyx_t_3) {

        /* "viur/datastore/transport.pyx":355
 * 				return objIterStart.value().get_bool()
 * 			elif (strView.compare("timestampValue") == 0):
 * 				dateStr = toPyStr(objIterStart.value().get_string())[:-1]  # Strip "Z" at the end             # <<<<<<<<<<<<<<
 * 				if "." in dateStr:  # With milli-seconds
 * 					return datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%S.%f").replace(tzinfo=timezone.utc)
 */
        try {
          __pyx_t_11 = __pyx_v_objIterStart.value().get_string();
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 355, __pyx_L1_error)
        }
        __pyx_t_6 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_6, 0, -1L, NULL, NULL, &__pyx_slice__2, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_dateStr = __pyx_t_5;
        __pyx_t_5 = 0;

        /* "viur/datastore/transport.pyx":356
 * 			elif (strView.compare("timestampValue") == 0):
 * 				dateStr = toPyStr(objIterStart.value().get_string())[:-1]  # Strip "Z" at the end
 * 				if "." in dateStr:  # With milli-seconds             # <<<<<<<<<<<<<<
 * 					return datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%S.%f").replace(tzinfo=timezone.utc)
 * 				else:
 */
        __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__3, __pyx_v_dateStr, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 356, __pyx_L1_error)
        __pyx_t_4 = (__pyx_t_3 != 0);
        if (__pyx_t_4) {

          /* "viur/datastore/transport.pyx":357
 * 				dateStr = toPyStr(objIterStart.value().get_string())[:-1]  # Strip "Z" at the end
 * 				if "." in dateStr:  # With milli-seconds
 * 					return datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%S.%f").replace(tzinfo=timezone.utc)             # <<<<<<<<<<<<<<
 * 				else:
 * 					return datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%S").replace(tzinfo=timezone.utc)
 */
          __Pyx_XDECREF(__pyx_r);
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strptime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = NULL;
          __pyx_t_13 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
              __pyx_t_13 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_dateStr, __pyx_kp_u_Y_m_dT_H_M_S_f};
            __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 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_6, __pyx_v_dateStr, __pyx_kp_u_Y_m_dT_H_M_S_f};
            __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_GOTREF(__pyx_t_5);
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 357, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            if (__pyx_t_6) {
              __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6); __pyx_t_6 = NULL;
            }
            __Pyx_INCREF(__pyx_v_dateStr);
            __Pyx_GIVEREF(__pyx_v_dateStr);
            PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_v_dateStr);
            __Pyx_INCREF(__pyx_kp_u_Y_m_dT_H_M_S_f);
            __Pyx_GIVEREF(__pyx_kp_u_Y_m_dT_H_M_S_f);
            PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_kp_u_Y_m_dT_H_M_S_f);
            __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_timezone); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 357, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_utc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_tzinfo, __pyx_t_6) < 0) __PYX_ERR(0, 357, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_r = __pyx_t_6;
          __pyx_t_6 = 0;
          goto __pyx_L0;

          /* "viur/datastore/transport.pyx":356
 * 			elif (strView.compare("timestampValue") == 0):
 * 				dateStr = toPyStr(objIterStart.value().get_string())[:-1]  # Strip "Z" at the end
 * 				if "." in dateStr:  # With milli-seconds             # <<<<<<<<<<<<<<
 * 					return datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%S.%f").replace(tzinfo=timezone.utc)
 * 				else:
 */
        }

        /* "viur/datastore/transport.pyx":359
 * 					return datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%S.%f").replace(tzinfo=timezone.utc)
 * 				else:
 * 					return datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%S").replace(tzinfo=timezone.utc)             # <<<<<<<<<<<<<<
 * 			elif (strView.compare("blobValue") == 0):
 * 				return b64decode(toPyStr(objIterStart.value().get_string()))
 */
        /*else*/ {
          __Pyx_XDECREF(__pyx_r);
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strptime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = NULL;
          __pyx_t_13 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(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_13 = 1;
            }
          }
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_dateStr, __pyx_kp_u_Y_m_dT_H_M_S};
            __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_dateStr, __pyx_kp_u_Y_m_dT_H_M_S};
            __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_6);
          } else
          #endif
          {
            __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 359, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_14);
            if (__pyx_t_5) {
              __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5); __pyx_t_5 = NULL;
            }
            __Pyx_INCREF(__pyx_v_dateStr);
            __Pyx_GIVEREF(__pyx_v_dateStr);
            PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_v_dateStr);
            __Pyx_INCREF(__pyx_kp_u_Y_m_dT_H_M_S);
            __Pyx_GIVEREF(__pyx_kp_u_Y_m_dT_H_M_S);
            PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_kp_u_Y_m_dT_H_M_S);
            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          }
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_timezone); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_utc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_tzinfo, __pyx_t_5) < 0) __PYX_ERR(0, 359, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __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;
          __pyx_r = __pyx_t_5;
          __pyx_t_5 = 0;
          goto __pyx_L0;
        }

        /* "viur/datastore/transport.pyx":354
 * 			elif (strView.compare("booleanValue") == 0):
 * 				return objIterStart.value().get_bool()
 * 			elif (strView.compare("timestampValue") == 0):             # <<<<<<<<<<<<<<
 * 				dateStr = toPyStr(objIterStart.value().get_string())[:-1]  # Strip "Z" at the end
 * 				if "." in dateStr:  # With milli-seconds
 */
      }

      /* "viur/datastore/transport.pyx":360
 * 				else:
 * 					return datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%S").replace(tzinfo=timezone.utc)
 * 			elif (strView.compare("blobValue") == 0):             # <<<<<<<<<<<<<<
 * 				return b64decode(toPyStr(objIterStart.value().get_string()))
 * 			elif (strView.compare("keyValue") == 0):
 */
      __pyx_t_4 = ((__pyx_v_strView.compare(((char *)"blobValue")) == 0) != 0);
      if (__pyx_t_4) {

        /* "viur/datastore/transport.pyx":361
 * 					return datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%S").replace(tzinfo=timezone.utc)
 * 			elif (strView.compare("blobValue") == 0):
 * 				return b64decode(toPyStr(objIterStart.value().get_string()))             # <<<<<<<<<<<<<<
 * 			elif (strView.compare("keyValue") == 0):
 * 				return parseKey(objIterStart.value())
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_b64decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        try {
          __pyx_t_11 = __pyx_v_objIterStart.value().get_string();
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 361, __pyx_L1_error)
        }
        __pyx_t_7 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        __pyx_t_5 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __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;

        /* "viur/datastore/transport.pyx":360
 * 				else:
 * 					return datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%S").replace(tzinfo=timezone.utc)
 * 			elif (strView.compare("blobValue") == 0):             # <<<<<<<<<<<<<<
 * 				return b64decode(toPyStr(objIterStart.value().get_string()))
 * 			elif (strView.compare("keyValue") == 0):
 */
      }

      /* "viur/datastore/transport.pyx":362
 * 			elif (strView.compare("blobValue") == 0):
 * 				return b64decode(toPyStr(objIterStart.value().get_string()))
 * 			elif (strView.compare("keyValue") == 0):             # <<<<<<<<<<<<<<
 * 				return parseKey(objIterStart.value())
 * 			elif (strView.compare("geoPointValue") == 0):
 */
      __pyx_t_4 = ((__pyx_v_strView.compare(((char *)"keyValue")) == 0) != 0);
      if (__pyx_t_4) {

        /* "viur/datastore/transport.pyx":363
 * 				return b64decode(toPyStr(objIterStart.value().get_string()))
 * 			elif (strView.compare("keyValue") == 0):
 * 				return parseKey(objIterStart.value())             # <<<<<<<<<<<<<<
 * 			elif (strView.compare("geoPointValue") == 0):
 * 				return objIterStart.value().at_key("latitude").get_double(), \
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __pyx_f_4viur_9datastore_9transport_parseKey(__pyx_v_objIterStart.value()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 363, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;

        /* "viur/datastore/transport.pyx":362
 * 			elif (strView.compare("blobValue") == 0):
 * 				return b64decode(toPyStr(objIterStart.value().get_string()))
 * 			elif (strView.compare("keyValue") == 0):             # <<<<<<<<<<<<<<
 * 				return parseKey(objIterStart.value())
 * 			elif (strView.compare("geoPointValue") == 0):
 */
      }

      /* "viur/datastore/transport.pyx":364
 * 			elif (strView.compare("keyValue") == 0):
 * 				return parseKey(objIterStart.value())
 * 			elif (strView.compare("geoPointValue") == 0):             # <<<<<<<<<<<<<<
 * 				return objIterStart.value().at_key("latitude").get_double(), \
 * 					   objIterStart.value().at_key("longitude").get_double()
 */
      __pyx_t_4 = ((__pyx_v_strView.compare(((char *)"geoPointValue")) == 0) != 0);
      if (__pyx_t_4) {

        /* "viur/datastore/transport.pyx":365
 * 				return parseKey(objIterStart.value())
 * 			elif (strView.compare("geoPointValue") == 0):
 * 				return objIterStart.value().at_key("latitude").get_double(), \             # <<<<<<<<<<<<<<
 * 					   objIterStart.value().at_key("longitude").get_double()
 * 			elif (strView.compare("excludeFromIndexes") == 0 or strView.compare("version") == 0):
 */
        __Pyx_XDECREF(__pyx_r);
        try {
          __pyx_t_15 = __pyx_v_objIterStart.value().at_key(((char const *)"latitude"));
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 365, __pyx_L1_error)
        }
        try {
          __pyx_t_12 = __pyx_t_15.get_double();
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 365, __pyx_L1_error)
        }
        __pyx_t_5 = PyFloat_FromDouble(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);

        /* "viur/datastore/transport.pyx":366
 * 			elif (strView.compare("geoPointValue") == 0):
 * 				return objIterStart.value().at_key("latitude").get_double(), \
 * 					   objIterStart.value().at_key("longitude").get_double()             # <<<<<<<<<<<<<<
 * 			elif (strView.compare("excludeFromIndexes") == 0 or strView.compare("version") == 0):
 * 				pass
 */
        try {
          __pyx_t_15 = __pyx_v_objIterStart.value().at_key(((char const *)"longitude"));
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 366, __pyx_L1_error)
        }
        try {
          __pyx_t_12 = __pyx_t_15.get_double();
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 366, __pyx_L1_error)
        }
        __pyx_t_6 = PyFloat_FromDouble(__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "viur/datastore/transport.pyx":365
 * 				return parseKey(objIterStart.value())
 * 			elif (strView.compare("geoPointValue") == 0):
 * 				return objIterStart.value().at_key("latitude").get_double(), \             # <<<<<<<<<<<<<<
 * 					   objIterStart.value().at_key("longitude").get_double()
 * 			elif (strView.compare("excludeFromIndexes") == 0 or strView.compare("version") == 0):
 */
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
        __pyx_t_5 = 0;
        __pyx_t_6 = 0;
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "viur/datastore/transport.pyx":364
 * 			elif (strView.compare("keyValue") == 0):
 * 				return parseKey(objIterStart.value())
 * 			elif (strView.compare("geoPointValue") == 0):             # <<<<<<<<<<<<<<
 * 				return objIterStart.value().at_key("latitude").get_double(), \
 * 					   objIterStart.value().at_key("longitude").get_double()
 */
      }

      /* "viur/datastore/transport.pyx":367
 * 				return objIterStart.value().at_key("latitude").get_double(), \
 * 					   objIterStart.value().at_key("longitude").get_double()
 * 			elif (strView.compare("excludeFromIndexes") == 0 or strView.compare("version") == 0):             # <<<<<<<<<<<<<<
 * 				pass
 * 			else:
 */
      __pyx_t_3 = ((__pyx_v_strView.compare(((char *)"excludeFromIndexes")) == 0) != 0);
      if (!__pyx_t_3) {
      } else {
        __pyx_t_4 = __pyx_t_3;
        goto __pyx_L26_bool_binop_done;
      }
      __pyx_t_3 = ((__pyx_v_strView.compare(((char *)"version")) == 0) != 0);
      __pyx_t_4 = __pyx_t_3;
      __pyx_L26_bool_binop_done:;
      if (likely(__pyx_t_4)) {
        goto __pyx_L5;
      }

      /* "viur/datastore/transport.pyx":370
 * 				pass
 * 			else:
 * 				raise ValueError("Invalid key in entity json: %s" % toPyStr(strView))             # <<<<<<<<<<<<<<
 * 	elif et == ARRAY:
 * 		arr = v.get_array()
 */
      /*else*/ {
        __pyx_t_7 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_v_strView); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Invalid_key_in_entity_json_s, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(0, 370, __pyx_L1_error)
      }
      __pyx_L5:;
    }

    /* "viur/datastore/transport.pyx":295
 * 	cdef stringView strView, bytesView
 * 	cdef simdjsonResult tmpResult
 * 	if et == OBJECT:             # <<<<<<<<<<<<<<
 * 		outerObject = v.get_object()
 * 		objIterStart = outerObject.begin()
 */
    break;
    case simdjson::dom::element_type::ARRAY:

    /* "viur/datastore/transport.pyx":372
 * 				raise ValueError("Invalid key in entity json: %s" % toPyStr(strView))
 * 	elif et == ARRAY:
 * 		arr = v.get_array()             # <<<<<<<<<<<<<<
 * 		arrayIt = arr.begin()
 * 		arrayItEnd = arr.end()
 */
    try {
      __pyx_t_8 = __pyx_v_v.get_array();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 372, __pyx_L1_error)
    }
    __pyx_v_arr = __pyx_t_8;

    /* "viur/datastore/transport.pyx":373
 * 	elif et == ARRAY:
 * 		arr = v.get_array()
 * 		arrayIt = arr.begin()             # <<<<<<<<<<<<<<
 * 		arrayItEnd = arr.end()
 * 		if isInitial:
 */
    __pyx_v_arrayIt = __pyx_v_arr.begin();

    /* "viur/datastore/transport.pyx":374
 * 		arr = v.get_array()
 * 		arrayIt = arr.begin()
 * 		arrayItEnd = arr.end()             # <<<<<<<<<<<<<<
 * 		if isInitial:
 * 			res = {}
 */
    __pyx_v_arrayItEnd = __pyx_v_arr.end();

    /* "viur/datastore/transport.pyx":375
 * 		arrayIt = arr.begin()
 * 		arrayItEnd = arr.end()
 * 		if isInitial:             # <<<<<<<<<<<<<<
 * 			res = {}
 * 		else:
 */
    __pyx_t_4 = (__pyx_v_isInitial != 0);
    if (__pyx_t_4) {

      /* "viur/datastore/transport.pyx":376
 * 		arrayItEnd = arr.end()
 * 		if isInitial:
 * 			res = {}             # <<<<<<<<<<<<<<
 * 		else:
 * 			res = []
 */
      __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_v_res = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "viur/datastore/transport.pyx":375
 * 		arrayIt = arr.begin()
 * 		arrayItEnd = arr.end()
 * 		if isInitial:             # <<<<<<<<<<<<<<
 * 			res = {}
 * 		else:
 */
      goto __pyx_L28;
    }

    /* "viur/datastore/transport.pyx":378
 * 			res = {}
 * 		else:
 * 			res = []             # <<<<<<<<<<<<<<
 * 		while arrayIt != arrayItEnd:
 * 			element = dereference(arrayIt)
 */
    /*else*/ {
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_v_res = __pyx_t_7;
      __pyx_t_7 = 0;
    }
    __pyx_L28:;

    /* "viur/datastore/transport.pyx":379
 * 		else:
 * 			res = []
 * 		while arrayIt != arrayItEnd:             # <<<<<<<<<<<<<<
 * 			element = dereference(arrayIt)
 * 			entity = toEntityStructure(element)
 */
    while (1) {
      __pyx_t_4 = ((__pyx_v_arrayIt != __pyx_v_arrayItEnd) != 0);
      if (!__pyx_t_4) break;

      /* "viur/datastore/transport.pyx":380
 * 			res = []
 * 		while arrayIt != arrayItEnd:
 * 			element = dereference(arrayIt)             # <<<<<<<<<<<<<<
 * 			entity = toEntityStructure(element)
 * 			if isInitial:
 */
      __pyx_v_element = (*__pyx_v_arrayIt);

      /* "viur/datastore/transport.pyx":381
 * 		while arrayIt != arrayItEnd:
 * 			element = dereference(arrayIt)
 * 			entity = toEntityStructure(element)             # <<<<<<<<<<<<<<
 * 			if isInitial:
 * 				res[entity.key] = entity
 */
      __pyx_t_7 = __pyx_f_4viur_9datastore_9transport_toEntityStructure(__pyx_v_element, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 381, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_entity, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "viur/datastore/transport.pyx":382
 * 			element = dereference(arrayIt)
 * 			entity = toEntityStructure(element)
 * 			if isInitial:             # <<<<<<<<<<<<<<
 * 				res[entity.key] = entity
 * 			else:
 */
      __pyx_t_4 = (__pyx_v_isInitial != 0);
      if (__pyx_t_4) {

        /* "viur/datastore/transport.pyx":383
 * 			entity = toEntityStructure(element)
 * 			if isInitial:
 * 				res[entity.key] = entity             # <<<<<<<<<<<<<<
 * 			else:
 * 				res.append(entity)
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_entity, __pyx_n_s_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 383, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (unlikely(PyObject_SetItem(__pyx_v_res, __pyx_t_7, __pyx_v_entity) < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "viur/datastore/transport.pyx":382
 * 			element = dereference(arrayIt)
 * 			entity = toEntityStructure(element)
 * 			if isInitial:             # <<<<<<<<<<<<<<
 * 				res[entity.key] = entity
 * 			else:
 */
        goto __pyx_L31;
      }

      /* "viur/datastore/transport.pyx":385
 * 				res[entity.key] = entity
 * 			else:
 * 				res.append(entity)             # <<<<<<<<<<<<<<
 * 			preincrement(arrayIt)
 * 		return res
 */
      /*else*/ {
        __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_res, __pyx_v_entity); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 385, __pyx_L1_error)
      }
      __pyx_L31:;

      /* "viur/datastore/transport.pyx":386
 * 			else:
 * 				res.append(entity)
 * 			preincrement(arrayIt)             # <<<<<<<<<<<<<<
 * 		return res
 * 
 */
      (void)((++__pyx_v_arrayIt));
    }

    /* "viur/datastore/transport.pyx":387
 * 				res.append(entity)
 * 			preincrement(arrayIt)
 * 		return res             # <<<<<<<<<<<<<<
 * 
 * cdef inline object toPythonStructure(simdjsonElement v):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":371
 * 			else:
 * 				raise ValueError("Invalid key in entity json: %s" % toPyStr(strView))
 * 	elif et == ARRAY:             # <<<<<<<<<<<<<<
 * 		arr = v.get_array()
 * 		arrayIt = arr.begin()
 */
    break;
    default: break;
  }

  /* "viur/datastore/transport.pyx":278
 * 	return key
 * 
 * cdef inline object toEntityStructure(simdjsonElement v, boolean_type isInitial = False):             # <<<<<<<<<<<<<<
 * 	"""
 * 		Parses a simdJsonElement into the corresponding python datatypes.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("viur.datastore.transport.toEntityStructure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_excludeList);
  __Pyx_XDECREF(__pyx_v_dateStr);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_entity);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":389
 * 		return res
 * 
 * cdef inline object toPythonStructure(simdjsonElement v):             # <<<<<<<<<<<<<<
 * 	# Convert json (sub-)tree to python objects
 * 	cdef simdjsonElementType et = v.type()
 */

static CYTHON_INLINE PyObject *__pyx_f_4viur_9datastore_9transport_toPythonStructure(simdjson::dom::element __pyx_v_v) {
  enum simdjson::dom::element_type __pyx_v_et;
  simdjson::dom::array::iterator __pyx_v_arrayIt;
  simdjson::dom::array::iterator __pyx_v_arrayItEnd;
  simdjson::dom::object::iterator __pyx_v_objIterStart;
  simdjson::dom::object::iterator __pyx_v_objIterEnd;
  simdjson::dom::element __pyx_v_element;
  simdjson::dom::object __pyx_v_Object;
  std::string_view __pyx_v_strView;
  PyObject *__pyx_v_res = NULL;
  simdjson::dom::array __pyx_v_arr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  enum simdjson::dom::element_type __pyx_t_1;
  simdjson::dom::object __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  simdjson::dom::array __pyx_t_6;
  int __pyx_t_7;
  std::string_view __pyx_t_8;
  int64_t __pyx_t_9;
  uint64_t __pyx_t_10;
  double __pyx_t_11;
  bool __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toPythonStructure", 0);

  /* "viur/datastore/transport.pyx":391
 * cdef inline object toPythonStructure(simdjsonElement v):
 * 	# Convert json (sub-)tree to python objects
 * 	cdef simdjsonElementType et = v.type()             # <<<<<<<<<<<<<<
 * 	cdef simdjsonArray.iterator arrayIt, arrayItEnd
 * 	cdef simdjsonObject.iterator objIterStart, objIterEnd
 */
  try {
    __pyx_t_1 = __pyx_v_v.type();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 391, __pyx_L1_error)
  }
  __pyx_v_et = __pyx_t_1;

  /* "viur/datastore/transport.pyx":397
 * 	cdef simdjsonObject Object
 * 	cdef stringView strView
 * 	if et == OBJECT:             # <<<<<<<<<<<<<<
 * 		Object = v.get_object()
 * 		objIterStart = Object.begin()
 */
  switch (__pyx_v_et) {
    case simdjson::dom::element_type::OBJECT:

    /* "viur/datastore/transport.pyx":398
 * 	cdef stringView strView
 * 	if et == OBJECT:
 * 		Object = v.get_object()             # <<<<<<<<<<<<<<
 * 		objIterStart = Object.begin()
 * 		objIterEnd = Object.end()
 */
    try {
      __pyx_t_2 = __pyx_v_v.get_object();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 398, __pyx_L1_error)
    }
    __pyx_v_Object = __pyx_t_2;

    /* "viur/datastore/transport.pyx":399
 * 	if et == OBJECT:
 * 		Object = v.get_object()
 * 		objIterStart = Object.begin()             # <<<<<<<<<<<<<<
 * 		objIterEnd = Object.end()
 * 		res = {}
 */
    __pyx_v_objIterStart = __pyx_v_Object.begin();

    /* "viur/datastore/transport.pyx":400
 * 		Object = v.get_object()
 * 		objIterStart = Object.begin()
 * 		objIterEnd = Object.end()             # <<<<<<<<<<<<<<
 * 		res = {}
 * 		while objIterStart != objIterEnd:
 */
    __pyx_v_objIterEnd = __pyx_v_Object.end();

    /* "viur/datastore/transport.pyx":401
 * 		objIterStart = Object.begin()
 * 		objIterEnd = Object.end()
 * 		res = {}             # <<<<<<<<<<<<<<
 * 		while objIterStart != objIterEnd:
 * 			strView = objIterStart.key()
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_res = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "viur/datastore/transport.pyx":402
 * 		objIterEnd = Object.end()
 * 		res = {}
 * 		while objIterStart != objIterEnd:             # <<<<<<<<<<<<<<
 * 			strView = objIterStart.key()
 * 			res[toPyStr(strView)] = toPythonStructure(objIterStart.value())
 */
    while (1) {
      __pyx_t_4 = ((__pyx_v_objIterStart != __pyx_v_objIterEnd) != 0);
      if (!__pyx_t_4) break;

      /* "viur/datastore/transport.pyx":403
 * 		res = {}
 * 		while objIterStart != objIterEnd:
 * 			strView = objIterStart.key()             # <<<<<<<<<<<<<<
 * 			res[toPyStr(strView)] = toPythonStructure(objIterStart.value())
 * 			preincrement(objIterStart)
 */
      __pyx_v_strView = __pyx_v_objIterStart.key();

      /* "viur/datastore/transport.pyx":404
 * 		while objIterStart != objIterEnd:
 * 			strView = objIterStart.key()
 * 			res[toPyStr(strView)] = toPythonStructure(objIterStart.value())             # <<<<<<<<<<<<<<
 * 			preincrement(objIterStart)
 * 		return res
 */
      __pyx_t_3 = __pyx_f_4viur_9datastore_9transport_toPythonStructure(__pyx_v_objIterStart.value()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_v_strView); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyObject_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_3) < 0)) __PYX_ERR(0, 404, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "viur/datastore/transport.pyx":405
 * 			strView = objIterStart.key()
 * 			res[toPyStr(strView)] = toPythonStructure(objIterStart.value())
 * 			preincrement(objIterStart)             # <<<<<<<<<<<<<<
 * 		return res
 * 	elif et == ARRAY:
 */
      (void)((++__pyx_v_objIterStart));
    }

    /* "viur/datastore/transport.pyx":406
 * 			res[toPyStr(strView)] = toPythonStructure(objIterStart.value())
 * 			preincrement(objIterStart)
 * 		return res             # <<<<<<<<<<<<<<
 * 	elif et == ARRAY:
 * 		arr = v.get_array()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":397
 * 	cdef simdjsonObject Object
 * 	cdef stringView strView
 * 	if et == OBJECT:             # <<<<<<<<<<<<<<
 * 		Object = v.get_object()
 * 		objIterStart = Object.begin()
 */
    break;
    case simdjson::dom::element_type::ARRAY:

    /* "viur/datastore/transport.pyx":408
 * 		return res
 * 	elif et == ARRAY:
 * 		arr = v.get_array()             # <<<<<<<<<<<<<<
 * 		arrayIt = arr.begin()
 * 		arrayItEnd = arr.end()
 */
    try {
      __pyx_t_6 = __pyx_v_v.get_array();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 408, __pyx_L1_error)
    }
    __pyx_v_arr = __pyx_t_6;

    /* "viur/datastore/transport.pyx":409
 * 	elif et == ARRAY:
 * 		arr = v.get_array()
 * 		arrayIt = arr.begin()             # <<<<<<<<<<<<<<
 * 		arrayItEnd = arr.end()
 * 		res = []
 */
    __pyx_v_arrayIt = __pyx_v_arr.begin();

    /* "viur/datastore/transport.pyx":410
 * 		arr = v.get_array()
 * 		arrayIt = arr.begin()
 * 		arrayItEnd = arr.end()             # <<<<<<<<<<<<<<
 * 		res = []
 * 		while arrayIt != arrayItEnd:
 */
    __pyx_v_arrayItEnd = __pyx_v_arr.end();

    /* "viur/datastore/transport.pyx":411
 * 		arrayIt = arr.begin()
 * 		arrayItEnd = arr.end()
 * 		res = []             # <<<<<<<<<<<<<<
 * 		while arrayIt != arrayItEnd:
 * 			element = dereference(arrayIt)
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_res = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "viur/datastore/transport.pyx":412
 * 		arrayItEnd = arr.end()
 * 		res = []
 * 		while arrayIt != arrayItEnd:             # <<<<<<<<<<<<<<
 * 			element = dereference(arrayIt)
 * 			res.append(toPythonStructure(element))
 */
    while (1) {
      __pyx_t_4 = ((__pyx_v_arrayIt != __pyx_v_arrayItEnd) != 0);
      if (!__pyx_t_4) break;

      /* "viur/datastore/transport.pyx":413
 * 		res = []
 * 		while arrayIt != arrayItEnd:
 * 			element = dereference(arrayIt)             # <<<<<<<<<<<<<<
 * 			res.append(toPythonStructure(element))
 * 			preincrement(arrayIt)
 */
      __pyx_v_element = (*__pyx_v_arrayIt);

      /* "viur/datastore/transport.pyx":414
 * 		while arrayIt != arrayItEnd:
 * 			element = dereference(arrayIt)
 * 			res.append(toPythonStructure(element))             # <<<<<<<<<<<<<<
 * 			preincrement(arrayIt)
 * 		return res
 */
      __pyx_t_3 = __pyx_f_4viur_9datastore_9transport_toPythonStructure(__pyx_v_element); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_res, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 414, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "viur/datastore/transport.pyx":415
 * 			element = dereference(arrayIt)
 * 			res.append(toPythonStructure(element))
 * 			preincrement(arrayIt)             # <<<<<<<<<<<<<<
 * 		return res
 * 	elif et == STRING:
 */
      (void)((++__pyx_v_arrayIt));
    }

    /* "viur/datastore/transport.pyx":416
 * 			res.append(toPythonStructure(element))
 * 			preincrement(arrayIt)
 * 		return res             # <<<<<<<<<<<<<<
 * 	elif et == STRING:
 * 		return toPyStr(v.get_string())
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":407
 * 			preincrement(objIterStart)
 * 		return res
 * 	elif et == ARRAY:             # <<<<<<<<<<<<<<
 * 		arr = v.get_array()
 * 		arrayIt = arr.begin()
 */
    break;
    case simdjson::dom::element_type::STRING:

    /* "viur/datastore/transport.pyx":418
 * 		return res
 * 	elif et == STRING:
 * 		return toPyStr(v.get_string())             # <<<<<<<<<<<<<<
 * 	elif et == INT64:
 * 		return v.get_int64()
 */
    __Pyx_XDECREF(__pyx_r);
    try {
      __pyx_t_8 = __pyx_v_v.get_string();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 418, __pyx_L1_error)
    }
    __pyx_t_3 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":417
 * 			preincrement(arrayIt)
 * 		return res
 * 	elif et == STRING:             # <<<<<<<<<<<<<<
 * 		return toPyStr(v.get_string())
 * 	elif et == INT64:
 */
    break;
    case simdjson::dom::element_type::INT64:

    /* "viur/datastore/transport.pyx":420
 * 		return toPyStr(v.get_string())
 * 	elif et == INT64:
 * 		return v.get_int64()             # <<<<<<<<<<<<<<
 * 	elif et == UINT64:
 * 		return v.get_uint64()
 */
    __Pyx_XDECREF(__pyx_r);
    try {
      __pyx_t_9 = __pyx_v_v.get_int64();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 420, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":419
 * 	elif et == STRING:
 * 		return toPyStr(v.get_string())
 * 	elif et == INT64:             # <<<<<<<<<<<<<<
 * 		return v.get_int64()
 * 	elif et == UINT64:
 */
    break;
    case simdjson::dom::element_type::UINT64:

    /* "viur/datastore/transport.pyx":422
 * 		return v.get_int64()
 * 	elif et == UINT64:
 * 		return v.get_uint64()             # <<<<<<<<<<<<<<
 * 	elif et == DOUBLE:
 * 		return v.get_double()
 */
    __Pyx_XDECREF(__pyx_r);
    try {
      __pyx_t_10 = __pyx_v_v.get_uint64();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 422, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":421
 * 	elif et == INT64:
 * 		return v.get_int64()
 * 	elif et == UINT64:             # <<<<<<<<<<<<<<
 * 		return v.get_uint64()
 * 	elif et == DOUBLE:
 */
    break;
    case simdjson::dom::element_type::DOUBLE:

    /* "viur/datastore/transport.pyx":424
 * 		return v.get_uint64()
 * 	elif et == DOUBLE:
 * 		return v.get_double()             # <<<<<<<<<<<<<<
 * 	elif et == NULL_VALUE:
 * 		return None
 */
    __Pyx_XDECREF(__pyx_r);
    try {
      __pyx_t_11 = __pyx_v_v.get_double();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 424, __pyx_L1_error)
    }
    __pyx_t_3 = PyFloat_FromDouble(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":423
 * 	elif et == UINT64:
 * 		return v.get_uint64()
 * 	elif et == DOUBLE:             # <<<<<<<<<<<<<<
 * 		return v.get_double()
 * 	elif et == NULL_VALUE:
 */
    break;
    case simdjson::dom::element_type::NULL_VALUE:

    /* "viur/datastore/transport.pyx":426
 * 		return v.get_double()
 * 	elif et == NULL_VALUE:
 * 		return None             # <<<<<<<<<<<<<<
 * 	elif et == BOOL:
 * 		return v.get_bool()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":425
 * 	elif et == DOUBLE:
 * 		return v.get_double()
 * 	elif et == NULL_VALUE:             # <<<<<<<<<<<<<<
 * 		return None
 * 	elif et == BOOL:
 */
    break;
    case simdjson::dom::element_type::BOOL:

    /* "viur/datastore/transport.pyx":428
 * 		return None
 * 	elif et == BOOL:
 * 		return v.get_bool()             # <<<<<<<<<<<<<<
 * 	else:
 * 		raise ValueError("Unknown type")
 */
    __Pyx_XDECREF(__pyx_r);
    try {
      __pyx_t_12 = __pyx_v_v.get_bool();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 428, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":427
 * 	elif et == NULL_VALUE:
 * 		return None
 * 	elif et == BOOL:             # <<<<<<<<<<<<<<
 * 		return v.get_bool()
 * 	else:
 */
    break;
    default:

    /* "viur/datastore/transport.pyx":430
 * 		return v.get_bool()
 * 	else:
 * 		raise ValueError("Unknown type")             # <<<<<<<<<<<<<<
 * 
 * def runSingleFilter(queryDefinition: QueryDefinition, limit: int) -> List[Entity]:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 430, __pyx_L1_error)
    break;
  }

  /* "viur/datastore/transport.pyx":389
 * 		return res
 * 
 * cdef inline object toPythonStructure(simdjsonElement v):             # <<<<<<<<<<<<<<
 * 	# Convert json (sub-)tree to python objects
 * 	cdef simdjsonElementType et = v.type()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("viur.datastore.transport.toPythonStructure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":432
 * 		raise ValueError("Unknown type")
 * 
 * def runSingleFilter(queryDefinition: QueryDefinition, limit: int) -> List[Entity]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs a single Query as defined by queryDefinition. The limit of the queryDefinition is ignored and must
 */

/* Python wrapper */
static PyObject *__pyx_pw_4viur_9datastore_9transport_7runSingleFilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4viur_9datastore_9transport_6runSingleFilter[] = "\n\t\tRuns a single Query as defined by queryDefinition. The limit of the queryDefinition is ignored and must\n\t\tbe specified separately to prevent _calculateInternalMultiQueryLimit from modifying the queryDefinition.\n\n\t\t:param queryDefinition: The query to run\n\t\t:param limit:  How many entities to return at maximum\n\t\t:return: The list of entities fetched from the datastore\n\t";
static PyMethodDef __pyx_mdef_4viur_9datastore_9transport_7runSingleFilter = {"runSingleFilter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4viur_9datastore_9transport_7runSingleFilter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4viur_9datastore_9transport_6runSingleFilter};
static PyObject *__pyx_pw_4viur_9datastore_9transport_7runSingleFilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_queryDefinition = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("runSingleFilter (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_queryDefinition,&__pyx_n_s_limit,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_queryDefinition)) != 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_limit)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("runSingleFilter", 1, 2, 2, 1); __PYX_ERR(0, 432, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "runSingleFilter") < 0)) __PYX_ERR(0, 432, __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_queryDefinition = values[0];
    __pyx_v_limit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("runSingleFilter", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 432, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("viur.datastore.transport.runSingleFilter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4viur_9datastore_9transport_6runSingleFilter(__pyx_self, __pyx_v_queryDefinition, __pyx_v_limit);

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

static PyObject *__pyx_pf_4viur_9datastore_9transport_6runSingleFilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_queryDefinition, PyObject *__pyx_v_limit) {
  simdjson::dom::parser __pyx_v_parser;
  Py_ssize_t __pyx_v_pysize;
  char *__pyx_v_data_ptr;
  simdjson::dom::element __pyx_v_element;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_internalStartCursor = NULL;
  PyObject *__pyx_v_flipResults = NULL;
  PyObject *__pyx_v_currentTxn = NULL;
  PyObject *__pyx_v_readOptions = NULL;
  PyObject *__pyx_v_postData = NULL;
  PyObject *__pyx_v_filterList = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_op = NULL;
  PyObject *__pyx_v_singleValue = NULL;
  PyObject *__pyx_v_req = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_sortOrder = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_distinctKey = 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;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  simdjson::dom::element __pyx_t_18;
  struct __pyx_opt_args_4viur_9datastore_9transport_toEntityStructure __pyx_t_19;
  std::string_view __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("runSingleFilter", 0);

  /* "viur/datastore/transport.pyx":441
 * 		:return: The list of entities fetched from the datastore
 * 	"""
 * 	cdef simdjsonParser parser = simdjsonParser()             # <<<<<<<<<<<<<<
 * 	cdef Py_ssize_t pysize
 * 	cdef char * data_ptr
 */
  __pyx_v_parser = simdjson::dom::parser();

  /* "viur/datastore/transport.pyx":445
 * 	cdef char * data_ptr
 * 	cdef simdjsonElement element
 * 	res = []             # <<<<<<<<<<<<<<
 * 	internalStartCursor = None  # Will be set if we need to fetch more than one batch
 * 	flipResults = False  # If set, we'll reverse the list returned (Sortorder was Inverted*)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":446
 * 	cdef simdjsonElement element
 * 	res = []
 * 	internalStartCursor = None  # Will be set if we need to fetch more than one batch             # <<<<<<<<<<<<<<
 * 	flipResults = False  # If set, we'll reverse the list returned (Sortorder was Inverted*)
 * 	currentTxn = currentTransaction.get()
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_internalStartCursor = Py_None;

  /* "viur/datastore/transport.pyx":447
 * 	res = []
 * 	internalStartCursor = None  # Will be set if we need to fetch more than one batch
 * 	flipResults = False  # If set, we'll reverse the list returned (Sortorder was Inverted*)             # <<<<<<<<<<<<<<
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:
 */
  __Pyx_INCREF(Py_False);
  __pyx_v_flipResults = Py_False;

  /* "viur/datastore/transport.pyx":448
 * 	internalStartCursor = None  # Will be set if we need to fetch more than one batch
 * 	flipResults = False  # If set, we'll reverse the list returned (Sortorder was Inverted*)
 * 	currentTxn = currentTransaction.get()             # <<<<<<<<<<<<<<
 * 	if currentTxn:
 * 		readOptions = {"transaction": currentTxn["key"]}
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_currentTransaction); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_currentTxn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":449
 * 	flipResults = False  # If set, we'll reverse the list returned (Sortorder was Inverted*)
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:             # <<<<<<<<<<<<<<
 * 		readOptions = {"transaction": currentTxn["key"]}
 * 	else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_currentTxn); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 449, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "viur/datastore/transport.pyx":450
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:
 * 		readOptions = {"transaction": currentTxn["key"]}             # <<<<<<<<<<<<<<
 * 	else:
 * 		readOptions = {"readConsistency": "STRONG"}
 */
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_currentTxn, __pyx_n_u_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_transaction, __pyx_t_3) < 0) __PYX_ERR(0, 450, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_readOptions = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "viur/datastore/transport.pyx":449
 * 	flipResults = False  # If set, we'll reverse the list returned (Sortorder was Inverted*)
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:             # <<<<<<<<<<<<<<
 * 		readOptions = {"transaction": currentTxn["key"]}
 * 	else:
 */
    goto __pyx_L3;
  }

  /* "viur/datastore/transport.pyx":452
 * 		readOptions = {"transaction": currentTxn["key"]}
 * 	else:
 * 		readOptions = {"readConsistency": "STRONG"}             # <<<<<<<<<<<<<<
 * 	while True:  # We might need to fetch more than one batch
 * 		postData = {
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_readConsistency, __pyx_n_u_STRONG) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
    __pyx_v_readOptions = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "viur/datastore/transport.pyx":453
 * 	else:
 * 		readOptions = {"readConsistency": "STRONG"}
 * 	while True:  # We might need to fetch more than one batch             # <<<<<<<<<<<<<<
 * 		postData = {
 * 			"partitionId": {
 */
  while (1) {

    /* "viur/datastore/transport.pyx":455
 * 	while True:  # We might need to fetch more than one batch
 * 		postData = {
 * 			"partitionId": {             # <<<<<<<<<<<<<<
 * 				"project_id": projectID,
 * 			},
 */
    __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "viur/datastore/transport.pyx":456
 * 		postData = {
 * 			"partitionId": {
 * 				"project_id": projectID,             # <<<<<<<<<<<<<<
 * 			},
 * 			"readOptions": readOptions,
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_projectID); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_project_id, __pyx_t_2) < 0) __PYX_ERR(0, 456, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_partitionId, __pyx_t_3) < 0) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "viur/datastore/transport.pyx":458
 * 				"project_id": projectID,
 * 			},
 * 			"readOptions": readOptions,             # <<<<<<<<<<<<<<
 * 			"query": {
 * 				"kind": [
 */
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_readOptions, __pyx_v_readOptions) < 0) __PYX_ERR(0, 455, __pyx_L1_error)

    /* "viur/datastore/transport.pyx":460
 * 			"readOptions": readOptions,
 * 			"query": {
 * 				"kind": [             # <<<<<<<<<<<<<<
 * 					{
 * 						"name": queryDefinition.kind,
 */
    __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "viur/datastore/transport.pyx":462
 * 				"kind": [
 * 					{
 * 						"name": queryDefinition.kind,             # <<<<<<<<<<<<<<
 * 					}
 * 				],
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_kind); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_name, __pyx_t_5) < 0) __PYX_ERR(0, 462, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "viur/datastore/transport.pyx":460
 * 			"readOptions": readOptions,
 * 			"query": {
 * 				"kind": [             # <<<<<<<<<<<<<<
 * 					{
 * 						"name": queryDefinition.kind,
 */
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_kind, __pyx_t_5) < 0) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "viur/datastore/transport.pyx":465
 * 					}
 * 				],
 * 				"limit": limit - len(res)             # <<<<<<<<<<<<<<
 * 			},
 * 		}
 */
    __pyx_t_6 = PyList_GET_SIZE(__pyx_v_res); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 465, __pyx_L1_error)
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyNumber_Subtract(__pyx_v_limit, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_limit, __pyx_t_2) < 0) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_query, __pyx_t_3) < 0) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_postData, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "viur/datastore/transport.pyx":468
 * 			},
 * 		}
 * 		if queryDefinition.filters:             # <<<<<<<<<<<<<<
 * 			filterList = []
 * 			for k, v in queryDefinition.filters.items():
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_filters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 468, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "viur/datastore/transport.pyx":469
 * 		}
 * 		if queryDefinition.filters:
 * 			filterList = []             # <<<<<<<<<<<<<<
 * 			for k, v in queryDefinition.filters.items():
 * 				key, op = k.split(" ")
 */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_filterList, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "viur/datastore/transport.pyx":470
 * 		if queryDefinition.filters:
 * 			filterList = []
 * 			for k, v in queryDefinition.filters.items():             # <<<<<<<<<<<<<<
 * 				key, op = k.split(" ")
 * 				if op == "=":
 */
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_filters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __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, 470, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_dict_iterator(__pyx_t_3, 0, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1);
      __pyx_t_1 = __pyx_t_2;
      __pyx_t_2 = 0;
      while (1) {
        __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_7, &__pyx_t_6, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_8);
        if (unlikely(__pyx_t_9 == 0)) break;
        if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 470, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "viur/datastore/transport.pyx":471
 * 			filterList = []
 * 			for k, v in queryDefinition.filters.items():
 * 				key, op = k.split(" ")             # <<<<<<<<<<<<<<
 * 				if op == "=":
 * 					op = "EQUAL"
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __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_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_u__5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u__5);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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, 471, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          #else
          __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 471, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 471, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
          index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_2);
          index = 1; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L9_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_5);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 471, __pyx_L1_error)
          __pyx_t_11 = NULL;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L10_unpacking_done;
          __pyx_L9_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 471, __pyx_L1_error)
          __pyx_L10_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_op, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "viur/datastore/transport.pyx":472
 * 			for k, v in queryDefinition.filters.items():
 * 				key, op = k.split(" ")
 * 				if op == "=":             # <<<<<<<<<<<<<<
 * 					op = "EQUAL"
 * 				elif op == "<":
 */
        __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_op, __pyx_kp_u__6, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 472, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "viur/datastore/transport.pyx":473
 * 				key, op = k.split(" ")
 * 				if op == "=":
 * 					op = "EQUAL"             # <<<<<<<<<<<<<<
 * 				elif op == "<":
 * 					op = "LESS_THAN"
 */
          __Pyx_INCREF(__pyx_n_u_EQUAL);
          __Pyx_DECREF_SET(__pyx_v_op, __pyx_n_u_EQUAL);

          /* "viur/datastore/transport.pyx":472
 * 			for k, v in queryDefinition.filters.items():
 * 				key, op = k.split(" ")
 * 				if op == "=":             # <<<<<<<<<<<<<<
 * 					op = "EQUAL"
 * 				elif op == "<":
 */
          goto __pyx_L11;
        }

        /* "viur/datastore/transport.pyx":474
 * 				if op == "=":
 * 					op = "EQUAL"
 * 				elif op == "<":             # <<<<<<<<<<<<<<
 * 					op = "LESS_THAN"
 * 				elif op == "<=":
 */
        __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_op, __pyx_kp_u__7, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 474, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "viur/datastore/transport.pyx":475
 * 					op = "EQUAL"
 * 				elif op == "<":
 * 					op = "LESS_THAN"             # <<<<<<<<<<<<<<
 * 				elif op == "<=":
 * 					op = "LESS_THAN_OR_EQUAL"
 */
          __Pyx_INCREF(__pyx_n_u_LESS_THAN);
          __Pyx_DECREF_SET(__pyx_v_op, __pyx_n_u_LESS_THAN);

          /* "viur/datastore/transport.pyx":474
 * 				if op == "=":
 * 					op = "EQUAL"
 * 				elif op == "<":             # <<<<<<<<<<<<<<
 * 					op = "LESS_THAN"
 * 				elif op == "<=":
 */
          goto __pyx_L11;
        }

        /* "viur/datastore/transport.pyx":476
 * 				elif op == "<":
 * 					op = "LESS_THAN"
 * 				elif op == "<=":             # <<<<<<<<<<<<<<
 * 					op = "LESS_THAN_OR_EQUAL"
 * 				elif op == ">":
 */
        __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_op, __pyx_kp_u__8, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 476, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "viur/datastore/transport.pyx":477
 * 					op = "LESS_THAN"
 * 				elif op == "<=":
 * 					op = "LESS_THAN_OR_EQUAL"             # <<<<<<<<<<<<<<
 * 				elif op == ">":
 * 					op = "GREATER_THAN"
 */
          __Pyx_INCREF(__pyx_n_u_LESS_THAN_OR_EQUAL);
          __Pyx_DECREF_SET(__pyx_v_op, __pyx_n_u_LESS_THAN_OR_EQUAL);

          /* "viur/datastore/transport.pyx":476
 * 				elif op == "<":
 * 					op = "LESS_THAN"
 * 				elif op == "<=":             # <<<<<<<<<<<<<<
 * 					op = "LESS_THAN_OR_EQUAL"
 * 				elif op == ">":
 */
          goto __pyx_L11;
        }

        /* "viur/datastore/transport.pyx":478
 * 				elif op == "<=":
 * 					op = "LESS_THAN_OR_EQUAL"
 * 				elif op == ">":             # <<<<<<<<<<<<<<
 * 					op = "GREATER_THAN"
 * 				elif op == ">=":
 */
        __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_op, __pyx_kp_u__9, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 478, __pyx_L1_error)
        if (__pyx_t_4) {

          /* "viur/datastore/transport.pyx":479
 * 					op = "LESS_THAN_OR_EQUAL"
 * 				elif op == ">":
 * 					op = "GREATER_THAN"             # <<<<<<<<<<<<<<
 * 				elif op == ">=":
 * 					op = "GREATER_THAN_OR_EQUAL"
 */
          __Pyx_INCREF(__pyx_n_u_GREATER_THAN);
          __Pyx_DECREF_SET(__pyx_v_op, __pyx_n_u_GREATER_THAN);

          /* "viur/datastore/transport.pyx":478
 * 				elif op == "<=":
 * 					op = "LESS_THAN_OR_EQUAL"
 * 				elif op == ">":             # <<<<<<<<<<<<<<
 * 					op = "GREATER_THAN"
 * 				elif op == ">=":
 */
          goto __pyx_L11;
        }

        /* "viur/datastore/transport.pyx":480
 * 				elif op == ">":
 * 					op = "GREATER_THAN"
 * 				elif op == ">=":             # <<<<<<<<<<<<<<
 * 					op = "GREATER_THAN_OR_EQUAL"
 * 				else:
 */
        __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_op, __pyx_kp_u__10, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 480, __pyx_L1_error)
        if (likely(__pyx_t_4)) {

          /* "viur/datastore/transport.pyx":481
 * 					op = "GREATER_THAN"
 * 				elif op == ">=":
 * 					op = "GREATER_THAN_OR_EQUAL"             # <<<<<<<<<<<<<<
 * 				else:
 * 					raise ValueError("Invalid op %s" % op)
 */
          __Pyx_INCREF(__pyx_n_u_GREATER_THAN_OR_EQUAL);
          __Pyx_DECREF_SET(__pyx_v_op, __pyx_n_u_GREATER_THAN_OR_EQUAL);

          /* "viur/datastore/transport.pyx":480
 * 				elif op == ">":
 * 					op = "GREATER_THAN"
 * 				elif op == ">=":             # <<<<<<<<<<<<<<
 * 					op = "GREATER_THAN_OR_EQUAL"
 * 				else:
 */
          goto __pyx_L11;
        }

        /* "viur/datastore/transport.pyx":483
 * 					op = "GREATER_THAN_OR_EQUAL"
 * 				else:
 * 					raise ValueError("Invalid op %s" % op)             # <<<<<<<<<<<<<<
 * 				if not isinstance(v, list):
 * 					# An entity can have a list of values for a single property, so it's possible to enforce
 */
        /*else*/ {
          __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_Invalid_op_s, __pyx_v_op); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_Raise(__pyx_t_5, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __PYX_ERR(0, 483, __pyx_L1_error)
        }
        __pyx_L11:;

        /* "viur/datastore/transport.pyx":484
 * 				else:
 * 					raise ValueError("Invalid op %s" % op)
 * 				if not isinstance(v, list):             # <<<<<<<<<<<<<<
 * 					# An entity can have a list of values for a single property, so it's possible to enforce
 * 					# more an one constraint for a a single property (e.g. x==5 and x==7 can be true), so
 */
        __pyx_t_4 = PyList_Check(__pyx_v_v); 
        __pyx_t_12 = ((!(__pyx_t_4 != 0)) != 0);
        if (__pyx_t_12) {

          /* "viur/datastore/transport.pyx":488
 * 					# more an one constraint for a a single property (e.g. x==5 and x==7 can be true), so
 * 					# enforce we always have a list here
 * 					v = [v]             # <<<<<<<<<<<<<<
 * 				for singleValue in v:
 * 					filterList.append({
 */
          __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_v_v);
          __Pyx_GIVEREF(__pyx_v_v);
          PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_v);
          __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "viur/datastore/transport.pyx":484
 * 				else:
 * 					raise ValueError("Invalid op %s" % op)
 * 				if not isinstance(v, list):             # <<<<<<<<<<<<<<
 * 					# An entity can have a list of values for a single property, so it's possible to enforce
 * 					# more an one constraint for a a single property (e.g. x==5 and x==7 can be true), so
 */
        }

        /* "viur/datastore/transport.pyx":489
 * 					# enforce we always have a list here
 * 					v = [v]
 * 				for singleValue in v:             # <<<<<<<<<<<<<<
 * 					filterList.append({
 * 						"propertyFilter": {
 */
        if (likely(PyList_CheckExact(__pyx_v_v)) || PyTuple_CheckExact(__pyx_v_v)) {
          __pyx_t_5 = __pyx_v_v; __Pyx_INCREF(__pyx_t_5); __pyx_t_13 = 0;
          __pyx_t_14 = NULL;
        } else {
          __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 489, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 489, __pyx_L1_error)
        }
        for (;;) {
          if (likely(!__pyx_t_14)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 489, __pyx_L1_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            } else {
              if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 489, __pyx_L1_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            }
          } else {
            __pyx_t_3 = __pyx_t_14(__pyx_t_5);
            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, 489, __pyx_L1_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_XDECREF_SET(__pyx_v_singleValue, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "viur/datastore/transport.pyx":491
 * 				for singleValue in v:
 * 					filterList.append({
 * 						"propertyFilter": {             # <<<<<<<<<<<<<<
 * 							"property": {
 * 								"name": key,
 */
          __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);

          /* "viur/datastore/transport.pyx":492
 * 					filterList.append({
 * 						"propertyFilter": {
 * 							"property": {             # <<<<<<<<<<<<<<
 * 								"name": key,
 * 							},
 */
          __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);

          /* "viur/datastore/transport.pyx":493
 * 						"propertyFilter": {
 * 							"property": {
 * 								"name": key,             # <<<<<<<<<<<<<<
 * 							},
 * 							"op": op,
 */
          __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 493, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (PyDict_SetItem(__pyx_t_10, __pyx_n_u_name, __pyx_v_key) < 0) __PYX_ERR(0, 493, __pyx_L1_error)
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_property, __pyx_t_10) < 0) __PYX_ERR(0, 492, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "viur/datastore/transport.pyx":495
 * 								"name": key,
 * 							},
 * 							"op": op,             # <<<<<<<<<<<<<<
 * 							"value": pythonPropToJson(singleValue)
 * 						}
 */
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_op, __pyx_v_op) < 0) __PYX_ERR(0, 492, __pyx_L1_error)

          /* "viur/datastore/transport.pyx":496
 * 							},
 * 							"op": op,
 * 							"value": pythonPropToJson(singleValue)             # <<<<<<<<<<<<<<
 * 						}
 * 					})
 */
          __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_pythonPropToJson); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 496, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_16 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15);
            if (likely(__pyx_t_16)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_16);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_15, function);
            }
          }
          __pyx_t_10 = (__pyx_t_16) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_16, __pyx_v_singleValue) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_v_singleValue);
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 496, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_value, __pyx_t_10) < 0) __PYX_ERR(0, 492, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_propertyFilter, __pyx_t_2) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "viur/datastore/transport.pyx":490
 * 					v = [v]
 * 				for singleValue in v:
 * 					filterList.append({             # <<<<<<<<<<<<<<
 * 						"propertyFilter": {
 * 							"property": {
 */
          __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_filterList, __pyx_t_3); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 490, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "viur/datastore/transport.pyx":489
 * 					# enforce we always have a list here
 * 					v = [v]
 * 				for singleValue in v:             # <<<<<<<<<<<<<<
 * 					filterList.append({
 * 						"propertyFilter": {
 */
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "viur/datastore/transport.pyx":499
 * 						}
 * 					})
 * 			if len(filterList) == 1:  # Special, single filter             # <<<<<<<<<<<<<<
 * 				postData["query"]["filter"] = filterList[0]
 * 			else:
 */
      __pyx_t_7 = PyList_GET_SIZE(__pyx_v_filterList); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 499, __pyx_L1_error)
      __pyx_t_12 = ((__pyx_t_7 == 1) != 0);
      if (__pyx_t_12) {

        /* "viur/datastore/transport.pyx":500
 * 					})
 * 			if len(filterList) == 1:  # Special, single filter
 * 				postData["query"]["filter"] = filterList[0]             # <<<<<<<<<<<<<<
 * 			else:
 * 				postData["query"]["filter"] = {
 */
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_filterList, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_postData, __pyx_n_u_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_filter, __pyx_t_1) < 0)) __PYX_ERR(0, 500, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "viur/datastore/transport.pyx":499
 * 						}
 * 					})
 * 			if len(filterList) == 1:  # Special, single filter             # <<<<<<<<<<<<<<
 * 				postData["query"]["filter"] = filterList[0]
 * 			else:
 */
        goto __pyx_L15;
      }

      /* "viur/datastore/transport.pyx":503
 * 			else:
 * 				postData["query"]["filter"] = {
 * 					"compositeFilter": {             # <<<<<<<<<<<<<<
 * 						"op": "AND",
 * 						"filters": filterList
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);

        /* "viur/datastore/transport.pyx":504
 * 				postData["query"]["filter"] = {
 * 					"compositeFilter": {
 * 						"op": "AND",             # <<<<<<<<<<<<<<
 * 						"filters": filterList
 * 					}
 */
        __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_op, __pyx_n_u_AND) < 0) __PYX_ERR(0, 504, __pyx_L1_error)

        /* "viur/datastore/transport.pyx":505
 * 					"compositeFilter": {
 * 						"op": "AND",
 * 						"filters": filterList             # <<<<<<<<<<<<<<
 * 					}
 * 				}
 */
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_filters, __pyx_v_filterList) < 0) __PYX_ERR(0, 504, __pyx_L1_error)
        if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_compositeFilter, __pyx_t_5) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "viur/datastore/transport.pyx":502
 * 				postData["query"]["filter"] = filterList[0]
 * 			else:
 * 				postData["query"]["filter"] = {             # <<<<<<<<<<<<<<
 * 					"compositeFilter": {
 * 						"op": "AND",
 */
        __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_postData, __pyx_n_u_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_filter, __pyx_t_1) < 0)) __PYX_ERR(0, 502, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L15:;

      /* "viur/datastore/transport.pyx":468
 * 			},
 * 		}
 * 		if queryDefinition.filters:             # <<<<<<<<<<<<<<
 * 			filterList = []
 * 			for k, v in queryDefinition.filters.items():
 */
    }

    /* "viur/datastore/transport.pyx":508
 * 					}
 * 				}
 * 		if queryDefinition.orders:             # <<<<<<<<<<<<<<
 * 			postData["query"]["order"] = [
 * 				{
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_orders); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_12) {

      /* "viur/datastore/transport.pyx":509
 * 				}
 * 		if queryDefinition.orders:
 * 			postData["query"]["order"] = [             # <<<<<<<<<<<<<<
 * 				{
 * 					"property": {"name": sortOrder[0]},
 */
      { /* enter inner scope */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_1);

        /* "viur/datastore/transport.pyx":513
 * 					"property": {"name": sortOrder[0]},
 * 					"direction": "ASCENDING" if sortOrder[1].value in [1, 4] else "DESCENDING"
 * 				} for sortOrder in queryDefinition.orders             # <<<<<<<<<<<<<<
 * 			]
 * 			flipResults = queryDefinition.orders[0][1].value > 2  # Either InvertedAscending or InvertedDescending
 */
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_orders); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L19_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
          __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
          __pyx_t_14 = NULL;
        } else {
          __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 513, __pyx_L19_error)
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        for (;;) {
          if (likely(!__pyx_t_14)) {
            if (likely(PyList_CheckExact(__pyx_t_3))) {
              if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 513, __pyx_L19_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            } else {
              if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 513, __pyx_L19_error)
              #else
              __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            }
          } else {
            __pyx_t_5 = __pyx_t_14(__pyx_t_3);
            if (unlikely(!__pyx_t_5)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                else __PYX_ERR(0, 513, __pyx_L19_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_sortOrder, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "viur/datastore/transport.pyx":511
 * 			postData["query"]["order"] = [
 * 				{
 * 					"property": {"name": sortOrder[0]},             # <<<<<<<<<<<<<<
 * 					"direction": "ASCENDING" if sortOrder[1].value in [1, 4] else "DESCENDING"
 * 				} for sortOrder in queryDefinition.orders
 */
          __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_10 = __Pyx_GetItemInt(__pyx_8genexpr2__pyx_v_sortOrder, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 511, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_10);
          if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_name, __pyx_t_10) < 0) __PYX_ERR(0, 511, __pyx_L19_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_property, __pyx_t_2) < 0) __PYX_ERR(0, 511, __pyx_L19_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "viur/datastore/transport.pyx":512
 * 				{
 * 					"property": {"name": sortOrder[0]},
 * 					"direction": "ASCENDING" if sortOrder[1].value in [1, 4] else "DESCENDING"             # <<<<<<<<<<<<<<
 * 				} for sortOrder in queryDefinition.orders
 * 			]
 */
          __pyx_t_10 = __Pyx_GetItemInt(__pyx_8genexpr2__pyx_v_sortOrder, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 512, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_value); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 512, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __Pyx_PyInt_EqObjC(__pyx_t_15, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 512, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 512, __pyx_L19_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (!__pyx_t_4) {
          } else {
            __pyx_t_12 = __pyx_t_4;
            goto __pyx_L22_bool_binop_done;
          }
          __pyx_t_10 = __Pyx_PyInt_EqObjC(__pyx_t_15, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 512, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 512, __pyx_L19_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_12 = __pyx_t_4;
          __pyx_L22_bool_binop_done:;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if ((__pyx_t_12 != 0)) {
            __Pyx_INCREF(__pyx_n_u_ASCENDING);
            __pyx_t_2 = __pyx_n_u_ASCENDING;
          } else {
            __Pyx_INCREF(__pyx_n_u_DESCENDING);
            __pyx_t_2 = __pyx_n_u_DESCENDING;
          }
          if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_direction, __pyx_t_2) < 0) __PYX_ERR(0, 511, __pyx_L19_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 509, __pyx_L19_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "viur/datastore/transport.pyx":513
 * 					"property": {"name": sortOrder[0]},
 * 					"direction": "ASCENDING" if sortOrder[1].value in [1, 4] else "DESCENDING"
 * 				} for sortOrder in queryDefinition.orders             # <<<<<<<<<<<<<<
 * 			]
 * 			flipResults = queryDefinition.orders[0][1].value > 2  # Either InvertedAscending or InvertedDescending
 */
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_sortOrder); __pyx_8genexpr2__pyx_v_sortOrder = 0;
        goto __pyx_L24_exit_scope;
        __pyx_L19_error:;
        __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_sortOrder); __pyx_8genexpr2__pyx_v_sortOrder = 0;
        goto __pyx_L1_error;
        __pyx_L24_exit_scope:;
      } /* exit inner scope */

      /* "viur/datastore/transport.pyx":509
 * 				}
 * 		if queryDefinition.orders:
 * 			postData["query"]["order"] = [             # <<<<<<<<<<<<<<
 * 				{
 * 					"property": {"name": sortOrder[0]},
 */
      __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_postData, __pyx_n_u_query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_n_u_order, __pyx_t_1) < 0)) __PYX_ERR(0, 509, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "viur/datastore/transport.pyx":515
 * 				} for sortOrder in queryDefinition.orders
 * 			]
 * 			flipResults = queryDefinition.orders[0][1].value > 2  # Either InvertedAscending or InvertedDescending             # <<<<<<<<<<<<<<
 * 		if queryDefinition.distinct:
 * 			postData["query"]["distinctOn"] = [
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_orders); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_flipResults, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "viur/datastore/transport.pyx":508
 * 					}
 * 				}
 * 		if queryDefinition.orders:             # <<<<<<<<<<<<<<
 * 			postData["query"]["order"] = [
 * 				{
 */
    }

    /* "viur/datastore/transport.pyx":516
 * 			]
 * 			flipResults = queryDefinition.orders[0][1].value > 2  # Either InvertedAscending or InvertedDescending
 * 		if queryDefinition.distinct:             # <<<<<<<<<<<<<<
 * 			postData["query"]["distinctOn"] = [
 * 				{
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_distinct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 516, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_12) {

      /* "viur/datastore/transport.pyx":517
 * 			flipResults = queryDefinition.orders[0][1].value > 2  # Either InvertedAscending or InvertedDescending
 * 		if queryDefinition.distinct:
 * 			postData["query"]["distinctOn"] = [             # <<<<<<<<<<<<<<
 * 				{
 * 					"name": distinctKey
 */
      { /* enter inner scope */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_1);

        /* "viur/datastore/transport.pyx":520
 * 				{
 * 					"name": distinctKey
 * 				} for distinctKey in queryDefinition.distinct             # <<<<<<<<<<<<<<
 * 			]
 * 		if queryDefinition.startCursor or internalStartCursor:
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_distinct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L28_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
          __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
          __pyx_t_14 = NULL;
        } else {
          __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L28_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 520, __pyx_L28_error)
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        for (;;) {
          if (likely(!__pyx_t_14)) {
            if (likely(PyList_CheckExact(__pyx_t_5))) {
              if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 520, __pyx_L28_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L28_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            } else {
              if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 520, __pyx_L28_error)
              #else
              __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L28_error)
              __Pyx_GOTREF(__pyx_t_3);
              #endif
            }
          } else {
            __pyx_t_3 = __pyx_t_14(__pyx_t_5);
            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, 520, __pyx_L28_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_distinctKey, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "viur/datastore/transport.pyx":519
 * 			postData["query"]["distinctOn"] = [
 * 				{
 * 					"name": distinctKey             # <<<<<<<<<<<<<<
 * 				} for distinctKey in queryDefinition.distinct
 * 			]
 */
          __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L28_error)
          __Pyx_GOTREF(__pyx_t_3);
          if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_name, __pyx_8genexpr3__pyx_v_distinctKey) < 0) __PYX_ERR(0, 519, __pyx_L28_error)
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 517, __pyx_L28_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "viur/datastore/transport.pyx":520
 * 				{
 * 					"name": distinctKey
 * 				} for distinctKey in queryDefinition.distinct             # <<<<<<<<<<<<<<
 * 			]
 * 		if queryDefinition.startCursor or internalStartCursor:
 */
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_distinctKey); __pyx_8genexpr3__pyx_v_distinctKey = 0;
        goto __pyx_L31_exit_scope;
        __pyx_L28_error:;
        __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_distinctKey); __pyx_8genexpr3__pyx_v_distinctKey = 0;
        goto __pyx_L1_error;
        __pyx_L31_exit_scope:;
      } /* exit inner scope */

      /* "viur/datastore/transport.pyx":517
 * 			flipResults = queryDefinition.orders[0][1].value > 2  # Either InvertedAscending or InvertedDescending
 * 		if queryDefinition.distinct:
 * 			postData["query"]["distinctOn"] = [             # <<<<<<<<<<<<<<
 * 				{
 * 					"name": distinctKey
 */
      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_postData, __pyx_n_u_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_distinctOn, __pyx_t_1) < 0)) __PYX_ERR(0, 517, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "viur/datastore/transport.pyx":516
 * 			]
 * 			flipResults = queryDefinition.orders[0][1].value > 2  # Either InvertedAscending or InvertedDescending
 * 		if queryDefinition.distinct:             # <<<<<<<<<<<<<<
 * 			postData["query"]["distinctOn"] = [
 * 				{
 */
    }

    /* "viur/datastore/transport.pyx":522
 * 				} for distinctKey in queryDefinition.distinct
 * 			]
 * 		if queryDefinition.startCursor or internalStartCursor:             # <<<<<<<<<<<<<<
 * 			postData["query"]["startCursor"] = internalStartCursor or queryDefinition.startCursor
 * 		if queryDefinition.endCursor:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_startCursor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 522, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_4) {
    } else {
      __pyx_t_12 = __pyx_t_4;
      goto __pyx_L33_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_internalStartCursor); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 522, __pyx_L1_error)
    __pyx_t_12 = __pyx_t_4;
    __pyx_L33_bool_binop_done:;
    if (__pyx_t_12) {

      /* "viur/datastore/transport.pyx":523
 * 			]
 * 		if queryDefinition.startCursor or internalStartCursor:
 * 			postData["query"]["startCursor"] = internalStartCursor or queryDefinition.startCursor             # <<<<<<<<<<<<<<
 * 		if queryDefinition.endCursor:
 * 			postData["query"]["endCursor"] = queryDefinition.endCursor
 */
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_internalStartCursor); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
      if (!__pyx_t_12) {
      } else {
        __Pyx_INCREF(__pyx_v_internalStartCursor);
        __pyx_t_1 = __pyx_v_internalStartCursor;
        goto __pyx_L35_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_startCursor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_1 = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_L35_bool_binop_done:;
      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_postData, __pyx_n_u_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_startCursor, __pyx_t_1) < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "viur/datastore/transport.pyx":522
 * 				} for distinctKey in queryDefinition.distinct
 * 			]
 * 		if queryDefinition.startCursor or internalStartCursor:             # <<<<<<<<<<<<<<
 * 			postData["query"]["startCursor"] = internalStartCursor or queryDefinition.startCursor
 * 		if queryDefinition.endCursor:
 */
    }

    /* "viur/datastore/transport.pyx":524
 * 		if queryDefinition.startCursor or internalStartCursor:
 * 			postData["query"]["startCursor"] = internalStartCursor or queryDefinition.startCursor
 * 		if queryDefinition.endCursor:             # <<<<<<<<<<<<<<
 * 			postData["query"]["endCursor"] = queryDefinition.endCursor
 * 		req = authenticatedRequest(
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_endCursor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_12) {

      /* "viur/datastore/transport.pyx":525
 * 			postData["query"]["startCursor"] = internalStartCursor or queryDefinition.startCursor
 * 		if queryDefinition.endCursor:
 * 			postData["query"]["endCursor"] = queryDefinition.endCursor             # <<<<<<<<<<<<<<
 * 		req = authenticatedRequest(
 * 			url="https://datastore.googleapis.com/v1/projects/%s:runQuery" % projectID,
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_endCursor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_postData, __pyx_n_u_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_u_endCursor, __pyx_t_1) < 0)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "viur/datastore/transport.pyx":524
 * 		if queryDefinition.startCursor or internalStartCursor:
 * 			postData["query"]["startCursor"] = internalStartCursor or queryDefinition.startCursor
 * 		if queryDefinition.endCursor:             # <<<<<<<<<<<<<<
 * 			postData["query"]["endCursor"] = queryDefinition.endCursor
 * 		req = authenticatedRequest(
 */
    }

    /* "viur/datastore/transport.pyx":526
 * 		if queryDefinition.endCursor:
 * 			postData["query"]["endCursor"] = queryDefinition.endCursor
 * 		req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 			url="https://datastore.googleapis.com/v1/projects/%s:runQuery" % projectID,
 * 			data=json.dumps(postData).encode("UTF-8"),
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_authenticatedRequest); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "viur/datastore/transport.pyx":527
 * 			postData["query"]["endCursor"] = queryDefinition.endCursor
 * 		req = authenticatedRequest(
 * 			url="https://datastore.googleapis.com/v1/projects/%s:runQuery" % projectID,             # <<<<<<<<<<<<<<
 * 			data=json.dumps(postData).encode("UTF-8"),
 * 		)
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_projectID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_https_datastore_googleapis_com_v, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_url, __pyx_t_2) < 0) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "viur/datastore/transport.pyx":528
 * 		req = authenticatedRequest(
 * 			url="https://datastore.googleapis.com/v1/projects/%s:runQuery" % projectID,
 * 			data=json.dumps(postData).encode("UTF-8"),             # <<<<<<<<<<<<<<
 * 		)
 * 		if req.status_code != 200:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_json); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_dumps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_15 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_15)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_15);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_3 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_15, __pyx_v_postData) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_postData);
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_3, __pyx_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_kp_u_UTF_8);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_data, __pyx_t_2) < 0) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "viur/datastore/transport.pyx":526
 * 		if queryDefinition.endCursor:
 * 			postData["query"]["endCursor"] = queryDefinition.endCursor
 * 		req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 			url="https://datastore.googleapis.com/v1/projects/%s:runQuery" % projectID,
 * 			data=json.dumps(postData).encode("UTF-8"),
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_req, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "viur/datastore/transport.pyx":530
 * 			data=json.dumps(postData).encode("UTF-8"),
 * 		)
 * 		if req.status_code != 200:             # <<<<<<<<<<<<<<
 * 			print("INVALID STATUS CODE RECEIVED")
 * 			print(req.content)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_status_code); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyInt_NeObjC(__pyx_t_2, __pyx_int_200, 0xC8, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 530, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__pyx_t_12)) {

      /* "viur/datastore/transport.pyx":531
 * 		)
 * 		if req.status_code != 200:
 * 			print("INVALID STATUS CODE RECEIVED")             # <<<<<<<<<<<<<<
 * 			print(req.content)
 * 			pprint.pprint(json.loads(req.content))
 */
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "viur/datastore/transport.pyx":532
 * 		if req.status_code != 200:
 * 			print("INVALID STATUS CODE RECEIVED")
 * 			print(req.content)             # <<<<<<<<<<<<<<
 * 			pprint.pprint(json.loads(req.content))
 * 			raise ValueError("Invalid status code received from Datastore API")
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __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;

      /* "viur/datastore/transport.pyx":533
 * 			print("INVALID STATUS CODE RECEIVED")
 * 			print(req.content)
 * 			pprint.pprint(json.loads(req.content))             # <<<<<<<<<<<<<<
 * 			raise ValueError("Invalid status code received from Datastore API")
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pprint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pprint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_json); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_loads); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_15 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      __pyx_t_5 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_15, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __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_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_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __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_2)) __PYX_ERR(0, 533, __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;

      /* "viur/datastore/transport.pyx":534
 * 			print(req.content)
 * 			pprint.pprint(json.loads(req.content))
 * 			raise ValueError("Invalid status code received from Datastore API")             # <<<<<<<<<<<<<<
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 534, __pyx_L1_error)

      /* "viur/datastore/transport.pyx":530
 * 			data=json.dumps(postData).encode("UTF-8"),
 * 		)
 * 		if req.status_code != 200:             # <<<<<<<<<<<<<<
 * 			print("INVALID STATUS CODE RECEIVED")
 * 			print(req.content)
 */
    }

    /* "viur/datastore/transport.pyx":535
 * 			pprint.pprint(json.loads(req.content))
 * 			raise ValueError("Invalid status code received from Datastore API")
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1             # <<<<<<<<<<<<<<
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if element.at("batch").error() != SUCCESS:
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyBytes_AsStringAndSize(__pyx_t_2, (&__pyx_v_data_ptr), (&__pyx_v_pysize)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 535, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!((__pyx_t_8 != -1L) != 0))) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(0, 535, __pyx_L1_error)
      }
    }
    #endif

    /* "viur/datastore/transport.pyx":536
 * 			raise ValueError("Invalid status code received from Datastore API")
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)             # <<<<<<<<<<<<<<
 * 		if element.at("batch").error() != SUCCESS:
 * 			print("INVALID RESPONSE RECEIVED")
 */
    try {
      __pyx_t_18 = __pyx_v_parser.parse(__pyx_v_data_ptr, __pyx_v_pysize, 1);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 536, __pyx_L1_error)
    }
    __pyx_v_element = __pyx_t_18;

    /* "viur/datastore/transport.pyx":537
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if element.at("batch").error() != SUCCESS:             # <<<<<<<<<<<<<<
 * 			print("INVALID RESPONSE RECEIVED")
 * 			pprint.pprint(json.loads(req.content))
 */
    __pyx_t_12 = ((__pyx_v_element.at(((char const *)"batch")).error() != simdjson::error_code::SUCCESS) != 0);
    if (__pyx_t_12) {

      /* "viur/datastore/transport.pyx":538
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if element.at("batch").error() != SUCCESS:
 * 			print("INVALID RESPONSE RECEIVED")             # <<<<<<<<<<<<<<
 * 			pprint.pprint(json.loads(req.content))
 * 		#	res.update(toEntityStructure(element.at_key("batch"), isInitial=True))
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "viur/datastore/transport.pyx":539
 * 		if element.at("batch").error() != SUCCESS:
 * 			print("INVALID RESPONSE RECEIVED")
 * 			pprint.pprint(json.loads(req.content))             # <<<<<<<<<<<<<<
 * 		#	res.update(toEntityStructure(element.at_key("batch"), isInitial=True))
 * 		element = element.at_key("batch")
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pprint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pprint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_json); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_loads); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_15 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_1 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_15, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_3);
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_10, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __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;

      /* "viur/datastore/transport.pyx":537
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if element.at("batch").error() != SUCCESS:             # <<<<<<<<<<<<<<
 * 			print("INVALID RESPONSE RECEIVED")
 * 			pprint.pprint(json.loads(req.content))
 */
    }

    /* "viur/datastore/transport.pyx":541
 * 			pprint.pprint(json.loads(req.content))
 * 		#	res.update(toEntityStructure(element.at_key("batch"), isInitial=True))
 * 		element = element.at_key("batch")             # <<<<<<<<<<<<<<
 * 		if element.at("entityResults").error() == SUCCESS:
 * 			res.extend(toEntityStructure(element.at_key("entityResults"), isInitial=False))
 */
    try {
      __pyx_t_18 = __pyx_v_element.at_key(((char const *)"batch"));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 541, __pyx_L1_error)
    }
    __pyx_v_element = __pyx_t_18;

    /* "viur/datastore/transport.pyx":542
 * 		#	res.update(toEntityStructure(element.at_key("batch"), isInitial=True))
 * 		element = element.at_key("batch")
 * 		if element.at("entityResults").error() == SUCCESS:             # <<<<<<<<<<<<<<
 * 			res.extend(toEntityStructure(element.at_key("entityResults"), isInitial=False))
 * 		else:  # No results received
 */
    __pyx_t_12 = ((__pyx_v_element.at(((char const *)"entityResults")).error() == simdjson::error_code::SUCCESS) != 0);
    if (__pyx_t_12) {

      /* "viur/datastore/transport.pyx":543
 * 		element = element.at_key("batch")
 * 		if element.at("entityResults").error() == SUCCESS:
 * 			res.extend(toEntityStructure(element.at_key("entityResults"), isInitial=False))             # <<<<<<<<<<<<<<
 * 		else:  # No results received
 * 			break
 */
      try {
        __pyx_t_18 = __pyx_v_element.at_key(((char const *)"entityResults"));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 543, __pyx_L1_error)
      }
      __pyx_t_19.__pyx_n = 1;
      __pyx_t_19.isInitial = 0;
      __pyx_t_2 = __pyx_f_4viur_9datastore_9transport_toEntityStructure(__pyx_t_18, &__pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_17 = __Pyx_PyList_Extend(__pyx_v_res, __pyx_t_2); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 543, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "viur/datastore/transport.pyx":542
 * 		#	res.update(toEntityStructure(element.at_key("batch"), isInitial=True))
 * 		element = element.at_key("batch")
 * 		if element.at("entityResults").error() == SUCCESS:             # <<<<<<<<<<<<<<
 * 			res.extend(toEntityStructure(element.at_key("entityResults"), isInitial=False))
 * 		else:  # No results received
 */
      goto __pyx_L40;
    }

    /* "viur/datastore/transport.pyx":545
 * 			res.extend(toEntityStructure(element.at_key("entityResults"), isInitial=False))
 * 		else:  # No results received
 * 			break             # <<<<<<<<<<<<<<
 * 		internalStartCursor = toPyStr(element.at_key("endCursor").get_string())
 * 		if toPyStr(element.at_key("moreResults").get_string()) != "NOT_FINISHED" or len(res) == limit:
 */
    /*else*/ {
      goto __pyx_L5_break;
    }
    __pyx_L40:;

    /* "viur/datastore/transport.pyx":546
 * 		else:  # No results received
 * 			break
 * 		internalStartCursor = toPyStr(element.at_key("endCursor").get_string())             # <<<<<<<<<<<<<<
 * 		if toPyStr(element.at_key("moreResults").get_string()) != "NOT_FINISHED" or len(res) == limit:
 * 			break
 */
    try {
      __pyx_t_18 = __pyx_v_element.at_key(((char const *)"endCursor"));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 546, __pyx_L1_error)
    }
    try {
      __pyx_t_20 = __pyx_t_18.get_string();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 546, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_internalStartCursor, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "viur/datastore/transport.pyx":547
 * 			break
 * 		internalStartCursor = toPyStr(element.at_key("endCursor").get_string())
 * 		if toPyStr(element.at_key("moreResults").get_string()) != "NOT_FINISHED" or len(res) == limit:             # <<<<<<<<<<<<<<
 * 			break
 * 	queryDefinition.currentCursor = internalStartCursor
 */
    try {
      __pyx_t_18 = __pyx_v_element.at_key(((char const *)"moreResults"));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 547, __pyx_L1_error)
    }
    try {
      __pyx_t_20 = __pyx_t_18.get_string();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 547, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_n_u_NOT_FINISHED, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_4) {
    } else {
      __pyx_t_12 = __pyx_t_4;
      goto __pyx_L42_bool_binop_done;
    }
    __pyx_t_7 = PyList_GET_SIZE(__pyx_v_res); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 547, __pyx_L1_error)
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_v_limit, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_12 = __pyx_t_4;
    __pyx_L42_bool_binop_done:;
    if (__pyx_t_12) {

      /* "viur/datastore/transport.pyx":548
 * 		internalStartCursor = toPyStr(element.at_key("endCursor").get_string())
 * 		if toPyStr(element.at_key("moreResults").get_string()) != "NOT_FINISHED" or len(res) == limit:
 * 			break             # <<<<<<<<<<<<<<
 * 	queryDefinition.currentCursor = internalStartCursor
 * 	if flipResults:
 */
      goto __pyx_L5_break;

      /* "viur/datastore/transport.pyx":547
 * 			break
 * 		internalStartCursor = toPyStr(element.at_key("endCursor").get_string())
 * 		if toPyStr(element.at_key("moreResults").get_string()) != "NOT_FINISHED" or len(res) == limit:             # <<<<<<<<<<<<<<
 * 			break
 * 	queryDefinition.currentCursor = internalStartCursor
 */
    }
  }
  __pyx_L5_break:;

  /* "viur/datastore/transport.pyx":549
 * 		if toPyStr(element.at_key("moreResults").get_string()) != "NOT_FINISHED" or len(res) == limit:
 * 			break
 * 	queryDefinition.currentCursor = internalStartCursor             # <<<<<<<<<<<<<<
 * 	if flipResults:
 * 		return res[::-1]
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_queryDefinition, __pyx_n_s_currentCursor, __pyx_v_internalStartCursor) < 0) __PYX_ERR(0, 549, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":550
 * 			break
 * 	queryDefinition.currentCursor = internalStartCursor
 * 	if flipResults:             # <<<<<<<<<<<<<<
 * 		return res[::-1]
 * 	return res
 */
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_flipResults); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 550, __pyx_L1_error)
  if (__pyx_t_12) {

    /* "viur/datastore/transport.pyx":551
 * 	queryDefinition.currentCursor = internalStartCursor
 * 	if flipResults:
 * 		return res[::-1]             # <<<<<<<<<<<<<<
 * 	return res
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_res, __pyx_slice__14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":550
 * 			break
 * 	queryDefinition.currentCursor = internalStartCursor
 * 	if flipResults:             # <<<<<<<<<<<<<<
 * 		return res[::-1]
 * 	return res
 */
  }

  /* "viur/datastore/transport.pyx":552
 * 	if flipResults:
 * 		return res[::-1]
 * 	return res             # <<<<<<<<<<<<<<
 * 
 * def Get(keys: Union[Key, List[Key]]) -> Union[None, Entity, List[Entity]]:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "viur/datastore/transport.pyx":432
 * 		raise ValueError("Unknown type")
 * 
 * def runSingleFilter(queryDefinition: QueryDefinition, limit: int) -> List[Entity]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs a single Query as defined by queryDefinition. The limit of the queryDefinition is ignored and must
 */

  /* 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_10);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("viur.datastore.transport.runSingleFilter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_internalStartCursor);
  __Pyx_XDECREF(__pyx_v_flipResults);
  __Pyx_XDECREF(__pyx_v_currentTxn);
  __Pyx_XDECREF(__pyx_v_readOptions);
  __Pyx_XDECREF(__pyx_v_postData);
  __Pyx_XDECREF(__pyx_v_filterList);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_op);
  __Pyx_XDECREF(__pyx_v_singleValue);
  __Pyx_XDECREF(__pyx_v_req);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_sortOrder);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_distinctKey);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":554
 * 	return res
 * 
 * def Get(keys: Union[Key, List[Key]]) -> Union[None, Entity, List[Entity]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Fetches the entities determined by keys from the datastore. Returns or inserts None if a key is not found.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4viur_9datastore_9transport_9Get(PyObject *__pyx_self, PyObject *__pyx_v_keys); /*proto*/
static char __pyx_doc_4viur_9datastore_9transport_8Get[] = "\n\t\tFetches the entities determined by keys from the datastore. Returns or inserts None if a key is not found.\n\t\t:param keys: A Key or a List of Keys to fetch\n\t\t:return: The entity or None for the given key, a list of Entities/None if a list has been supplied\n\t";
static PyMethodDef __pyx_mdef_4viur_9datastore_9transport_9Get = {"Get", (PyCFunction)__pyx_pw_4viur_9datastore_9transport_9Get, METH_O, __pyx_doc_4viur_9datastore_9transport_8Get};
static PyObject *__pyx_pw_4viur_9datastore_9transport_9Get(PyObject *__pyx_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Get (wrapper)", 0);
  __pyx_r = __pyx_pf_4viur_9datastore_9transport_8Get(__pyx_self, ((PyObject *)__pyx_v_keys));

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

static PyObject *__pyx_pf_4viur_9datastore_9transport_8Get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_keys) {
  simdjson::dom::parser __pyx_v_parser;
  Py_ssize_t __pyx_v_pysize;
  char *__pyx_v_data_ptr;
  simdjson::dom::element __pyx_v_element;
  int __pyx_v_isMulti;
  PyObject *__pyx_v_keyList = NULL;
  PyObject *__pyx_v_currentTxn = NULL;
  PyObject *__pyx_v_readOptions = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_requestedKeys = NULL;
  PyObject *__pyx_v_postData = NULL;
  PyObject *__pyx_v_req = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_x = NULL;
  PyObject *__pyx_8genexpr5__pyx_v_x = 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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  simdjson::dom::element __pyx_t_12;
  struct __pyx_opt_args_4viur_9datastore_9transport_toEntityStructure __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Get", 0);
  __Pyx_INCREF(__pyx_v_keys);

  /* "viur/datastore/transport.pyx":560
 * 		:return: The entity or None for the given key, a list of Entities/None if a list has been supplied
 * 	"""
 * 	cdef simdjsonParser parser = simdjsonParser()             # <<<<<<<<<<<<<<
 * 	cdef Py_ssize_t pysize
 * 	cdef char * data_ptr
 */
  __pyx_v_parser = simdjson::dom::parser();

  /* "viur/datastore/transport.pyx":564
 * 	cdef char * data_ptr
 * 	cdef simdjsonElement element
 * 	isMulti = True             # <<<<<<<<<<<<<<
 * 	if isinstance(keys, Key):
 * 		keys = [keys]
 */
  __pyx_v_isMulti = 1;

  /* "viur/datastore/transport.pyx":565
 * 	cdef simdjsonElement element
 * 	isMulti = True
 * 	if isinstance(keys, Key):             # <<<<<<<<<<<<<<
 * 		keys = [keys]
 * 		isMulti = False
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_keys, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 565, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "viur/datastore/transport.pyx":566
 * 	isMulti = True
 * 	if isinstance(keys, Key):
 * 		keys = [keys]             # <<<<<<<<<<<<<<
 * 		isMulti = False
 * 	keyList = [
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_keys);
    __Pyx_GIVEREF(__pyx_v_keys);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_keys);
    __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "viur/datastore/transport.pyx":567
 * 	if isinstance(keys, Key):
 * 		keys = [keys]
 * 		isMulti = False             # <<<<<<<<<<<<<<
 * 	keyList = [
 * 		{
 */
    __pyx_v_isMulti = 0;

    /* "viur/datastore/transport.pyx":565
 * 	cdef simdjsonElement element
 * 	isMulti = True
 * 	if isinstance(keys, Key):             # <<<<<<<<<<<<<<
 * 		keys = [keys]
 * 		isMulti = False
 */
  }

  /* "viur/datastore/transport.pyx":568
 * 		keys = [keys]
 * 		isMulti = False
 * 	keyList = [             # <<<<<<<<<<<<<<
 * 		{
 * 			"partitionId": {
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "viur/datastore/transport.pyx":575
 * 			"path": keyToPath(x)
 * 		}
 * 		for x in keys]             # <<<<<<<<<<<<<<
 * 
 * 	currentTxn = currentTransaction.get()
 */
    if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) {
      __pyx_t_4 = __pyx_v_keys; __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_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 575, __pyx_L6_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, 575, __pyx_L6_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 575, __pyx_L6_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, 575, __pyx_L6_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 575, __pyx_L6_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, 575, __pyx_L6_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_x, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "viur/datastore/transport.pyx":570
 * 	keyList = [
 * 		{
 * 			"partitionId": {             # <<<<<<<<<<<<<<
 * 				"project_id": projectID,
 * 			},
 */
      __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 570, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_7);

      /* "viur/datastore/transport.pyx":571
 * 		{
 * 			"partitionId": {
 * 				"project_id": projectID,             # <<<<<<<<<<<<<<
 * 			},
 * 			"path": keyToPath(x)
 */
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 571, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_projectID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 571, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_project_id, __pyx_t_9) < 0) __PYX_ERR(0, 571, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_partitionId, __pyx_t_8) < 0) __PYX_ERR(0, 570, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "viur/datastore/transport.pyx":573
 * 				"project_id": projectID,
 * 			},
 * 			"path": keyToPath(x)             # <<<<<<<<<<<<<<
 * 		}
 * 		for x in keys]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_keyToPath); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(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_8genexpr4__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_8genexpr4__pyx_v_x);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_path, __pyx_t_8) < 0) __PYX_ERR(0, 570, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 568, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "viur/datastore/transport.pyx":575
 * 			"path": keyToPath(x)
 * 		}
 * 		for x in keys]             # <<<<<<<<<<<<<<
 * 
 * 	currentTxn = currentTransaction.get()
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_x); __pyx_8genexpr4__pyx_v_x = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_x); __pyx_8genexpr4__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_keyList = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":577
 * 		for x in keys]
 * 
 * 	currentTxn = currentTransaction.get()             # <<<<<<<<<<<<<<
 * 	if currentTxn:
 * 		readOptions = {"transaction": currentTxn["key"]}
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_currentTransaction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __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_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_1 = (__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_1)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_currentTxn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":578
 * 
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:             # <<<<<<<<<<<<<<
 * 		readOptions = {"transaction": currentTxn["key"]}
 * 	else:
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_currentTxn); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 578, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "viur/datastore/transport.pyx":579
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:
 * 		readOptions = {"transaction": currentTxn["key"]}             # <<<<<<<<<<<<<<
 * 	else:
 * 		readOptions = {"readConsistency": "STRONG"}
 */
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_currentTxn, __pyx_n_u_key); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_transaction, __pyx_t_7) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_readOptions = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "viur/datastore/transport.pyx":578
 * 
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:             # <<<<<<<<<<<<<<
 * 		readOptions = {"transaction": currentTxn["key"]}
 * 	else:
 */
    goto __pyx_L10;
  }

  /* "viur/datastore/transport.pyx":581
 * 		readOptions = {"transaction": currentTxn["key"]}
 * 	else:
 * 		readOptions = {"readConsistency": "STRONG"}             # <<<<<<<<<<<<<<
 * 	res = {}
 * 	while keyList:
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_readConsistency, __pyx_n_u_STRONG) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
    __pyx_v_readOptions = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L10:;

  /* "viur/datastore/transport.pyx":582
 * 	else:
 * 		readOptions = {"readConsistency": "STRONG"}
 * 	res = {}             # <<<<<<<<<<<<<<
 * 	while keyList:
 * 		requestedKeys = keyList[:300]
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":583
 * 		readOptions = {"readConsistency": "STRONG"}
 * 	res = {}
 * 	while keyList:             # <<<<<<<<<<<<<<
 * 		requestedKeys = keyList[:300]
 * 		postData = {
 */
  while (1) {
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_keyList); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 583, __pyx_L1_error)
    if (!__pyx_t_3) break;

    /* "viur/datastore/transport.pyx":584
 * 	res = {}
 * 	while keyList:
 * 		requestedKeys = keyList[:300]             # <<<<<<<<<<<<<<
 * 		postData = {
 * 			"readOptions": readOptions,
 */
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_keyList, 0, 0x12C, NULL, NULL, &__pyx_slice__15, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_requestedKeys, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "viur/datastore/transport.pyx":586
 * 		requestedKeys = keyList[:300]
 * 		postData = {
 * 			"readOptions": readOptions,             # <<<<<<<<<<<<<<
 * 			"keys": requestedKeys,
 * 		}
 */
    __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_readOptions, __pyx_v_readOptions) < 0) __PYX_ERR(0, 586, __pyx_L1_error)

    /* "viur/datastore/transport.pyx":587
 * 		postData = {
 * 			"readOptions": readOptions,
 * 			"keys": requestedKeys,             # <<<<<<<<<<<<<<
 * 		}
 * 		req = authenticatedRequest(
 */
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_keys, __pyx_v_requestedKeys) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_postData, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "viur/datastore/transport.pyx":589
 * 			"keys": requestedKeys,
 * 		}
 * 		req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 			url="https://datastore.googleapis.com/v1/projects/%s:lookup" % projectID,
 * 			data=json.dumps(postData).encode("UTF-8"),
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_authenticatedRequest); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "viur/datastore/transport.pyx":590
 * 		}
 * 		req = authenticatedRequest(
 * 			url="https://datastore.googleapis.com/v1/projects/%s:lookup" % projectID,             # <<<<<<<<<<<<<<
 * 			data=json.dumps(postData).encode("UTF-8"),
 * 		)
 */
    __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_projectID); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_https_datastore_googleapis_com_v_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_url, __pyx_t_8) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "viur/datastore/transport.pyx":591
 * 		req = authenticatedRequest(
 * 			url="https://datastore.googleapis.com/v1/projects/%s:lookup" % projectID,
 * 			data=json.dumps(postData).encode("UTF-8"),             # <<<<<<<<<<<<<<
 * 		)
 * 		assert req.status_code == 200
 */
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_json); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dumps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 591, __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 && unlikely(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_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_postData) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_postData);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_4, __pyx_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_kp_u_UTF_8);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_data, __pyx_t_8) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "viur/datastore/transport.pyx":589
 * 			"keys": requestedKeys,
 * 		}
 * 		req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 			url="https://datastore.googleapis.com/v1/projects/%s:lookup" % projectID,
 * 			data=json.dumps(postData).encode("UTF-8"),
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_req, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "viur/datastore/transport.pyx":593
 * 			data=json.dumps(postData).encode("UTF-8"),
 * 		)
 * 		assert req.status_code == 200             # <<<<<<<<<<<<<<
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_status_code); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_t_8, __pyx_int_200, 0xC8, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 593, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(0, 593, __pyx_L1_error)
      }
    }
    #endif

    /* "viur/datastore/transport.pyx":594
 * 		)
 * 		assert req.status_code == 200
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1             # <<<<<<<<<<<<<<
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("found").error() == SUCCESS):
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 594, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = PyBytes_AsStringAndSize(__pyx_t_7, (&__pyx_v_data_ptr), (&__pyx_v_pysize)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 594, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!((__pyx_t_11 != -1L) != 0))) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(0, 594, __pyx_L1_error)
      }
    }
    #endif

    /* "viur/datastore/transport.pyx":595
 * 		assert req.status_code == 200
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)             # <<<<<<<<<<<<<<
 * 		if (element.at("found").error() == SUCCESS):
 * 			res.update(toEntityStructure(element.at_key("found"), isInitial=True))
 */
    try {
      __pyx_t_12 = __pyx_v_parser.parse(__pyx_v_data_ptr, __pyx_v_pysize, 1);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 595, __pyx_L1_error)
    }
    __pyx_v_element = __pyx_t_12;

    /* "viur/datastore/transport.pyx":596
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("found").error() == SUCCESS):             # <<<<<<<<<<<<<<
 * 			res.update(toEntityStructure(element.at_key("found"), isInitial=True))
 * 		if (element.at("deferred").error() == SUCCESS):
 */
    __pyx_t_3 = ((__pyx_v_element.at(((char const *)"found")).error() == simdjson::error_code::SUCCESS) != 0);
    if (__pyx_t_3) {

      /* "viur/datastore/transport.pyx":597
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("found").error() == SUCCESS):
 * 			res.update(toEntityStructure(element.at_key("found"), isInitial=True))             # <<<<<<<<<<<<<<
 * 		if (element.at("deferred").error() == SUCCESS):
 * 			keyList = toPythonStructure(element.at_key("deferred")) + keyList[300:]
 */
      try {
        __pyx_t_12 = __pyx_v_element.at_key(((char const *)"found"));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 597, __pyx_L1_error)
      }
      __pyx_t_13.__pyx_n = 1;
      __pyx_t_13.isInitial = 1;
      __pyx_t_7 = __pyx_f_4viur_9datastore_9transport_toEntityStructure(__pyx_t_12, &__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 597, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_res, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 597, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "viur/datastore/transport.pyx":596
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("found").error() == SUCCESS):             # <<<<<<<<<<<<<<
 * 			res.update(toEntityStructure(element.at_key("found"), isInitial=True))
 * 		if (element.at("deferred").error() == SUCCESS):
 */
    }

    /* "viur/datastore/transport.pyx":598
 * 		if (element.at("found").error() == SUCCESS):
 * 			res.update(toEntityStructure(element.at_key("found"), isInitial=True))
 * 		if (element.at("deferred").error() == SUCCESS):             # <<<<<<<<<<<<<<
 * 			keyList = toPythonStructure(element.at_key("deferred")) + keyList[300:]
 * 		else:
 */
    __pyx_t_3 = ((__pyx_v_element.at(((char const *)"deferred")).error() == simdjson::error_code::SUCCESS) != 0);
    if (__pyx_t_3) {

      /* "viur/datastore/transport.pyx":599
 * 			res.update(toEntityStructure(element.at_key("found"), isInitial=True))
 * 		if (element.at("deferred").error() == SUCCESS):
 * 			keyList = toPythonStructure(element.at_key("deferred")) + keyList[300:]             # <<<<<<<<<<<<<<
 * 		else:
 * 			keyList = keyList[300:]
 */
      try {
        __pyx_t_12 = __pyx_v_element.at_key(((char const *)"deferred"));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 599, __pyx_L1_error)
      }
      __pyx_t_8 = __pyx_f_4viur_9datastore_9transport_toPythonStructure(__pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 599, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_keyList, 0x12C, 0, NULL, NULL, &__pyx_slice__16, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF_SET(__pyx_v_keyList, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "viur/datastore/transport.pyx":598
 * 		if (element.at("found").error() == SUCCESS):
 * 			res.update(toEntityStructure(element.at_key("found"), isInitial=True))
 * 		if (element.at("deferred").error() == SUCCESS):             # <<<<<<<<<<<<<<
 * 			keyList = toPythonStructure(element.at_key("deferred")) + keyList[300:]
 * 		else:
 */
      goto __pyx_L14;
    }

    /* "viur/datastore/transport.pyx":601
 * 			keyList = toPythonStructure(element.at_key("deferred")) + keyList[300:]
 * 		else:
 * 			keyList = keyList[300:]             # <<<<<<<<<<<<<<
 * 	if not isMulti:
 * 		return res.get(keys[0])
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_keyList, 0x12C, 0, NULL, NULL, &__pyx_slice__16, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_keyList, __pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L14:;
  }

  /* "viur/datastore/transport.pyx":602
 * 		else:
 * 			keyList = keyList[300:]
 * 	if not isMulti:             # <<<<<<<<<<<<<<
 * 		return res.get(keys[0])
 * 	else:
 */
  __pyx_t_3 = ((!(__pyx_v_isMulti != 0)) != 0);
  if (__pyx_t_3) {

    /* "viur/datastore/transport.pyx":603
 * 			keyList = keyList[300:]
 * 	if not isMulti:
 * 		return res.get(keys[0])             # <<<<<<<<<<<<<<
 * 	else:
 * 		return [res.get(x) for x in keys]  # Sort by order of incoming keys
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_keys, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_res, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 603, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":602
 * 		else:
 * 			keyList = keyList[300:]
 * 	if not isMulti:             # <<<<<<<<<<<<<<
 * 		return res.get(keys[0])
 * 	else:
 */
  }

  /* "viur/datastore/transport.pyx":605
 * 		return res.get(keys[0])
 * 	else:
 * 		return [res.get(x) for x in keys]  # Sort by order of incoming keys             # <<<<<<<<<<<<<<
 * 
 * def Delete(keys: Union[Key, List[Key], Entity, List[Entity]]) -> None:
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    { /* enter inner scope */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 605, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) {
        __pyx_t_1 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
        __pyx_t_6 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 605, __pyx_L18_error)
      }
      for (;;) {
        if (likely(!__pyx_t_6)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 605, __pyx_L18_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 605, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          } else {
            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 605, __pyx_L18_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 605, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_8);
            #endif
          }
        } else {
          __pyx_t_8 = __pyx_t_6(__pyx_t_1);
          if (unlikely(!__pyx_t_8)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 605, __pyx_L18_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_x, __pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyDict_GetItemDefault(__pyx_v_res, __pyx_8genexpr5__pyx_v_x, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 605, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 605, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x); __pyx_8genexpr5__pyx_v_x = 0;
      goto __pyx_L21_exit_scope;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x); __pyx_8genexpr5__pyx_v_x = 0;
      goto __pyx_L1_error;
      __pyx_L21_exit_scope:;
    } /* exit inner scope */
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;
  }

  /* "viur/datastore/transport.pyx":554
 * 	return res
 * 
 * def Get(keys: Union[Key, List[Key]]) -> Union[None, Entity, List[Entity]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Fetches the entities determined by keys from the datastore. Returns or inserts None if a key is not found.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("viur.datastore.transport.Get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_keyList);
  __Pyx_XDECREF(__pyx_v_currentTxn);
  __Pyx_XDECREF(__pyx_v_readOptions);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_requestedKeys);
  __Pyx_XDECREF(__pyx_v_postData);
  __Pyx_XDECREF(__pyx_v_req);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_x);
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_keys);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":607
 * 		return [res.get(x) for x in keys]  # Sort by order of incoming keys
 * 
 * def Delete(keys: Union[Key, List[Key], Entity, List[Entity]]) -> None:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Deletes the entities stored under the given key(s).
 */

/* Python wrapper */
static PyObject *__pyx_pw_4viur_9datastore_9transport_11Delete(PyObject *__pyx_self, PyObject *__pyx_v_keys); /*proto*/
static char __pyx_doc_4viur_9datastore_9transport_10Delete[] = "\n\t\tDeletes the entities stored under the given key(s).\n\t\tIf a key is not found, it's silently ignored.\n\t\tA maximum of 300 Keys can be deleted at once.\n\n\t\t:param keys: A Key or a List of Keys\n\t";
static PyMethodDef __pyx_mdef_4viur_9datastore_9transport_11Delete = {"Delete", (PyCFunction)__pyx_pw_4viur_9datastore_9transport_11Delete, METH_O, __pyx_doc_4viur_9datastore_9transport_10Delete};
static PyObject *__pyx_pw_4viur_9datastore_9transport_11Delete(PyObject *__pyx_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Delete (wrapper)", 0);
  __pyx_r = __pyx_pf_4viur_9datastore_9transport_10Delete(__pyx_self, ((PyObject *)__pyx_v_keys));

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

static PyObject *__pyx_pf_4viur_9datastore_9transport_10Delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_keys) {
  simdjson::dom::parser __pyx_v_parser;
  Py_ssize_t __pyx_v_pysize;
  char *__pyx_v_data_ptr;
  simdjson::dom::element __pyx_v_element;
  simdjson::dom::array __pyx_v_arrayElem;
  PyObject *__pyx_v_postData = NULL;
  PyObject *__pyx_v_currentTxn = NULL;
  PyObject *__pyx_v_req = NULL;
  PyObject *__pyx_8genexpr6__pyx_v_x = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_x = 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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  simdjson::dom::element __pyx_t_13;
  simdjson::dom::array __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Delete", 0);
  __Pyx_INCREF(__pyx_v_keys);

  /* "viur/datastore/transport.pyx":615
 * 		:param keys: A Key or a List of Keys
 * 	"""
 * 	cdef simdjsonParser parser = simdjsonParser()             # <<<<<<<<<<<<<<
 * 	cdef Py_ssize_t pysize
 * 	cdef char * data_ptr
 */
  __pyx_v_parser = simdjson::dom::parser();

  /* "viur/datastore/transport.pyx":620
 * 	cdef simdjsonElement element
 * 	cdef simdjsonArray arrayElem
 * 	if isinstance(keys, Key):             # <<<<<<<<<<<<<<
 * 		keys = [keys]
 * 	elif isinstance(keys, Entity):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_keys, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 620, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "viur/datastore/transport.pyx":621
 * 	cdef simdjsonArray arrayElem
 * 	if isinstance(keys, Key):
 * 		keys = [keys]             # <<<<<<<<<<<<<<
 * 	elif isinstance(keys, Entity):
 * 		keys = [keys.key]
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_keys);
    __Pyx_GIVEREF(__pyx_v_keys);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_keys);
    __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "viur/datastore/transport.pyx":620
 * 	cdef simdjsonElement element
 * 	cdef simdjsonArray arrayElem
 * 	if isinstance(keys, Key):             # <<<<<<<<<<<<<<
 * 		keys = [keys]
 * 	elif isinstance(keys, Entity):
 */
    goto __pyx_L3;
  }

  /* "viur/datastore/transport.pyx":622
 * 	if isinstance(keys, Key):
 * 		keys = [keys]
 * 	elif isinstance(keys, Entity):             # <<<<<<<<<<<<<<
 * 		keys = [keys.key]
 * 	keys = [(x.key if isinstance(x, Entity) else x) for x in keys]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_keys, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "viur/datastore/transport.pyx":623
 * 		keys = [keys]
 * 	elif isinstance(keys, Entity):
 * 		keys = [keys.key]             # <<<<<<<<<<<<<<
 * 	keys = [(x.key if isinstance(x, Entity) else x) for x in keys]
 * 	postData = {
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_keys, __pyx_n_s_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "viur/datastore/transport.pyx":622
 * 	if isinstance(keys, Key):
 * 		keys = [keys]
 * 	elif isinstance(keys, Entity):             # <<<<<<<<<<<<<<
 * 		keys = [keys.key]
 * 	keys = [(x.key if isinstance(x, Entity) else x) for x in keys]
 */
  }
  __pyx_L3:;

  /* "viur/datastore/transport.pyx":624
 * 	elif isinstance(keys, Entity):
 * 		keys = [keys.key]
 * 	keys = [(x.key if isinstance(x, Entity) else x) for x in keys]             # <<<<<<<<<<<<<<
 * 	postData = {
 * 		"mode": "NON_TRANSACTIONAL",  #"TRANSACTIONAL", #
 */
  { /* enter inner scope */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) {
      __pyx_t_1 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 624, __pyx_L6_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 624, __pyx_L6_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 624, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 624, __pyx_L6_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 624, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_6(__pyx_t_1);
        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, 624, __pyx_L6_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_x, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Entity); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 624, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyObject_IsInstance(__pyx_8genexpr6__pyx_v_x, __pyx_t_8); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 624, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if ((__pyx_t_2 != 0)) {
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr6__pyx_v_x, __pyx_n_s_key); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 624, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = __pyx_t_8;
        __pyx_t_8 = 0;
      } else {
        __Pyx_INCREF(__pyx_8genexpr6__pyx_v_x);
        __pyx_t_7 = __pyx_8genexpr6__pyx_v_x;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 624, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_x); __pyx_8genexpr6__pyx_v_x = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_x); __pyx_8genexpr6__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":626
 * 	keys = [(x.key if isinstance(x, Entity) else x) for x in keys]
 * 	postData = {
 * 		"mode": "NON_TRANSACTIONAL",  #"TRANSACTIONAL", #             # <<<<<<<<<<<<<<
 * 		"mutations": [
 * 			{
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_mode, __pyx_n_u_NON_TRANSACTIONAL) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
  { /* enter inner scope */

    /* "viur/datastore/transport.pyx":627
 * 	postData = {
 * 		"mode": "NON_TRANSACTIONAL",  #"TRANSACTIONAL", #
 * 		"mutations": [             # <<<<<<<<<<<<<<
 * 			{
 * 				"delete": pythonPropToJson(x)["keyValue"]
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L12_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "viur/datastore/transport.pyx":631
 * 				"delete": pythonPropToJson(x)["keyValue"]
 * 			}
 * 			for x in keys             # <<<<<<<<<<<<<<
 * 		]
 * 	}
 */
    if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) {
      __pyx_t_7 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 631, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L12_error)
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 631, __pyx_L12_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 631, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 631, __pyx_L12_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 631, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_6(__pyx_t_7);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 631, __pyx_L12_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_x, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "viur/datastore/transport.pyx":629
 * 		"mutations": [
 * 			{
 * 				"delete": pythonPropToJson(x)["keyValue"]             # <<<<<<<<<<<<<<
 * 			}
 * 			for x in keys
 */
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 629, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_pythonPropToJson); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 629, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_8genexpr7__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_8genexpr7__pyx_v_x);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 629, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_u_keyValue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 629, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_delete, __pyx_t_10) < 0) __PYX_ERR(0, 629, __pyx_L12_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 627, __pyx_L12_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "viur/datastore/transport.pyx":631
 * 				"delete": pythonPropToJson(x)["keyValue"]
 * 			}
 * 			for x in keys             # <<<<<<<<<<<<<<
 * 		]
 * 	}
 */
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_x); __pyx_8genexpr7__pyx_v_x = 0;
    goto __pyx_L15_exit_scope;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_x); __pyx_8genexpr7__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L15_exit_scope:;
  } /* exit inner scope */
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_mutations, __pyx_t_1) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_postData = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":634
 * 		]
 * 	}
 * 	currentTxn = currentTransaction.get()             # <<<<<<<<<<<<<<
 * 	if currentTxn:
 * 		currentTxn["mutations"].extend(postData["mutations"])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_currentTransaction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_currentTxn = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":635
 * 	}
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:             # <<<<<<<<<<<<<<
 * 		currentTxn["mutations"].extend(postData["mutations"])
 * 		# Insert placeholders into affectedEntities as we receive a mutation-result for each key deleted
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_currentTxn); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "viur/datastore/transport.pyx":636
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:
 * 		currentTxn["mutations"].extend(postData["mutations"])             # <<<<<<<<<<<<<<
 * 		# Insert placeholders into affectedEntities as we receive a mutation-result for each key deleted
 * 		currentTxn["affectedEntities"].extend([None] * len(keys))
 */
    __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_currentTxn, __pyx_n_u_mutations); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_extend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_postData, __pyx_n_u_mutations); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __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, 636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "viur/datastore/transport.pyx":638
 * 		currentTxn["mutations"].extend(postData["mutations"])
 * 		# Insert placeholders into affectedEntities as we receive a mutation-result for each key deleted
 * 		currentTxn["affectedEntities"].extend([None] * len(keys))             # <<<<<<<<<<<<<<
 * 		return
 * 	req = authenticatedRequest(
 */
    __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_currentTxn, __pyx_n_u_affectedEntities); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_extend); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 638, __pyx_L1_error)
    __pyx_t_1 = PyList_New(1 * ((__pyx_t_5<0) ? 0:__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_t_5; __pyx_temp++) {
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        PyList_SET_ITEM(__pyx_t_1, __pyx_temp, Py_None);
      }
    }
    __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_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "viur/datastore/transport.pyx":639
 * 		# Insert placeholders into affectedEntities as we receive a mutation-result for each key deleted
 * 		currentTxn["affectedEntities"].extend([None] * len(keys))
 * 		return             # <<<<<<<<<<<<<<
 * 	req = authenticatedRequest(
 * 		url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":635
 * 	}
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:             # <<<<<<<<<<<<<<
 * 		currentTxn["mutations"].extend(postData["mutations"])
 * 		# Insert placeholders into affectedEntities as we receive a mutation-result for each key deleted
 */
  }

  /* "viur/datastore/transport.pyx":640
 * 		currentTxn["affectedEntities"].extend([None] * len(keys))
 * 		return
 * 	req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 		url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_authenticatedRequest); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "viur/datastore/transport.pyx":641
 * 		return
 * 	req = authenticatedRequest(
 * 		url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,             # <<<<<<<<<<<<<<
 * 		data=json.dumps(postData).encode("UTF-8"),
 * 	)
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_projectID); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_https_datastore_googleapis_com_v_3, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_url, __pyx_t_8) < 0) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "viur/datastore/transport.pyx":642
 * 	req = authenticatedRequest(
 * 		url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),             # <<<<<<<<<<<<<<
 * 	)
 * 	if req.status_code != 200:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_json); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_dumps); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 642, __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 && unlikely(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_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_postData) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_postData);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_encode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 642, __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_9))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_1, __pyx_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_kp_u_UTF_8);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_data, __pyx_t_8) < 0) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "viur/datastore/transport.pyx":640
 * 		currentTxn["affectedEntities"].extend([None] * len(keys))
 * 		return
 * 	req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 		url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),
 */
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_req = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "viur/datastore/transport.pyx":644
 * 		data=json.dumps(postData).encode("UTF-8"),
 * 	)
 * 	if req.status_code != 200:             # <<<<<<<<<<<<<<
 * 		print("INVALID STATUS CODE RECEIVED")
 * 		print(req.content)
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_status_code); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyInt_NeObjC(__pyx_t_8, __pyx_int_200, 0xC8, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "viur/datastore/transport.pyx":645
 * 	)
 * 	if req.status_code != 200:
 * 		print("INVALID STATUS CODE RECEIVED")             # <<<<<<<<<<<<<<
 * 		print(req.content)
 * 		pprint.pprint(json.loads(req.content))
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "viur/datastore/transport.pyx":646
 * 	if req.status_code != 200:
 * 		print("INVALID STATUS CODE RECEIVED")
 * 		print(req.content)             # <<<<<<<<<<<<<<
 * 		pprint.pprint(json.loads(req.content))
 * 		raise ValueError("Invalid status code received from Datastore API")
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "viur/datastore/transport.pyx":647
 * 		print("INVALID STATUS CODE RECEIVED")
 * 		print(req.content)
 * 		pprint.pprint(json.loads(req.content))             # <<<<<<<<<<<<<<
 * 		raise ValueError("Invalid status code received from Datastore API")
 * 	else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pprint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pprint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_json); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_loads); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "viur/datastore/transport.pyx":648
 * 		print(req.content)
 * 		pprint.pprint(json.loads(req.content))
 * 		raise ValueError("Invalid status code received from Datastore API")             # <<<<<<<<<<<<<<
 * 	else:
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(0, 648, __pyx_L1_error)

    /* "viur/datastore/transport.pyx":644
 * 		data=json.dumps(postData).encode("UTF-8"),
 * 	)
 * 	if req.status_code != 200:             # <<<<<<<<<<<<<<
 * 		print("INVALID STATUS CODE RECEIVED")
 * 		print(req.content)
 */
  }

  /* "viur/datastore/transport.pyx":650
 * 		raise ValueError("Invalid status code received from Datastore API")
 * 	else:
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1             # <<<<<<<<<<<<<<
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("mutationResults").error() != SUCCESS):
 */
  /*else*/ {
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 650, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_12 = PyBytes_AsStringAndSize(__pyx_t_8, (&__pyx_v_data_ptr), (&__pyx_v_pysize)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 650, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!((__pyx_t_12 != -1L) != 0))) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(0, 650, __pyx_L1_error)
      }
    }
    #endif

    /* "viur/datastore/transport.pyx":651
 * 	else:
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)             # <<<<<<<<<<<<<<
 * 		if (element.at("mutationResults").error() != SUCCESS):
 * 			print(req.content)
 */
    try {
      __pyx_t_13 = __pyx_v_parser.parse(__pyx_v_data_ptr, __pyx_v_pysize, 1);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 651, __pyx_L1_error)
    }
    __pyx_v_element = __pyx_t_13;

    /* "viur/datastore/transport.pyx":652
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("mutationResults").error() != SUCCESS):             # <<<<<<<<<<<<<<
 * 			print(req.content)
 * 			raise ValueError("No mutation-results received")
 */
    __pyx_t_2 = ((__pyx_v_element.at(((char const *)"mutationResults")).error() != simdjson::error_code::SUCCESS) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "viur/datastore/transport.pyx":653
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("mutationResults").error() != SUCCESS):
 * 			print(req.content)             # <<<<<<<<<<<<<<
 * 			raise ValueError("No mutation-results received")
 * 		arrayElem = element.at_key("mutationResults").get_array()
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 653, __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;

      /* "viur/datastore/transport.pyx":654
 * 		if (element.at("mutationResults").error() != SUCCESS):
 * 			print(req.content)
 * 			raise ValueError("No mutation-results received")             # <<<<<<<<<<<<<<
 * 		arrayElem = element.at_key("mutationResults").get_array()
 * 		if arrayElem.size() != len(keys):
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 654, __pyx_L1_error)

      /* "viur/datastore/transport.pyx":652
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("mutationResults").error() != SUCCESS):             # <<<<<<<<<<<<<<
 * 			print(req.content)
 * 			raise ValueError("No mutation-results received")
 */
    }

    /* "viur/datastore/transport.pyx":655
 * 			print(req.content)
 * 			raise ValueError("No mutation-results received")
 * 		arrayElem = element.at_key("mutationResults").get_array()             # <<<<<<<<<<<<<<
 * 		if arrayElem.size() != len(keys):
 * 			print(req.content)
 */
    try {
      __pyx_t_13 = __pyx_v_element.at_key(((char const *)"mutationResults"));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 655, __pyx_L1_error)
    }
    try {
      __pyx_t_14 = __pyx_t_13.get_array();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 655, __pyx_L1_error)
    }
    __pyx_v_arrayElem = __pyx_t_14;

    /* "viur/datastore/transport.pyx":656
 * 			raise ValueError("No mutation-results received")
 * 		arrayElem = element.at_key("mutationResults").get_array()
 * 		if arrayElem.size() != len(keys):             # <<<<<<<<<<<<<<
 * 			print(req.content)
 * 			raise ValueError("Invalid number of mutation-results received")
 */
    __pyx_t_5 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 656, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_v_arrayElem.size() != __pyx_t_5) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "viur/datastore/transport.pyx":657
 * 		arrayElem = element.at_key("mutationResults").get_array()
 * 		if arrayElem.size() != len(keys):
 * 			print(req.content)             # <<<<<<<<<<<<<<
 * 			raise ValueError("Invalid number of mutation-results received")
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "viur/datastore/transport.pyx":658
 * 		if arrayElem.size() != len(keys):
 * 			print(req.content)
 * 			raise ValueError("Invalid number of mutation-results received")             # <<<<<<<<<<<<<<
 * 
 * def Put(entities: Union[Entity, List[Entity]]) -> Union[Entity, List[Entity]]:
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 658, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(0, 658, __pyx_L1_error)

      /* "viur/datastore/transport.pyx":656
 * 			raise ValueError("No mutation-results received")
 * 		arrayElem = element.at_key("mutationResults").get_array()
 * 		if arrayElem.size() != len(keys):             # <<<<<<<<<<<<<<
 * 			print(req.content)
 * 			raise ValueError("Invalid number of mutation-results received")
 */
    }
  }

  /* "viur/datastore/transport.pyx":607
 * 		return [res.get(x) for x in keys]  # Sort by order of incoming keys
 * 
 * def Delete(keys: Union[Key, List[Key], Entity, List[Entity]]) -> None:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Deletes the entities stored under the given key(s).
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("viur.datastore.transport.Delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_postData);
  __Pyx_XDECREF(__pyx_v_currentTxn);
  __Pyx_XDECREF(__pyx_v_req);
  __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_x);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_keys);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":660
 * 			raise ValueError("Invalid number of mutation-results received")
 * 
 * def Put(entities: Union[Entity, List[Entity]]) -> Union[Entity, List[Entity]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Writes the given entities into the datastore. The entities can be from different kinds. If an entity has an
 */

/* Python wrapper */
static PyObject *__pyx_pw_4viur_9datastore_9transport_13Put(PyObject *__pyx_self, PyObject *__pyx_v_entities); /*proto*/
static char __pyx_doc_4viur_9datastore_9transport_12Put[] = "\n\t\tWrites the given entities into the datastore. The entities can be from different kinds. If an entity has an\n\t\tcomplete key, and there's already an entity stored under the given key, it's overwritten.\n\n\t\t:param entities: The entities to store\n\t\t:return: The Entity or List of Entities as supplied, with partial keys replaced by full ones (unless called\n\t\t\tinside a transaction, in which case we return None as no Keys have been determined yet)\n\t";
static PyMethodDef __pyx_mdef_4viur_9datastore_9transport_13Put = {"Put", (PyCFunction)__pyx_pw_4viur_9datastore_9transport_13Put, METH_O, __pyx_doc_4viur_9datastore_9transport_12Put};
static PyObject *__pyx_pw_4viur_9datastore_9transport_13Put(PyObject *__pyx_self, PyObject *__pyx_v_entities) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Put (wrapper)", 0);
  __pyx_r = __pyx_pf_4viur_9datastore_9transport_12Put(__pyx_self, ((PyObject *)__pyx_v_entities));

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

static PyObject *__pyx_pf_4viur_9datastore_9transport_12Put(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_entities) {
  simdjson::dom::parser __pyx_v_parser;
  Py_ssize_t __pyx_v_pysize;
  char *__pyx_v_data_ptr;
  simdjson::dom::element __pyx_v_element;
  simdjson::dom::element __pyx_v_innerArrayElem;
  simdjson::dom::array __pyx_v_arrayElem;
  simdjson::dom::array::iterator __pyx_v_arrayIt;
  PyObject *__pyx_v_postData = NULL;
  PyObject *__pyx_v_currentTxn = NULL;
  PyObject *__pyx_v_req = NULL;
  PyObject *__pyx_v_idx = NULL;
  PyObject *__pyx_8genexpr8__pyx_v_x = 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;
  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 = NULL;
  int __pyx_t_12;
  simdjson::dom::element __pyx_t_13;
  simdjson::dom::array __pyx_t_14;
  std::string_view __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Put", 0);
  __Pyx_INCREF(__pyx_v_entities);

  /* "viur/datastore/transport.pyx":669
 * 			inside a transaction, in which case we return None as no Keys have been determined yet)
 * 	"""
 * 	cdef simdjsonParser parser = simdjsonParser()             # <<<<<<<<<<<<<<
 * 	cdef Py_ssize_t pysize
 * 	cdef char * data_ptr
 */
  __pyx_v_parser = simdjson::dom::parser();

  /* "viur/datastore/transport.pyx":675
 * 	cdef simdjsonArray arrayElem
 * 	cdef simdjsonArray.iterator arrayIt
 * 	if isinstance(entities, Entity):             # <<<<<<<<<<<<<<
 * 		entities = [entities]
 * 	postData = {
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_entities, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "viur/datastore/transport.pyx":676
 * 	cdef simdjsonArray.iterator arrayIt
 * 	if isinstance(entities, Entity):
 * 		entities = [entities]             # <<<<<<<<<<<<<<
 * 	postData = {
 * 		"mode": "NON_TRANSACTIONAL",  # Always NON_TRANSACTIONAL; if we're inside a transaction we'll abort below
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_entities);
    __Pyx_GIVEREF(__pyx_v_entities);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_entities);
    __Pyx_DECREF_SET(__pyx_v_entities, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "viur/datastore/transport.pyx":675
 * 	cdef simdjsonArray arrayElem
 * 	cdef simdjsonArray.iterator arrayIt
 * 	if isinstance(entities, Entity):             # <<<<<<<<<<<<<<
 * 		entities = [entities]
 * 	postData = {
 */
  }

  /* "viur/datastore/transport.pyx":678
 * 		entities = [entities]
 * 	postData = {
 * 		"mode": "NON_TRANSACTIONAL",  # Always NON_TRANSACTIONAL; if we're inside a transaction we'll abort below             # <<<<<<<<<<<<<<
 * 		"mutations": [
 * 			{
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mode, __pyx_n_u_NON_TRANSACTIONAL) < 0) __PYX_ERR(0, 678, __pyx_L1_error)
  { /* enter inner scope */

    /* "viur/datastore/transport.pyx":679
 * 	postData = {
 * 		"mode": "NON_TRANSACTIONAL",  # Always NON_TRANSACTIONAL; if we're inside a transaction we'll abort below
 * 		"mutations": [             # <<<<<<<<<<<<<<
 * 			{
 * 				"upsert": pythonPropToJson(x)["entityValue"]
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "viur/datastore/transport.pyx":683
 * 				"upsert": pythonPropToJson(x)["entityValue"]
 * 			}
 * 			for x in entities             # <<<<<<<<<<<<<<
 * 		]
 * 	}
 */
    if (likely(PyList_CheckExact(__pyx_v_entities)) || PyTuple_CheckExact(__pyx_v_entities)) {
      __pyx_t_5 = __pyx_v_entities; __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_entities); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 683, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 683, __pyx_L6_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_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 683, __pyx_L6_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 683, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 683, __pyx_L6_error)
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 683, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 683, __pyx_L6_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_x, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "viur/datastore/transport.pyx":681
 * 		"mutations": [
 * 			{
 * 				"upsert": pythonPropToJson(x)["entityValue"]             # <<<<<<<<<<<<<<
 * 			}
 * 			for x in entities
 */
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 681, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_pythonPropToJson); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 681, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
        }
      }
      __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_8genexpr8__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_8genexpr8__pyx_v_x);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 681, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_u_entityValue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 681, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_upsert, __pyx_t_10) < 0) __PYX_ERR(0, 681, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 679, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "viur/datastore/transport.pyx":683
 * 				"upsert": pythonPropToJson(x)["entityValue"]
 * 			}
 * 			for x in entities             # <<<<<<<<<<<<<<
 * 		]
 * 	}
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_x); __pyx_8genexpr8__pyx_v_x = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_x); __pyx_8genexpr8__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mutations, __pyx_t_4) < 0) __PYX_ERR(0, 678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_postData = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":686
 * 		]
 * 	}
 * 	currentTxn = currentTransaction.get()             # <<<<<<<<<<<<<<
 * 	if currentTxn:  # We're currently inside a transaction, just queue the changes
 * 		currentTxn["mutations"].extend(postData["mutations"])
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_currentTransaction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__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_1)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_currentTxn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":687
 * 	}
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:  # We're currently inside a transaction, just queue the changes             # <<<<<<<<<<<<<<
 * 		currentTxn["mutations"].extend(postData["mutations"])
 * 		currentTxn["affectedEntities"].extend(entities)
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_currentTxn); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 687, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "viur/datastore/transport.pyx":688
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:  # We're currently inside a transaction, just queue the changes
 * 		currentTxn["mutations"].extend(postData["mutations"])             # <<<<<<<<<<<<<<
 * 		currentTxn["affectedEntities"].extend(entities)
 * 		return
 */
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_currentTxn, __pyx_n_u_mutations); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_extend); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_postData, __pyx_n_u_mutations); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __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_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "viur/datastore/transport.pyx":689
 * 	if currentTxn:  # We're currently inside a transaction, just queue the changes
 * 		currentTxn["mutations"].extend(postData["mutations"])
 * 		currentTxn["affectedEntities"].extend(entities)             # <<<<<<<<<<<<<<
 * 		return
 * 	req = authenticatedRequest(
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_currentTxn, __pyx_n_u_affectedEntities); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_extend); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 689, __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_v_entities) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_entities);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __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;

    /* "viur/datastore/transport.pyx":690
 * 		currentTxn["mutations"].extend(postData["mutations"])
 * 		currentTxn["affectedEntities"].extend(entities)
 * 		return             # <<<<<<<<<<<<<<
 * 	req = authenticatedRequest(
 * 		url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "viur/datastore/transport.pyx":687
 * 	}
 * 	currentTxn = currentTransaction.get()
 * 	if currentTxn:  # We're currently inside a transaction, just queue the changes             # <<<<<<<<<<<<<<
 * 		currentTxn["mutations"].extend(postData["mutations"])
 * 		currentTxn["affectedEntities"].extend(entities)
 */
  }

  /* "viur/datastore/transport.pyx":691
 * 		currentTxn["affectedEntities"].extend(entities)
 * 		return
 * 	req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 		url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_authenticatedRequest); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "viur/datastore/transport.pyx":692
 * 		return
 * 	req = authenticatedRequest(
 * 		url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,             # <<<<<<<<<<<<<<
 * 		data=json.dumps(postData).encode("UTF-8"),
 * 	)
 */
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_projectID); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_https_datastore_googleapis_com_v_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_url, __pyx_t_8) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "viur/datastore/transport.pyx":693
 * 	req = authenticatedRequest(
 * 		url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),             # <<<<<<<<<<<<<<
 * 	)
 * 	if req.status_code != 200:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_json); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_dumps); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 693, __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 && unlikely(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_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_postData) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_postData);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __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_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_kp_u_UTF_8);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_data, __pyx_t_8) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "viur/datastore/transport.pyx":691
 * 		currentTxn["affectedEntities"].extend(entities)
 * 		return
 * 	req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 		url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),
 */
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_req = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "viur/datastore/transport.pyx":695
 * 		data=json.dumps(postData).encode("UTF-8"),
 * 	)
 * 	if req.status_code != 200:             # <<<<<<<<<<<<<<
 * 		print("INVALID STATUS CODE RECEIVED")
 * 		print(req.content)
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_status_code); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = __Pyx_PyInt_NeObjC(__pyx_t_8, __pyx_int_200, 0xC8, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "viur/datastore/transport.pyx":696
 * 	)
 * 	if req.status_code != 200:
 * 		print("INVALID STATUS CODE RECEIVED")             # <<<<<<<<<<<<<<
 * 		print(req.content)
 * 		pprint.pprint(json.loads(req.content))
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "viur/datastore/transport.pyx":697
 * 	if req.status_code != 200:
 * 		print("INVALID STATUS CODE RECEIVED")
 * 		print(req.content)             # <<<<<<<<<<<<<<
 * 		pprint.pprint(json.loads(req.content))
 * 		raise ValueError("Invalid status code received from Datastore API")
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "viur/datastore/transport.pyx":698
 * 		print("INVALID STATUS CODE RECEIVED")
 * 		print(req.content)
 * 		pprint.pprint(json.loads(req.content))             # <<<<<<<<<<<<<<
 * 		raise ValueError("Invalid status code received from Datastore API")
 * 	else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pprint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pprint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_json); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_loads); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_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_8 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "viur/datastore/transport.pyx":699
 * 		print(req.content)
 * 		pprint.pprint(json.loads(req.content))
 * 		raise ValueError("Invalid status code received from Datastore API")             # <<<<<<<<<<<<<<
 * 	else:
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(0, 699, __pyx_L1_error)

    /* "viur/datastore/transport.pyx":695
 * 		data=json.dumps(postData).encode("UTF-8"),
 * 	)
 * 	if req.status_code != 200:             # <<<<<<<<<<<<<<
 * 		print("INVALID STATUS CODE RECEIVED")
 * 		print(req.content)
 */
  }

  /* "viur/datastore/transport.pyx":701
 * 		raise ValueError("Invalid status code received from Datastore API")
 * 	else:
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1             # <<<<<<<<<<<<<<
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("mutationResults").error() != SUCCESS):
 */
  /*else*/ {
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_12 = PyBytes_AsStringAndSize(__pyx_t_8, (&__pyx_v_data_ptr), (&__pyx_v_pysize)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 701, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!((__pyx_t_12 != -1L) != 0))) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(0, 701, __pyx_L1_error)
      }
    }
    #endif

    /* "viur/datastore/transport.pyx":702
 * 	else:
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)             # <<<<<<<<<<<<<<
 * 		if (element.at("mutationResults").error() != SUCCESS):
 * 			print(req.content)
 */
    try {
      __pyx_t_13 = __pyx_v_parser.parse(__pyx_v_data_ptr, __pyx_v_pysize, 1);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 702, __pyx_L1_error)
    }
    __pyx_v_element = __pyx_t_13;

    /* "viur/datastore/transport.pyx":703
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("mutationResults").error() != SUCCESS):             # <<<<<<<<<<<<<<
 * 			print(req.content)
 * 			raise ValueError("No mutation-results received")
 */
    __pyx_t_3 = ((__pyx_v_element.at(((char const *)"mutationResults")).error() != simdjson::error_code::SUCCESS) != 0);
    if (unlikely(__pyx_t_3)) {

      /* "viur/datastore/transport.pyx":704
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("mutationResults").error() != SUCCESS):
 * 			print(req.content)             # <<<<<<<<<<<<<<
 * 			raise ValueError("No mutation-results received")
 * 		arrayElem = element.at_key("mutationResults").get_array()
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "viur/datastore/transport.pyx":705
 * 		if (element.at("mutationResults").error() != SUCCESS):
 * 			print(req.content)
 * 			raise ValueError("No mutation-results received")             # <<<<<<<<<<<<<<
 * 		arrayElem = element.at_key("mutationResults").get_array()
 * 		if arrayElem.size() != len(entities):
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 705, __pyx_L1_error)

      /* "viur/datastore/transport.pyx":703
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if (element.at("mutationResults").error() != SUCCESS):             # <<<<<<<<<<<<<<
 * 			print(req.content)
 * 			raise ValueError("No mutation-results received")
 */
    }

    /* "viur/datastore/transport.pyx":706
 * 			print(req.content)
 * 			raise ValueError("No mutation-results received")
 * 		arrayElem = element.at_key("mutationResults").get_array()             # <<<<<<<<<<<<<<
 * 		if arrayElem.size() != len(entities):
 * 			print(req.content)
 */
    try {
      __pyx_t_13 = __pyx_v_element.at_key(((char const *)"mutationResults"));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 706, __pyx_L1_error)
    }
    try {
      __pyx_t_14 = __pyx_t_13.get_array();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 706, __pyx_L1_error)
    }
    __pyx_v_arrayElem = __pyx_t_14;

    /* "viur/datastore/transport.pyx":707
 * 			raise ValueError("No mutation-results received")
 * 		arrayElem = element.at_key("mutationResults").get_array()
 * 		if arrayElem.size() != len(entities):             # <<<<<<<<<<<<<<
 * 			print(req.content)
 * 			raise ValueError("Invalid number of mutation-results received")
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_entities); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 707, __pyx_L1_error)
    __pyx_t_3 = ((__pyx_v_arrayElem.size() != __pyx_t_6) != 0);
    if (unlikely(__pyx_t_3)) {

      /* "viur/datastore/transport.pyx":708
 * 		arrayElem = element.at_key("mutationResults").get_array()
 * 		if arrayElem.size() != len(entities):
 * 			print(req.content)             # <<<<<<<<<<<<<<
 * 			raise ValueError("Invalid number of mutation-results received")
 * 		arrayIt = arrayElem.begin()
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 708, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "viur/datastore/transport.pyx":709
 * 		if arrayElem.size() != len(entities):
 * 			print(req.content)
 * 			raise ValueError("Invalid number of mutation-results received")             # <<<<<<<<<<<<<<
 * 		arrayIt = arrayElem.begin()
 * 		idx = 0
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 709, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(0, 709, __pyx_L1_error)

      /* "viur/datastore/transport.pyx":707
 * 			raise ValueError("No mutation-results received")
 * 		arrayElem = element.at_key("mutationResults").get_array()
 * 		if arrayElem.size() != len(entities):             # <<<<<<<<<<<<<<
 * 			print(req.content)
 * 			raise ValueError("Invalid number of mutation-results received")
 */
    }

    /* "viur/datastore/transport.pyx":710
 * 			print(req.content)
 * 			raise ValueError("Invalid number of mutation-results received")
 * 		arrayIt = arrayElem.begin()             # <<<<<<<<<<<<<<
 * 		idx = 0
 * 		while arrayIt != arrayElem.end():
 */
    __pyx_v_arrayIt = __pyx_v_arrayElem.begin();

    /* "viur/datastore/transport.pyx":711
 * 			raise ValueError("Invalid number of mutation-results received")
 * 		arrayIt = arrayElem.begin()
 * 		idx = 0             # <<<<<<<<<<<<<<
 * 		while arrayIt != arrayElem.end():
 * 			innerArrayElem = dereference(arrayIt)
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_v_idx = __pyx_int_0;

    /* "viur/datastore/transport.pyx":712
 * 		arrayIt = arrayElem.begin()
 * 		idx = 0
 * 		while arrayIt != arrayElem.end():             # <<<<<<<<<<<<<<
 * 			innerArrayElem = dereference(arrayIt)
 * 			if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned
 */
    while (1) {
      __pyx_t_3 = ((__pyx_v_arrayIt != __pyx_v_arrayElem.end()) != 0);
      if (!__pyx_t_3) break;

      /* "viur/datastore/transport.pyx":713
 * 		idx = 0
 * 		while arrayIt != arrayElem.end():
 * 			innerArrayElem = dereference(arrayIt)             # <<<<<<<<<<<<<<
 * 			if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned
 * 				entities[idx].key = parseKey(innerArrayElem.at_key("key"))
 */
      __pyx_v_innerArrayElem = (*__pyx_v_arrayIt);

      /* "viur/datastore/transport.pyx":714
 * 		while arrayIt != arrayElem.end():
 * 			innerArrayElem = dereference(arrayIt)
 * 			if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned             # <<<<<<<<<<<<<<
 * 				entities[idx].key = parseKey(innerArrayElem.at_key("key"))
 * 			entities[idx].version = toPyStr(innerArrayElem.at_key("version").get_string())
 */
      __pyx_t_3 = ((__pyx_v_innerArrayElem.at(((char const *)"key")).error() == simdjson::error_code::SUCCESS) != 0);
      if (__pyx_t_3) {

        /* "viur/datastore/transport.pyx":715
 * 			innerArrayElem = dereference(arrayIt)
 * 			if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned
 * 				entities[idx].key = parseKey(innerArrayElem.at_key("key"))             # <<<<<<<<<<<<<<
 * 			entities[idx].version = toPyStr(innerArrayElem.at_key("version").get_string())
 * 			preincrement(arrayIt)
 */
        try {
          __pyx_t_13 = __pyx_v_innerArrayElem.at_key(((char const *)"key"));
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 715, __pyx_L1_error)
        }
        __pyx_t_8 = __pyx_f_4viur_9datastore_9transport_parseKey(__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 715, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_entities, __pyx_v_idx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_key, __pyx_t_8) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "viur/datastore/transport.pyx":714
 * 		while arrayIt != arrayElem.end():
 * 			innerArrayElem = dereference(arrayIt)
 * 			if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned             # <<<<<<<<<<<<<<
 * 				entities[idx].key = parseKey(innerArrayElem.at_key("key"))
 * 			entities[idx].version = toPyStr(innerArrayElem.at_key("version").get_string())
 */
      }

      /* "viur/datastore/transport.pyx":716
 * 			if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned
 * 				entities[idx].key = parseKey(innerArrayElem.at_key("key"))
 * 			entities[idx].version = toPyStr(innerArrayElem.at_key("version").get_string())             # <<<<<<<<<<<<<<
 * 			preincrement(arrayIt)
 * 			idx += 1
 */
      try {
        __pyx_t_13 = __pyx_v_innerArrayElem.at_key(((char const *)"version"));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 716, __pyx_L1_error)
      }
      try {
        __pyx_t_15 = __pyx_t_13.get_string();
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 716, __pyx_L1_error)
      }
      __pyx_t_1 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_entities, __pyx_v_idx); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_8, __pyx_n_s_version, __pyx_t_1) < 0) __PYX_ERR(0, 716, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "viur/datastore/transport.pyx":717
 * 				entities[idx].key = parseKey(innerArrayElem.at_key("key"))
 * 			entities[idx].version = toPyStr(innerArrayElem.at_key("version").get_string())
 * 			preincrement(arrayIt)             # <<<<<<<<<<<<<<
 * 			idx += 1
 * 	return entities
 */
      (void)((++__pyx_v_arrayIt));

      /* "viur/datastore/transport.pyx":718
 * 			entities[idx].version = toPyStr(innerArrayElem.at_key("version").get_string())
 * 			preincrement(arrayIt)
 * 			idx += 1             # <<<<<<<<<<<<<<
 * 	return entities
 * 
 */
      __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_v_idx, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_8);
      __pyx_t_8 = 0;
    }
  }

  /* "viur/datastore/transport.pyx":719
 * 			preincrement(arrayIt)
 * 			idx += 1
 * 	return entities             # <<<<<<<<<<<<<<
 * 
 * class Collision(Exception):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_entities);
  __pyx_r = __pyx_v_entities;
  goto __pyx_L0;

  /* "viur/datastore/transport.pyx":660
 * 			raise ValueError("Invalid number of mutation-results received")
 * 
 * def Put(entities: Union[Entity, List[Entity]]) -> Union[Entity, List[Entity]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Writes the given entities into the datastore. The entities can be from different kinds. If an entity has an
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("viur.datastore.transport.Put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_postData);
  __Pyx_XDECREF(__pyx_v_currentTxn);
  __Pyx_XDECREF(__pyx_v_req);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_entities);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":724
 * 	pass
 * 
 * def RunInTransaction(callback: callable, *args, **kwargs) -> Any:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs the given function inside a AID transaction.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4viur_9datastore_9transport_15RunInTransaction(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4viur_9datastore_9transport_14RunInTransaction[] = "\n\t\tRuns the given function inside a AID transaction.\n\n\t\t:param callback: The function to run inside a transaction\n\t\t:param args: Args to pass to the function\n\t\t:param kwargs: Kwargs to pass to the function\n\t\t:return: The return-value of the callback function\n\t";
static PyMethodDef __pyx_mdef_4viur_9datastore_9transport_15RunInTransaction = {"RunInTransaction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4viur_9datastore_9transport_15RunInTransaction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4viur_9datastore_9transport_14RunInTransaction};
static PyObject *__pyx_pw_4viur_9datastore_9transport_15RunInTransaction(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 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("RunInTransaction (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "RunInTransaction") < 0)) __PYX_ERR(0, 724, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("RunInTransaction", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 724, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("viur.datastore.transport.RunInTransaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_4viur_9datastore_9transport_14RunInTransaction(__pyx_self, __pyx_v_callback, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_4viur_9datastore_9transport_14RunInTransaction(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  simdjson::dom::parser __pyx_v_parser;
  Py_ssize_t __pyx_v_pysize;
  char *__pyx_v_data_ptr;
  simdjson::dom::element __pyx_v_element;
  simdjson::dom::element __pyx_v_innerArrayElem;
  simdjson::dom::array __pyx_v_arrayElem;
  simdjson::dom::array::iterator __pyx_v_arrayIt;
  CYTHON_UNUSED long __pyx_v__;
  PyObject *__pyx_v_oldTxn = NULL;
  PyObject *__pyx_v_allowOverriding = NULL;
  PyObject *__pyx_v_txnOptions = NULL;
  PyObject *__pyx_v_postData = NULL;
  PyObject *__pyx_v_req = NULL;
  PyObject *__pyx_v_txnKey = NULL;
  PyObject *__pyx_v_currentTxn = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_v_idx = NULL;
  PyObject *__pyx_v_affectedEntity = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  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_t_16;
  simdjson::dom::element __pyx_t_17;
  simdjson::dom::array __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  std::string_view __pyx_t_20;
  int __pyx_t_21;
  char const *__pyx_t_22;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("RunInTransaction", 0);

  /* "viur/datastore/transport.pyx":733
 * 		:return: The return-value of the callback function
 * 	"""
 * 	cdef simdjsonParser parser = simdjsonParser()             # <<<<<<<<<<<<<<
 * 	cdef Py_ssize_t pysize
 * 	cdef char * data_ptr
 */
  __pyx_v_parser = simdjson::dom::parser();

  /* "viur/datastore/transport.pyx":739
 * 	cdef simdjsonArray arrayElem
 * 	cdef simdjsonArray.iterator arrayIt
 * 	for _ in range(0, 3):             # <<<<<<<<<<<<<<
 * 		try:
 * 			oldTxn = currentTransaction.get()
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
    __pyx_v__ = __pyx_t_1;

    /* "viur/datastore/transport.pyx":740
 * 	cdef simdjsonArray.iterator arrayIt
 * 	for _ in range(0, 3):
 * 		try:             # <<<<<<<<<<<<<<
 * 			oldTxn = currentTransaction.get()
 * 			allowOverriding = kwargs.pop("__allowOverriding__", None)
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "viur/datastore/transport.pyx":741
 * 	for _ in range(0, 3):
 * 		try:
 * 			oldTxn = currentTransaction.get()             # <<<<<<<<<<<<<<
 * 			allowOverriding = kwargs.pop("__allowOverriding__", None)
 * 			if oldTxn:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_currentTransaction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 741, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 741, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_oldTxn, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "viur/datastore/transport.pyx":742
 * 		try:
 * 			oldTxn = currentTransaction.get()
 * 			allowOverriding = kwargs.pop("__allowOverriding__", None)             # <<<<<<<<<<<<<<
 * 			if oldTxn:
 * 				if not allowOverriding:
 */
        __pyx_t_5 = __Pyx_PyDict_Pop(__pyx_v_kwargs, __pyx_n_u_allowOverriding, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 742, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_XDECREF_SET(__pyx_v_allowOverriding, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "viur/datastore/transport.pyx":743
 * 			oldTxn = currentTransaction.get()
 * 			allowOverriding = kwargs.pop("__allowOverriding__", None)
 * 			if oldTxn:             # <<<<<<<<<<<<<<
 * 				if not allowOverriding:
 * 					raise RecursionError("Cannot call runInTransaction while inside a transaction!")
 */
        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_oldTxn); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 743, __pyx_L5_error)
        if (__pyx_t_8) {

          /* "viur/datastore/transport.pyx":744
 * 			allowOverriding = kwargs.pop("__allowOverriding__", None)
 * 			if oldTxn:
 * 				if not allowOverriding:             # <<<<<<<<<<<<<<
 * 					raise RecursionError("Cannot call runInTransaction while inside a transaction!")
 * 				txnOptions = {
 */
          __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_allowOverriding); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 744, __pyx_L5_error)
          __pyx_t_9 = ((!__pyx_t_8) != 0);
          if (unlikely(__pyx_t_9)) {

            /* "viur/datastore/transport.pyx":745
 * 			if oldTxn:
 * 				if not allowOverriding:
 * 					raise RecursionError("Cannot call runInTransaction while inside a transaction!")             # <<<<<<<<<<<<<<
 * 				txnOptions = {
 * 					"previousTransaction": oldTxn["key"]
 */
            __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RecursionError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 745, __pyx_L5_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 745, __pyx_L5_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_Raise(__pyx_t_7, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __PYX_ERR(0, 745, __pyx_L5_error)

            /* "viur/datastore/transport.pyx":744
 * 			allowOverriding = kwargs.pop("__allowOverriding__", None)
 * 			if oldTxn:
 * 				if not allowOverriding:             # <<<<<<<<<<<<<<
 * 					raise RecursionError("Cannot call runInTransaction while inside a transaction!")
 * 				txnOptions = {
 */
          }

          /* "viur/datastore/transport.pyx":747
 * 					raise RecursionError("Cannot call runInTransaction while inside a transaction!")
 * 				txnOptions = {
 * 					"previousTransaction": oldTxn["key"]             # <<<<<<<<<<<<<<
 * 				}
 * 			else:
 */
          __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_oldTxn, __pyx_n_u_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 747, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_previousTransaction, __pyx_t_5) < 0) __PYX_ERR(0, 747, __pyx_L5_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF_SET(__pyx_v_txnOptions, ((PyObject*)__pyx_t_7));
          __pyx_t_7 = 0;

          /* "viur/datastore/transport.pyx":743
 * 			oldTxn = currentTransaction.get()
 * 			allowOverriding = kwargs.pop("__allowOverriding__", None)
 * 			if oldTxn:             # <<<<<<<<<<<<<<
 * 				if not allowOverriding:
 * 					raise RecursionError("Cannot call runInTransaction while inside a transaction!")
 */
          goto __pyx_L13;
        }

        /* "viur/datastore/transport.pyx":750
 * 				}
 * 			else:
 * 				txnOptions = {}             # <<<<<<<<<<<<<<
 * 			postData = {
 * 				"transactionOptions": {
 */
        /*else*/ {
          __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_XDECREF_SET(__pyx_v_txnOptions, ((PyObject*)__pyx_t_7));
          __pyx_t_7 = 0;
        }
        __pyx_L13:;

        /* "viur/datastore/transport.pyx":752
 * 				txnOptions = {}
 * 			postData = {
 * 				"transactionOptions": {             # <<<<<<<<<<<<<<
 * 					"readWrite": txnOptions
 * 				}
 */
        __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 752, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_7);

        /* "viur/datastore/transport.pyx":753
 * 			postData = {
 * 				"transactionOptions": {
 * 					"readWrite": txnOptions             # <<<<<<<<<<<<<<
 * 				}
 * 			}
 */
        __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_readWrite, __pyx_v_txnOptions) < 0) __PYX_ERR(0, 753, __pyx_L5_error)
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_transactionOptions, __pyx_t_5) < 0) __PYX_ERR(0, 752, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_v_postData, ((PyObject*)__pyx_t_7));
        __pyx_t_7 = 0;

        /* "viur/datastore/transport.pyx":756
 * 				}
 * 			}
 * 			req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 				url="https://datastore.googleapis.com/v1/projects/%s:beginTransaction" % projectID,
 * 				data=json.dumps(postData).encode("UTF-8"),
 */
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_authenticatedRequest); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_7);

        /* "viur/datastore/transport.pyx":757
 * 			}
 * 			req = authenticatedRequest(
 * 				url="https://datastore.googleapis.com/v1/projects/%s:beginTransaction" % projectID,             # <<<<<<<<<<<<<<
 * 				data=json.dumps(postData).encode("UTF-8"),
 * 			)
 */
        __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 757, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_projectID); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 757, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_10 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_https_datastore_googleapis_com_v_4, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 757, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_url, __pyx_t_10) < 0) __PYX_ERR(0, 757, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "viur/datastore/transport.pyx":758
 * 			req = authenticatedRequest(
 * 				url="https://datastore.googleapis.com/v1/projects/%s:beginTransaction" % projectID,
 * 				data=json.dumps(postData).encode("UTF-8"),             # <<<<<<<<<<<<<<
 * 			)
 * 			if req.status_code != 200:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_json); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 758, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_dumps); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 758, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_6 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_11, __pyx_v_postData) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_postData);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 758, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_encode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 758, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_10 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_6, __pyx_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_kp_u_UTF_8);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 758, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_data, __pyx_t_10) < 0) __PYX_ERR(0, 757, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "viur/datastore/transport.pyx":756
 * 				}
 * 			}
 * 			req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 				url="https://datastore.googleapis.com/v1/projects/%s:beginTransaction" % projectID,
 * 				data=json.dumps(postData).encode("UTF-8"),
 */
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 756, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF_SET(__pyx_v_req, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "viur/datastore/transport.pyx":760
 * 				data=json.dumps(postData).encode("UTF-8"),
 * 			)
 * 			if req.status_code != 200:             # <<<<<<<<<<<<<<
 * 				print("INVALID STATUS CODE RECEIVED")
 * 				print(req.content)
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_status_code); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 760, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_5 = __Pyx_PyInt_NeObjC(__pyx_t_10, __pyx_int_200, 0xC8, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 760, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(__pyx_t_9)) {

          /* "viur/datastore/transport.pyx":761
 * 			)
 * 			if req.status_code != 200:
 * 				print("INVALID STATUS CODE RECEIVED")             # <<<<<<<<<<<<<<
 * 				print(req.content)
 * 				pprint.pprint(json.loads(req.content))
 */
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "viur/datastore/transport.pyx":762
 * 			if req.status_code != 200:
 * 				print("INVALID STATUS CODE RECEIVED")
 * 				print(req.content)             # <<<<<<<<<<<<<<
 * 				pprint.pprint(json.loads(req.content))
 * 				raise ValueError("Invalid status code received from Datastore API")
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 762, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 762, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "viur/datastore/transport.pyx":763
 * 				print("INVALID STATUS CODE RECEIVED")
 * 				print(req.content)
 * 				pprint.pprint(json.loads(req.content))             # <<<<<<<<<<<<<<
 * 				raise ValueError("Invalid status code received from Datastore API")
 * 			else:
 */
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pprint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pprint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_json); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 763, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_loads); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 763, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_11 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
            }
          }
          __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_12);
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L5_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_7))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_6)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_6);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
            }
          }
          __pyx_t_10 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __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_10)) __PYX_ERR(0, 763, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "viur/datastore/transport.pyx":764
 * 				print(req.content)
 * 				pprint.pprint(json.loads(req.content))
 * 				raise ValueError("Invalid status code received from Datastore API")             # <<<<<<<<<<<<<<
 * 			else:
 * 				txnKey = json.loads(req.content)["transaction"]
 */
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 764, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_Raise(__pyx_t_10, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __PYX_ERR(0, 764, __pyx_L5_error)

          /* "viur/datastore/transport.pyx":760
 * 				data=json.dumps(postData).encode("UTF-8"),
 * 			)
 * 			if req.status_code != 200:             # <<<<<<<<<<<<<<
 * 				print("INVALID STATUS CODE RECEIVED")
 * 				print(req.content)
 */
        }

        /* "viur/datastore/transport.pyx":766
 * 				raise ValueError("Invalid status code received from Datastore API")
 * 			else:
 * 				txnKey = json.loads(req.content)["transaction"]             # <<<<<<<<<<<<<<
 * 				try:
 * 					currentTxn = {"key": txnKey, "mutations": [], "affectedEntities": []}
 */
        /*else*/ {
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_json); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_loads); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 766, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_7);
          __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_10 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __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_10)) __PYX_ERR(0, 766, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_10, __pyx_n_u_transaction); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF_SET(__pyx_v_txnKey, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "viur/datastore/transport.pyx":767
 * 			else:
 * 				txnKey = json.loads(req.content)["transaction"]
 * 				try:             # <<<<<<<<<<<<<<
 * 					currentTxn = {"key": txnKey, "mutations": [], "affectedEntities": []}
 * 					currentTransaction.set(currentTxn)
 */
          /*try:*/ {

            /* "viur/datastore/transport.pyx":768
 * 				txnKey = json.loads(req.content)["transaction"]
 * 				try:
 * 					currentTxn = {"key": txnKey, "mutations": [], "affectedEntities": []}             # <<<<<<<<<<<<<<
 * 					currentTransaction.set(currentTxn)
 * 					try:
 */
            __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 768, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_5);
            if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_key, __pyx_v_txnKey) < 0) __PYX_ERR(0, 768, __pyx_L19_error)
            __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 768, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_10);
            if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_mutations, __pyx_t_10) < 0) __PYX_ERR(0, 768, __pyx_L19_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 768, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_10);
            if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_affectedEntities, __pyx_t_10) < 0) __PYX_ERR(0, 768, __pyx_L19_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF_SET(__pyx_v_currentTxn, ((PyObject*)__pyx_t_5));
            __pyx_t_5 = 0;

            /* "viur/datastore/transport.pyx":769
 * 				try:
 * 					currentTxn = {"key": txnKey, "mutations": [], "affectedEntities": []}
 * 					currentTransaction.set(currentTxn)             # <<<<<<<<<<<<<<
 * 					try:
 * 						res = callback(*args, **kwargs)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_currentTransaction); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 769, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_set); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 769, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __pyx_t_10 = NULL;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
              __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
              if (likely(__pyx_t_10)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                __Pyx_INCREF(__pyx_t_10);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_7, function);
              }
            }
            __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_10, __pyx_v_currentTxn) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_currentTxn);
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 769, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "viur/datastore/transport.pyx":770
 * 					currentTxn = {"key": txnKey, "mutations": [], "affectedEntities": []}
 * 					currentTransaction.set(currentTxn)
 * 					try:             # <<<<<<<<<<<<<<
 * 						res = callback(*args, **kwargs)
 * 					except:
 */
            {
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_13);
              __Pyx_XGOTREF(__pyx_t_14);
              __Pyx_XGOTREF(__pyx_t_15);
              /*try:*/ {

                /* "viur/datastore/transport.pyx":771
 * 					currentTransaction.set(currentTxn)
 * 					try:
 * 						res = callback(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 					except:
 * 						_rollbackTxn(txnKey)
 */
                __pyx_t_5 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 771, __pyx_L21_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_callback, __pyx_v_args, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 771, __pyx_L21_error)
                __Pyx_GOTREF(__pyx_t_7);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_7);
                __pyx_t_7 = 0;

                /* "viur/datastore/transport.pyx":770
 * 					currentTxn = {"key": txnKey, "mutations": [], "affectedEntities": []}
 * 					currentTransaction.set(currentTxn)
 * 					try:             # <<<<<<<<<<<<<<
 * 						res = callback(*args, **kwargs)
 * 					except:
 */
              }
              __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;
              goto __pyx_L28_try_end;
              __pyx_L21_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_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

              /* "viur/datastore/transport.pyx":772
 * 					try:
 * 						res = callback(*args, **kwargs)
 * 					except:             # <<<<<<<<<<<<<<
 * 						_rollbackTxn(txnKey)
 * 						raise
 */
              /*except:*/ {
                __Pyx_AddTraceback("viur.datastore.transport.RunInTransaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_10) < 0) __PYX_ERR(0, 772, __pyx_L23_except_error)
                __Pyx_GOTREF(__pyx_t_7);
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_GOTREF(__pyx_t_10);

                /* "viur/datastore/transport.pyx":773
 * 						res = callback(*args, **kwargs)
 * 					except:
 * 						_rollbackTxn(txnKey)             # <<<<<<<<<<<<<<
 * 						raise
 * 					if currentTxn["mutations"]:
 */
                __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_rollbackTxn); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 773, __pyx_L23_except_error)
                __Pyx_GOTREF(__pyx_t_12);
                __pyx_t_11 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
                  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
                  if (likely(__pyx_t_11)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
                    __Pyx_INCREF(__pyx_t_11);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_12, function);
                  }
                }
                __pyx_t_6 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_11, __pyx_v_txnKey) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_txnKey);
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 773, __pyx_L23_except_error)
                __Pyx_GOTREF(__pyx_t_6);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

                /* "viur/datastore/transport.pyx":774
 * 					except:
 * 						_rollbackTxn(txnKey)
 * 						raise             # <<<<<<<<<<<<<<
 * 					if currentTxn["mutations"]:
 * 						# Commit TXN
 */
                __Pyx_GIVEREF(__pyx_t_7);
                __Pyx_GIVEREF(__pyx_t_5);
                __Pyx_XGIVEREF(__pyx_t_10);
                __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_5, __pyx_t_10);
                __pyx_t_7 = 0; __pyx_t_5 = 0; __pyx_t_10 = 0; 
                __PYX_ERR(0, 774, __pyx_L23_except_error)
              }
              __pyx_L23_except_error:;

              /* "viur/datastore/transport.pyx":770
 * 					currentTxn = {"key": txnKey, "mutations": [], "affectedEntities": []}
 * 					currentTransaction.set(currentTxn)
 * 					try:             # <<<<<<<<<<<<<<
 * 						res = callback(*args, **kwargs)
 * 					except:
 */
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_XGIVEREF(__pyx_t_14);
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
              goto __pyx_L19_error;
              __pyx_L28_try_end:;
            }

            /* "viur/datastore/transport.pyx":775
 * 						_rollbackTxn(txnKey)
 * 						raise
 * 					if currentTxn["mutations"]:             # <<<<<<<<<<<<<<
 * 						# Commit TXN
 * 						postData = {
 */
            __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_currentTxn, __pyx_n_u_mutations); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 775, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 775, __pyx_L19_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (__pyx_t_9) {

              /* "viur/datastore/transport.pyx":778
 * 						# Commit TXN
 * 						postData = {
 * 							"mode": "TRANSACTIONAL",  #             # <<<<<<<<<<<<<<
 * 							"transaction": txnKey,
 * 							"mutations": currentTxn["mutations"]
 */
              __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 778, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_10);
              if (PyDict_SetItem(__pyx_t_10, __pyx_n_u_mode, __pyx_n_u_TRANSACTIONAL) < 0) __PYX_ERR(0, 778, __pyx_L19_error)

              /* "viur/datastore/transport.pyx":779
 * 						postData = {
 * 							"mode": "TRANSACTIONAL",  #
 * 							"transaction": txnKey,             # <<<<<<<<<<<<<<
 * 							"mutations": currentTxn["mutations"]
 * 						}
 */
              if (PyDict_SetItem(__pyx_t_10, __pyx_n_u_transaction, __pyx_v_txnKey) < 0) __PYX_ERR(0, 778, __pyx_L19_error)

              /* "viur/datastore/transport.pyx":780
 * 							"mode": "TRANSACTIONAL",  #
 * 							"transaction": txnKey,
 * 							"mutations": currentTxn["mutations"]             # <<<<<<<<<<<<<<
 * 						}
 * 						req = authenticatedRequest(
 */
              __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_currentTxn, __pyx_n_u_mutations); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 780, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_5);
              if (PyDict_SetItem(__pyx_t_10, __pyx_n_u_mutations, __pyx_t_5) < 0) __PYX_ERR(0, 778, __pyx_L19_error)
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF_SET(__pyx_v_postData, ((PyObject*)__pyx_t_10));
              __pyx_t_10 = 0;

              /* "viur/datastore/transport.pyx":782
 * 							"mutations": currentTxn["mutations"]
 * 						}
 * 						req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 							url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,
 * 							data=json.dumps(postData).encode("UTF-8"),
 */
              __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_authenticatedRequest); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 782, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_10);

              /* "viur/datastore/transport.pyx":783
 * 						}
 * 						req = authenticatedRequest(
 * 							url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,             # <<<<<<<<<<<<<<
 * 							data=json.dumps(postData).encode("UTF-8"),
 * 						)
 */
              __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 783, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_projectID); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 783, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_https_datastore_googleapis_com_v_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 783, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_url, __pyx_t_6) < 0) __PYX_ERR(0, 783, __pyx_L19_error)
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

              /* "viur/datastore/transport.pyx":784
 * 						req = authenticatedRequest(
 * 							url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,
 * 							data=json.dumps(postData).encode("UTF-8"),             # <<<<<<<<<<<<<<
 * 						)
 * 						if req.status_code != 200:
 */
              __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_json); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 784, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_dumps); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 784, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __pyx_t_12 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
                __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
                if (likely(__pyx_t_12)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
                  __Pyx_INCREF(__pyx_t_12);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_11, function);
                }
              }
              __pyx_t_7 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_v_postData) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_postData);
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 784, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 784, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __pyx_t_7 = NULL;
              if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
                __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11);
                if (likely(__pyx_t_7)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
                  __Pyx_INCREF(__pyx_t_7);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_11, function);
                }
              }
              __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_7, __pyx_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_kp_u_UTF_8);
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 784, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_data, __pyx_t_6) < 0) __PYX_ERR(0, 783, __pyx_L19_error)
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

              /* "viur/datastore/transport.pyx":782
 * 							"mutations": currentTxn["mutations"]
 * 						}
 * 						req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 							url="https://datastore.googleapis.com/v1/projects/%s:commit" % projectID,
 * 							data=json.dumps(postData).encode("UTF-8"),
 */
              __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 782, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF_SET(__pyx_v_req, __pyx_t_6);
              __pyx_t_6 = 0;

              /* "viur/datastore/transport.pyx":786
 * 							data=json.dumps(postData).encode("UTF-8"),
 * 						)
 * 						if req.status_code != 200:             # <<<<<<<<<<<<<<
 * 							if req.status_code == 409:  # We got a collision, in which case we can retry
 * 								raise Collision()
 */
              __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_status_code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 786, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_5 = __Pyx_PyInt_NeObjC(__pyx_t_6, __pyx_int_200, 0xC8, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 786, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 786, __pyx_L19_error)
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (__pyx_t_9) {

                /* "viur/datastore/transport.pyx":787
 * 						)
 * 						if req.status_code != 200:
 * 							if req.status_code == 409:  # We got a collision, in which case we can retry             # <<<<<<<<<<<<<<
 * 								raise Collision()
 * 							print("INVALID STATUS CODE RECEIVED")
 */
                __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_status_code); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 787, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_409, 0x199, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 787, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_6);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 787, __pyx_L19_error)
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(__pyx_t_9)) {

                  /* "viur/datastore/transport.pyx":788
 * 						if req.status_code != 200:
 * 							if req.status_code == 409:  # We got a collision, in which case we can retry
 * 								raise Collision()             # <<<<<<<<<<<<<<
 * 							print("INVALID STATUS CODE RECEIVED")
 * 							print(req.content)
 */
                  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Collision); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 788, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __pyx_t_10 = NULL;
                  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
                    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
                    if (likely(__pyx_t_10)) {
                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
                      __Pyx_INCREF(__pyx_t_10);
                      __Pyx_INCREF(function);
                      __Pyx_DECREF_SET(__pyx_t_5, function);
                    }
                  }
                  __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
                  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 788, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_6);
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
                  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                  __PYX_ERR(0, 788, __pyx_L19_error)

                  /* "viur/datastore/transport.pyx":787
 * 						)
 * 						if req.status_code != 200:
 * 							if req.status_code == 409:  # We got a collision, in which case we can retry             # <<<<<<<<<<<<<<
 * 								raise Collision()
 * 							print("INVALID STATUS CODE RECEIVED")
 */
                }

                /* "viur/datastore/transport.pyx":789
 * 							if req.status_code == 409:  # We got a collision, in which case we can retry
 * 								raise Collision()
 * 							print("INVALID STATUS CODE RECEIVED")             # <<<<<<<<<<<<<<
 * 							print(req.content)
 * 							pprint.pprint(json.loads(req.content))
 */
                __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 789, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_6);
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

                /* "viur/datastore/transport.pyx":790
 * 								raise Collision()
 * 							print("INVALID STATUS CODE RECEIVED")
 * 							print(req.content)             # <<<<<<<<<<<<<<
 * 							pprint.pprint(json.loads(req.content))
 * 							raise ValueError("Invalid status code received from Datastore API")
 */
                __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 790, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                /* "viur/datastore/transport.pyx":791
 * 							print("INVALID STATUS CODE RECEIVED")
 * 							print(req.content)
 * 							pprint.pprint(json.loads(req.content))             # <<<<<<<<<<<<<<
 * 							raise ValueError("Invalid status code received from Datastore API")
 * 						assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 */
                __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pprint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 791, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pprint); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 791, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_json); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 791, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_11);
                __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_loads); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 791, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_7);
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 791, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_11);
                __pyx_t_12 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
                  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
                  if (likely(__pyx_t_12)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
                    __Pyx_INCREF(__pyx_t_12);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_7, function);
                  }
                }
                __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_12, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_11);
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 791, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_6);
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                __pyx_t_7 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
                  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
                  if (likely(__pyx_t_7)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
                    __Pyx_INCREF(__pyx_t_7);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_10, function);
                  }
                }
                __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __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_5)) __PYX_ERR(0, 791, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                /* "viur/datastore/transport.pyx":792
 * 							print(req.content)
 * 							pprint.pprint(json.loads(req.content))
 * 							raise ValueError("Invalid status code received from Datastore API")             # <<<<<<<<<<<<<<
 * 						assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 						element = parser.parse(data_ptr, pysize, 1)
 */
                __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 792, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_Raise(__pyx_t_5, 0, 0, 0);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                __PYX_ERR(0, 792, __pyx_L19_error)

                /* "viur/datastore/transport.pyx":786
 * 							data=json.dumps(postData).encode("UTF-8"),
 * 						)
 * 						if req.status_code != 200:             # <<<<<<<<<<<<<<
 * 							if req.status_code == 409:  # We got a collision, in which case we can retry
 * 								raise Collision()
 */
              }

              /* "viur/datastore/transport.pyx":793
 * 							pprint.pprint(json.loads(req.content))
 * 							raise ValueError("Invalid status code received from Datastore API")
 * 						assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1             # <<<<<<<<<<<<<<
 * 						element = parser.parse(data_ptr, pysize, 1)
 * 						if (element.at("mutationResults").error() != SUCCESS):
 */
              #ifndef CYTHON_WITHOUT_ASSERTIONS
              if (unlikely(!Py_OptimizeFlag)) {
                __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_16 = PyBytes_AsStringAndSize(__pyx_t_5, (&__pyx_v_data_ptr), (&__pyx_v_pysize)); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 793, __pyx_L19_error)
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                if (unlikely(!((__pyx_t_16 != -1L) != 0))) {
                  PyErr_SetNone(PyExc_AssertionError);
                  __PYX_ERR(0, 793, __pyx_L19_error)
                }
              }
              #endif

              /* "viur/datastore/transport.pyx":794
 * 							raise ValueError("Invalid status code received from Datastore API")
 * 						assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 						element = parser.parse(data_ptr, pysize, 1)             # <<<<<<<<<<<<<<
 * 						if (element.at("mutationResults").error() != SUCCESS):
 * 							print(req.content)
 */
              try {
                __pyx_t_17 = __pyx_v_parser.parse(__pyx_v_data_ptr, __pyx_v_pysize, 1);
              } catch(...) {
                __Pyx_CppExn2PyErr();
                __PYX_ERR(0, 794, __pyx_L19_error)
              }
              __pyx_v_element = __pyx_t_17;

              /* "viur/datastore/transport.pyx":795
 * 						assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 						element = parser.parse(data_ptr, pysize, 1)
 * 						if (element.at("mutationResults").error() != SUCCESS):             # <<<<<<<<<<<<<<
 * 							print(req.content)
 * 							raise ValueError("No mutation-results received")
 */
              __pyx_t_9 = ((__pyx_v_element.at(((char const *)"mutationResults")).error() != simdjson::error_code::SUCCESS) != 0);
              if (unlikely(__pyx_t_9)) {

                /* "viur/datastore/transport.pyx":796
 * 						element = parser.parse(data_ptr, pysize, 1)
 * 						if (element.at("mutationResults").error() != SUCCESS):
 * 							print(req.content)             # <<<<<<<<<<<<<<
 * 							raise ValueError("No mutation-results received")
 * 						arrayElem = element.at_key("mutationResults").get_array()
 */
                __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 796, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 796, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

                /* "viur/datastore/transport.pyx":797
 * 						if (element.at("mutationResults").error() != SUCCESS):
 * 							print(req.content)
 * 							raise ValueError("No mutation-results received")             # <<<<<<<<<<<<<<
 * 						arrayElem = element.at_key("mutationResults").get_array()
 * 						if arrayElem.size() != len(currentTxn["affectedEntities"]):
 */
                __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 797, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_Raise(__pyx_t_10, 0, 0, 0);
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __PYX_ERR(0, 797, __pyx_L19_error)

                /* "viur/datastore/transport.pyx":795
 * 						assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 						element = parser.parse(data_ptr, pysize, 1)
 * 						if (element.at("mutationResults").error() != SUCCESS):             # <<<<<<<<<<<<<<
 * 							print(req.content)
 * 							raise ValueError("No mutation-results received")
 */
              }

              /* "viur/datastore/transport.pyx":798
 * 							print(req.content)
 * 							raise ValueError("No mutation-results received")
 * 						arrayElem = element.at_key("mutationResults").get_array()             # <<<<<<<<<<<<<<
 * 						if arrayElem.size() != len(currentTxn["affectedEntities"]):
 * 							print(req.content)
 */
              try {
                __pyx_t_17 = __pyx_v_element.at_key(((char const *)"mutationResults"));
              } catch(...) {
                __Pyx_CppExn2PyErr();
                __PYX_ERR(0, 798, __pyx_L19_error)
              }
              try {
                __pyx_t_18 = __pyx_t_17.get_array();
              } catch(...) {
                __Pyx_CppExn2PyErr();
                __PYX_ERR(0, 798, __pyx_L19_error)
              }
              __pyx_v_arrayElem = __pyx_t_18;

              /* "viur/datastore/transport.pyx":799
 * 							raise ValueError("No mutation-results received")
 * 						arrayElem = element.at_key("mutationResults").get_array()
 * 						if arrayElem.size() != len(currentTxn["affectedEntities"]):             # <<<<<<<<<<<<<<
 * 							print(req.content)
 * 							raise ValueError("Invalid number of mutation-results received")
 */
              __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_currentTxn, __pyx_n_u_affectedEntities); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 799, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_19 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_19 == ((Py_ssize_t)-1))) __PYX_ERR(0, 799, __pyx_L19_error)
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_9 = ((__pyx_v_arrayElem.size() != __pyx_t_19) != 0);
              if (unlikely(__pyx_t_9)) {

                /* "viur/datastore/transport.pyx":800
 * 						arrayElem = element.at_key("mutationResults").get_array()
 * 						if arrayElem.size() != len(currentTxn["affectedEntities"]):
 * 							print(req.content)             # <<<<<<<<<<<<<<
 * 							raise ValueError("Invalid number of mutation-results received")
 * 						arrayIt = arrayElem.begin()
 */
                __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 800, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_10);
                __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 800, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                /* "viur/datastore/transport.pyx":801
 * 						if arrayElem.size() != len(currentTxn["affectedEntities"]):
 * 							print(req.content)
 * 							raise ValueError("Invalid number of mutation-results received")             # <<<<<<<<<<<<<<
 * 						arrayIt = arrayElem.begin()
 * 						idx = 0
 */
                __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 801, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_Raise(__pyx_t_5, 0, 0, 0);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                __PYX_ERR(0, 801, __pyx_L19_error)

                /* "viur/datastore/transport.pyx":799
 * 							raise ValueError("No mutation-results received")
 * 						arrayElem = element.at_key("mutationResults").get_array()
 * 						if arrayElem.size() != len(currentTxn["affectedEntities"]):             # <<<<<<<<<<<<<<
 * 							print(req.content)
 * 							raise ValueError("Invalid number of mutation-results received")
 */
              }

              /* "viur/datastore/transport.pyx":802
 * 							print(req.content)
 * 							raise ValueError("Invalid number of mutation-results received")
 * 						arrayIt = arrayElem.begin()             # <<<<<<<<<<<<<<
 * 						idx = 0
 * 						while arrayIt != arrayElem.end():
 */
              __pyx_v_arrayIt = __pyx_v_arrayElem.begin();

              /* "viur/datastore/transport.pyx":803
 * 							raise ValueError("Invalid number of mutation-results received")
 * 						arrayIt = arrayElem.begin()
 * 						idx = 0             # <<<<<<<<<<<<<<
 * 						while arrayIt != arrayElem.end():
 * 							innerArrayElem = dereference(arrayIt)
 */
              __Pyx_INCREF(__pyx_int_0);
              __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_int_0);

              /* "viur/datastore/transport.pyx":804
 * 						arrayIt = arrayElem.begin()
 * 						idx = 0
 * 						while arrayIt != arrayElem.end():             # <<<<<<<<<<<<<<
 * 							innerArrayElem = dereference(arrayIt)
 * 							if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned
 */
              while (1) {
                __pyx_t_9 = ((__pyx_v_arrayIt != __pyx_v_arrayElem.end()) != 0);
                if (!__pyx_t_9) break;

                /* "viur/datastore/transport.pyx":805
 * 						idx = 0
 * 						while arrayIt != arrayElem.end():
 * 							innerArrayElem = dereference(arrayIt)             # <<<<<<<<<<<<<<
 * 							if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned
 * 								affectedEntity = currentTxn["affectedEntities"][idx]
 */
                __pyx_v_innerArrayElem = (*__pyx_v_arrayIt);

                /* "viur/datastore/transport.pyx":806
 * 						while arrayIt != arrayElem.end():
 * 							innerArrayElem = dereference(arrayIt)
 * 							if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned             # <<<<<<<<<<<<<<
 * 								affectedEntity = currentTxn["affectedEntities"][idx]
 * 								if not affectedEntity:
 */
                __pyx_t_9 = ((__pyx_v_innerArrayElem.at(((char const *)"key")).error() == simdjson::error_code::SUCCESS) != 0);
                if (__pyx_t_9) {

                  /* "viur/datastore/transport.pyx":807
 * 							innerArrayElem = dereference(arrayIt)
 * 							if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned
 * 								affectedEntity = currentTxn["affectedEntities"][idx]             # <<<<<<<<<<<<<<
 * 								if not affectedEntity:
 * 									print(req.content)
 */
                  __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_currentTxn, __pyx_n_u_affectedEntities); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 807, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_idx); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 807, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_10);
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __Pyx_XDECREF_SET(__pyx_v_affectedEntity, __pyx_t_10);
                  __pyx_t_10 = 0;

                  /* "viur/datastore/transport.pyx":808
 * 							if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned
 * 								affectedEntity = currentTxn["affectedEntities"][idx]
 * 								if not affectedEntity:             # <<<<<<<<<<<<<<
 * 									print(req.content)
 * 									raise ValueError("Received an unexpected key-update")
 */
                  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_affectedEntity); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 808, __pyx_L19_error)
                  __pyx_t_8 = ((!__pyx_t_9) != 0);
                  if (unlikely(__pyx_t_8)) {

                    /* "viur/datastore/transport.pyx":809
 * 								affectedEntity = currentTxn["affectedEntities"][idx]
 * 								if not affectedEntity:
 * 									print(req.content)             # <<<<<<<<<<<<<<
 * 									raise ValueError("Received an unexpected key-update")
 * 								affectedEntity.key = parseKey(innerArrayElem.at_key("key"))
 */
                    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 809, __pyx_L19_error)
                    __Pyx_GOTREF(__pyx_t_10);
                    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 809, __pyx_L19_error)
                    __Pyx_GOTREF(__pyx_t_5);
                    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                    /* "viur/datastore/transport.pyx":810
 * 								if not affectedEntity:
 * 									print(req.content)
 * 									raise ValueError("Received an unexpected key-update")             # <<<<<<<<<<<<<<
 * 								affectedEntity.key = parseKey(innerArrayElem.at_key("key"))
 * 								affectedEntity.version = toPyStr(innerArrayElem.at_key("version").get_string())
 */
                    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 810, __pyx_L19_error)
                    __Pyx_GOTREF(__pyx_t_5);
                    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                    __PYX_ERR(0, 810, __pyx_L19_error)

                    /* "viur/datastore/transport.pyx":808
 * 							if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned
 * 								affectedEntity = currentTxn["affectedEntities"][idx]
 * 								if not affectedEntity:             # <<<<<<<<<<<<<<
 * 									print(req.content)
 * 									raise ValueError("Received an unexpected key-update")
 */
                  }

                  /* "viur/datastore/transport.pyx":811
 * 									print(req.content)
 * 									raise ValueError("Received an unexpected key-update")
 * 								affectedEntity.key = parseKey(innerArrayElem.at_key("key"))             # <<<<<<<<<<<<<<
 * 								affectedEntity.version = toPyStr(innerArrayElem.at_key("version").get_string())
 * 							preincrement(arrayIt)
 */
                  try {
                    __pyx_t_17 = __pyx_v_innerArrayElem.at_key(((char const *)"key"));
                  } catch(...) {
                    __Pyx_CppExn2PyErr();
                    __PYX_ERR(0, 811, __pyx_L19_error)
                  }
                  __pyx_t_5 = __pyx_f_4viur_9datastore_9transport_parseKey(__pyx_t_17); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 811, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  if (__Pyx_PyObject_SetAttrStr(__pyx_v_affectedEntity, __pyx_n_s_key, __pyx_t_5) < 0) __PYX_ERR(0, 811, __pyx_L19_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                  /* "viur/datastore/transport.pyx":812
 * 									raise ValueError("Received an unexpected key-update")
 * 								affectedEntity.key = parseKey(innerArrayElem.at_key("key"))
 * 								affectedEntity.version = toPyStr(innerArrayElem.at_key("version").get_string())             # <<<<<<<<<<<<<<
 * 							preincrement(arrayIt)
 * 							idx += 1
 */
                  try {
                    __pyx_t_17 = __pyx_v_innerArrayElem.at_key(((char const *)"version"));
                  } catch(...) {
                    __Pyx_CppExn2PyErr();
                    __PYX_ERR(0, 812, __pyx_L19_error)
                  }
                  try {
                    __pyx_t_20 = __pyx_t_17.get_string();
                  } catch(...) {
                    __Pyx_CppExn2PyErr();
                    __PYX_ERR(0, 812, __pyx_L19_error)
                  }
                  __pyx_t_5 = __pyx_f_4viur_9datastore_9transport_toPyStr(__pyx_t_20); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 812, __pyx_L19_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  if (__Pyx_PyObject_SetAttrStr(__pyx_v_affectedEntity, __pyx_n_s_version, __pyx_t_5) < 0) __PYX_ERR(0, 812, __pyx_L19_error)
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                  /* "viur/datastore/transport.pyx":806
 * 						while arrayIt != arrayElem.end():
 * 							innerArrayElem = dereference(arrayIt)
 * 							if innerArrayElem.at("key").error() == SUCCESS:  # We got a new key assigned             # <<<<<<<<<<<<<<
 * 								affectedEntity = currentTxn["affectedEntities"][idx]
 * 								if not affectedEntity:
 */
                }

                /* "viur/datastore/transport.pyx":813
 * 								affectedEntity.key = parseKey(innerArrayElem.at_key("key"))
 * 								affectedEntity.version = toPyStr(innerArrayElem.at_key("version").get_string())
 * 							preincrement(arrayIt)             # <<<<<<<<<<<<<<
 * 							idx += 1
 * 						return res
 */
                (void)((++__pyx_v_arrayIt));

                /* "viur/datastore/transport.pyx":814
 * 								affectedEntity.version = toPyStr(innerArrayElem.at_key("version").get_string())
 * 							preincrement(arrayIt)
 * 							idx += 1             # <<<<<<<<<<<<<<
 * 						return res
 * 					else:  # No changes have been made - free txn
 */
                __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_idx, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 814, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_5);
                __pyx_t_5 = 0;
              }

              /* "viur/datastore/transport.pyx":815
 * 							preincrement(arrayIt)
 * 							idx += 1
 * 						return res             # <<<<<<<<<<<<<<
 * 					else:  # No changes have been made - free txn
 * 						_rollbackTxn(txnKey)
 */
              __Pyx_XDECREF(__pyx_r);
              __Pyx_INCREF(__pyx_v_res);
              __pyx_r = __pyx_v_res;
              goto __pyx_L18_return;

              /* "viur/datastore/transport.pyx":775
 * 						_rollbackTxn(txnKey)
 * 						raise
 * 					if currentTxn["mutations"]:             # <<<<<<<<<<<<<<
 * 						# Commit TXN
 * 						postData = {
 */
            }

            /* "viur/datastore/transport.pyx":817
 * 						return res
 * 					else:  # No changes have been made - free txn
 * 						_rollbackTxn(txnKey)             # <<<<<<<<<<<<<<
 * 						return res
 * 				finally:  # Ensure, currentTransaction is always set back to none
 */
            /*else*/ {
              __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_rollbackTxn); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 817, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_6 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
                __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
                if (likely(__pyx_t_6)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
                  __Pyx_INCREF(__pyx_t_6);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_10, function);
                }
              }
              __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_6, __pyx_v_txnKey) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_txnKey);
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L19_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

              /* "viur/datastore/transport.pyx":818
 * 					else:  # No changes have been made - free txn
 * 						_rollbackTxn(txnKey)
 * 						return res             # <<<<<<<<<<<<<<
 * 				finally:  # Ensure, currentTransaction is always set back to none
 * 					currentTransaction.set(None)
 */
              __Pyx_XDECREF(__pyx_r);
              __Pyx_INCREF(__pyx_v_res);
              __pyx_r = __pyx_v_res;
              goto __pyx_L18_return;
            }
          }

          /* "viur/datastore/transport.pyx":820
 * 						return res
 * 				finally:  # Ensure, currentTransaction is always set back to none
 * 					currentTransaction.set(None)             # <<<<<<<<<<<<<<
 * 		except Collision:  # Got a collision; retry the entire transaction
 * 			logging.warning("Transaction collision, retrying...")
 */
          /*finally:*/ {
            __pyx_L19_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
              __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_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
              __Pyx_XGOTREF(__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_14);
              __Pyx_XGOTREF(__pyx_t_13);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_25);
              __pyx_t_16 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_22 = __pyx_filename;
              {
                __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_currentTransaction); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 820, __pyx_L43_error)
                __Pyx_GOTREF(__pyx_t_10);
                __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L43_error)
                __Pyx_GOTREF(__pyx_t_6);
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_10 = NULL;
                if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
                  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
                  if (likely(__pyx_t_10)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
                    __Pyx_INCREF(__pyx_t_10);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_6, function);
                  }
                }
                __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_10, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_6, Py_None);
                __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 820, __pyx_L43_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_23);
                __Pyx_XGIVEREF(__pyx_t_24);
                __Pyx_XGIVEREF(__pyx_t_25);
                __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25);
              }
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_XGIVEREF(__pyx_t_14);
              __Pyx_XGIVEREF(__pyx_t_13);
              __Pyx_ErrRestore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
              __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
              __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_22;
              goto __pyx_L5_error;
              __pyx_L43_error:;
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_23);
                __Pyx_XGIVEREF(__pyx_t_24);
                __Pyx_XGIVEREF(__pyx_t_25);
                __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25);
              }
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
              goto __pyx_L5_error;
            }
            __pyx_L18_return: {
              __pyx_t_25 = __pyx_r;
              __pyx_r = 0;
              __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_currentTransaction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L5_error)
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_set); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 820, __pyx_L5_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __pyx_t_6 = NULL;
              if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
                __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
                if (likely(__pyx_t_6)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
                  __Pyx_INCREF(__pyx_t_6);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_10, function);
                }
              }
              __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_6, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_10, Py_None);
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 820, __pyx_L5_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __pyx_r = __pyx_t_25;
              __pyx_t_25 = 0;
              goto __pyx_L9_try_return;
            }
          }
        }

        /* "viur/datastore/transport.pyx":740
 * 	cdef simdjsonArray.iterator arrayIt
 * 	for _ in range(0, 3):
 * 		try:             # <<<<<<<<<<<<<<
 * 			oldTxn = currentTransaction.get()
 * 			allowOverriding = kwargs.pop("__allowOverriding__", None)
 */
      }
      __pyx_L5_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_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "viur/datastore/transport.pyx":821
 * 				finally:  # Ensure, currentTransaction is always set back to none
 * 					currentTransaction.set(None)
 * 		except Collision:  # Got a collision; retry the entire transaction             # <<<<<<<<<<<<<<
 * 			logging.warning("Transaction collision, retrying...")
 * 	raise Collision() # If we made it here, all tries are exhausted
 */
      __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_10, &__pyx_t_6);
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Collision); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 821, __pyx_L7_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_21 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_5, __pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_ErrRestore(__pyx_t_5, __pyx_t_10, __pyx_t_6);
      __pyx_t_5 = 0; __pyx_t_10 = 0; __pyx_t_6 = 0;
      if (__pyx_t_21) {
        __Pyx_AddTraceback("viur.datastore.transport.RunInTransaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_10, &__pyx_t_5) < 0) __PYX_ERR(0, 821, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_5);

        /* "viur/datastore/transport.pyx":822
 * 					currentTransaction.set(None)
 * 		except Collision:  # Got a collision; retry the entire transaction
 * 			logging.warning("Transaction collision, retrying...")             # <<<<<<<<<<<<<<
 * 	raise Collision() # If we made it here, all tries are exhausted
 * 
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_logging); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 822, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_warning); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 822, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_7 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_11, __pyx_kp_u_Transaction_collision_retrying) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_kp_u_Transaction_collision_retrying);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 822, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "viur/datastore/transport.pyx":740
 * 	cdef simdjsonArray.iterator arrayIt
 * 	for _ in range(0, 3):
 * 		try:             # <<<<<<<<<<<<<<
 * 			oldTxn = currentTransaction.get()
 * 			allowOverriding = kwargs.pop("__allowOverriding__", None)
 */
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L1_error;
      __pyx_L9_try_return:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L0;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    }
  }

  /* "viur/datastore/transport.pyx":823
 * 		except Collision:  # Got a collision; retry the entire transaction
 * 			logging.warning("Transaction collision, retrying...")
 * 	raise Collision() # If we made it here, all tries are exhausted             # <<<<<<<<<<<<<<
 * 
 * def _rollbackTxn(txnKey: str):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Collision); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __PYX_ERR(0, 823, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":724
 * 	pass
 * 
 * def RunInTransaction(callback: callable, *args, **kwargs) -> Any:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs the given function inside a AID transaction.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("viur.datastore.transport.RunInTransaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_oldTxn);
  __Pyx_XDECREF(__pyx_v_allowOverriding);
  __Pyx_XDECREF(__pyx_v_txnOptions);
  __Pyx_XDECREF(__pyx_v_postData);
  __Pyx_XDECREF(__pyx_v_req);
  __Pyx_XDECREF(__pyx_v_txnKey);
  __Pyx_XDECREF(__pyx_v_currentTxn);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_affectedEntity);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":825
 * 	raise Collision() # If we made it here, all tries are exhausted
 * 
 * def _rollbackTxn(txnKey: str):             # <<<<<<<<<<<<<<
 * 	"""
 * 		Internal helper that aborts the given transaction. It's important to abort pending transactions (instead
 */

/* Python wrapper */
static PyObject *__pyx_pw_4viur_9datastore_9transport_17_rollbackTxn(PyObject *__pyx_self, PyObject *__pyx_v_txnKey); /*proto*/
static char __pyx_doc_4viur_9datastore_9transport_16_rollbackTxn[] = "\n\t\tInternal helper that aborts the given transaction. It's important to abort pending transactions (instead\n\t\tof letting them expire server-side) so that other requests that are stalled waiting for this transaction to\n\t\tcomplete can continue.\n\n\t\t:param txnKey: The ID of the transaction that should be aborted\n\t";
static PyMethodDef __pyx_mdef_4viur_9datastore_9transport_17_rollbackTxn = {"_rollbackTxn", (PyCFunction)__pyx_pw_4viur_9datastore_9transport_17_rollbackTxn, METH_O, __pyx_doc_4viur_9datastore_9transport_16_rollbackTxn};
static PyObject *__pyx_pw_4viur_9datastore_9transport_17_rollbackTxn(PyObject *__pyx_self, PyObject *__pyx_v_txnKey) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_rollbackTxn (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_txnKey), (&PyUnicode_Type), 1, "txnKey", 1))) __PYX_ERR(0, 825, __pyx_L1_error)
  __pyx_r = __pyx_pf_4viur_9datastore_9transport_16_rollbackTxn(__pyx_self, ((PyObject*)__pyx_v_txnKey));

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

static PyObject *__pyx_pf_4viur_9datastore_9transport_16_rollbackTxn(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_txnKey) {
  PyObject *__pyx_v_postData = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_req = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_rollbackTxn", 0);

  /* "viur/datastore/transport.pyx":834
 * 	"""
 * 	postData = {
 * 		"transaction": txnKey             # <<<<<<<<<<<<<<
 * 	}
 * 	req = authenticatedRequest(
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_transaction, __pyx_v_txnKey) < 0) __PYX_ERR(0, 834, __pyx_L1_error)
  __pyx_v_postData = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":836
 * 		"transaction": txnKey
 * 	}
 * 	req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 		url="https://datastore.googleapis.com/v1/projects/%s:rollback" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_authenticatedRequest); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "viur/datastore/transport.pyx":837
 * 	}
 * 	req = authenticatedRequest(
 * 		url="https://datastore.googleapis.com/v1/projects/%s:rollback" % projectID,             # <<<<<<<<<<<<<<
 * 		data=json.dumps(postData).encode("UTF-8"),
 * 	)
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_projectID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_https_datastore_googleapis_com_v_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_url, __pyx_t_4) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":838
 * 	req = authenticatedRequest(
 * 		url="https://datastore.googleapis.com/v1/projects/%s:rollback" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),             # <<<<<<<<<<<<<<
 * 	)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_json); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dumps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __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 && 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_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_postData) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_postData);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __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_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_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_u_UTF_8);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data, __pyx_t_4) < 0) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":836
 * 		"transaction": txnKey
 * 	}
 * 	req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 		url="https://datastore.googleapis.com/v1/projects/%s:rollback" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __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_v_req = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":825
 * 	raise Collision() # If we made it here, all tries are exhausted
 * 
 * def _rollbackTxn(txnKey: str):             # <<<<<<<<<<<<<<
 * 	"""
 * 		Internal helper that aborts the given transaction. It's important to abort pending transactions (instead
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("viur.datastore.transport._rollbackTxn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_postData);
  __Pyx_XDECREF(__pyx_v_req);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "viur/datastore/transport.pyx":841
 * 	)
 * 
 * def AllocateIDs(keys: Union[Key, List[Key]]) -> Union[Key, List[Key]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Allocates numeric IDs for the keys given.
 */

/* Python wrapper */
static PyObject *__pyx_pw_4viur_9datastore_9transport_19AllocateIDs(PyObject *__pyx_self, PyObject *__pyx_v_keys); /*proto*/
static char __pyx_doc_4viur_9datastore_9transport_18AllocateIDs[] = "\n\t\tAllocates numeric IDs for the keys given.\n\t\t:return: The complete Key (or a list hereof)\n\n\t\t.. warning: This function does not support transactions! Even if called inside transactions, the keys will\n\t\t\tbe allocated immediately, even if the transaction aborts.\n\t";
static PyMethodDef __pyx_mdef_4viur_9datastore_9transport_19AllocateIDs = {"AllocateIDs", (PyCFunction)__pyx_pw_4viur_9datastore_9transport_19AllocateIDs, METH_O, __pyx_doc_4viur_9datastore_9transport_18AllocateIDs};
static PyObject *__pyx_pw_4viur_9datastore_9transport_19AllocateIDs(PyObject *__pyx_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("AllocateIDs (wrapper)", 0);
  __pyx_r = __pyx_pf_4viur_9datastore_9transport_18AllocateIDs(__pyx_self, ((PyObject *)__pyx_v_keys));

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

static PyObject *__pyx_pf_4viur_9datastore_9transport_18AllocateIDs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_keys) {
  simdjson::dom::parser __pyx_v_parser;
  Py_ssize_t __pyx_v_pysize;
  char *__pyx_v_data_ptr;
  simdjson::dom::element __pyx_v_element;
  int __pyx_v_isMulti;
  PyObject *__pyx_v_keyList = NULL;
  PyObject *__pyx_v_requestedKeys = NULL;
  PyObject *__pyx_v_postData = NULL;
  PyObject *__pyx_v_req = NULL;
  PyObject *__pyx_v_res = NULL;
  simdjson::dom::array __pyx_v_arrayElem;
  simdjson::dom::array::iterator __pyx_v_arrayIt;
  simdjson::dom::element __pyx_v_innerArrayElem;
  PyObject *__pyx_8genexpr9__pyx_v_x = 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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  simdjson::dom::element __pyx_t_12;
  simdjson::dom::array __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("AllocateIDs", 0);
  __Pyx_INCREF(__pyx_v_keys);

  /* "viur/datastore/transport.pyx":849
 * 			be allocated immediately, even if the transaction aborts.
 * 	"""
 * 	cdef simdjsonParser parser = simdjsonParser()             # <<<<<<<<<<<<<<
 * 	cdef Py_ssize_t pysize
 * 	cdef char * data_ptr
 */
  __pyx_v_parser = simdjson::dom::parser();

  /* "viur/datastore/transport.pyx":853
 * 	cdef char * data_ptr
 * 	cdef simdjsonElement element
 * 	isMulti = True             # <<<<<<<<<<<<<<
 * 	if isinstance(keys, Key):
 * 		keys = [keys]
 */
  __pyx_v_isMulti = 1;

  /* "viur/datastore/transport.pyx":854
 * 	cdef simdjsonElement element
 * 	isMulti = True
 * 	if isinstance(keys, Key):             # <<<<<<<<<<<<<<
 * 		keys = [keys]
 * 		isMulti = False
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_keys, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "viur/datastore/transport.pyx":855
 * 	isMulti = True
 * 	if isinstance(keys, Key):
 * 		keys = [keys]             # <<<<<<<<<<<<<<
 * 		isMulti = False
 * 	keyList = [
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_keys);
    __Pyx_GIVEREF(__pyx_v_keys);
    PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_keys);
    __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "viur/datastore/transport.pyx":856
 * 	if isinstance(keys, Key):
 * 		keys = [keys]
 * 		isMulti = False             # <<<<<<<<<<<<<<
 * 	keyList = [
 * 		{
 */
    __pyx_v_isMulti = 0;

    /* "viur/datastore/transport.pyx":854
 * 	cdef simdjsonElement element
 * 	isMulti = True
 * 	if isinstance(keys, Key):             # <<<<<<<<<<<<<<
 * 		keys = [keys]
 * 		isMulti = False
 */
  }

  /* "viur/datastore/transport.pyx":857
 * 		keys = [keys]
 * 		isMulti = False
 * 	keyList = [             # <<<<<<<<<<<<<<
 * 		{
 * 			"partitionId": {
 */
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "viur/datastore/transport.pyx":864
 * 			"path": keyToPath(x)
 * 		}
 * 		for x in keys]             # <<<<<<<<<<<<<<
 * 
 * 	requestedKeys = keyList[:300]
 */
    if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) {
      __pyx_t_4 = __pyx_v_keys; __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_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 864, __pyx_L6_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, 864, __pyx_L6_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 864, __pyx_L6_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, 864, __pyx_L6_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 864, __pyx_L6_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, 864, __pyx_L6_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_x, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "viur/datastore/transport.pyx":859
 * 	keyList = [
 * 		{
 * 			"partitionId": {             # <<<<<<<<<<<<<<
 * 				"project_id": projectID,
 * 			},
 */
      __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 859, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_7);

      /* "viur/datastore/transport.pyx":860
 * 		{
 * 			"partitionId": {
 * 				"project_id": projectID,             # <<<<<<<<<<<<<<
 * 			},
 * 			"path": keyToPath(x)
 */
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 860, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_projectID); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 860, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_u_project_id, __pyx_t_9) < 0) __PYX_ERR(0, 860, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_partitionId, __pyx_t_8) < 0) __PYX_ERR(0, 859, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "viur/datastore/transport.pyx":862
 * 				"project_id": projectID,
 * 			},
 * 			"path": keyToPath(x)             # <<<<<<<<<<<<<<
 * 		}
 * 		for x in keys]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_keyToPath); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 862, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(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_8genexpr9__pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_8genexpr9__pyx_v_x);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 862, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PyDict_SetItem(__pyx_t_7, __pyx_n_u_path, __pyx_t_8) < 0) __PYX_ERR(0, 859, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 857, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "viur/datastore/transport.pyx":864
 * 			"path": keyToPath(x)
 * 		}
 * 		for x in keys]             # <<<<<<<<<<<<<<
 * 
 * 	requestedKeys = keyList[:300]
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_x); __pyx_8genexpr9__pyx_v_x = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_x); __pyx_8genexpr9__pyx_v_x = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_v_keyList = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":866
 * 		for x in keys]
 * 
 * 	requestedKeys = keyList[:300]             # <<<<<<<<<<<<<<
 * 	postData = {
 * 		"keys": requestedKeys,
 */
  __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_keyList, 0, 0x12C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_requestedKeys = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":868
 * 	requestedKeys = keyList[:300]
 * 	postData = {
 * 		"keys": requestedKeys,             # <<<<<<<<<<<<<<
 * 	}
 * 	req = authenticatedRequest(
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_keys, __pyx_v_requestedKeys) < 0) __PYX_ERR(0, 868, __pyx_L1_error)
  __pyx_v_postData = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":870
 * 		"keys": requestedKeys,
 * 	}
 * 	req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 		url="https://datastore.googleapis.com/v1/projects/%s:allocateIds" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_authenticatedRequest); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "viur/datastore/transport.pyx":871
 * 	}
 * 	req = authenticatedRequest(
 * 		url="https://datastore.googleapis.com/v1/projects/%s:allocateIds" % projectID,             # <<<<<<<<<<<<<<
 * 		data=json.dumps(postData).encode("UTF-8"),
 * 	)
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_projectID); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_https_datastore_googleapis_com_v_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_url, __pyx_t_8) < 0) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "viur/datastore/transport.pyx":872
 * 	req = authenticatedRequest(
 * 		url="https://datastore.googleapis.com/v1/projects/%s:allocateIds" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),             # <<<<<<<<<<<<<<
 * 	)
 * 	assert req.status_code == 200
 */
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_json); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dumps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 872, __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 && unlikely(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_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_postData) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_postData);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_encode); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_kp_u_UTF_8) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_kp_u_UTF_8);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_data, __pyx_t_8) < 0) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "viur/datastore/transport.pyx":870
 * 		"keys": requestedKeys,
 * 	}
 * 	req = authenticatedRequest(             # <<<<<<<<<<<<<<
 * 		url="https://datastore.googleapis.com/v1/projects/%s:allocateIds" % projectID,
 * 		data=json.dumps(postData).encode("UTF-8"),
 */
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_req = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "viur/datastore/transport.pyx":874
 * 		data=json.dumps(postData).encode("UTF-8"),
 * 	)
 * 	assert req.status_code == 200             # <<<<<<<<<<<<<<
 * 	assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 	element = parser.parse(data_ptr, pysize, 1)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_status_code); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_8, __pyx_int_200, 0xC8, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 874, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 874, __pyx_L1_error)
    }
  }
  #endif

  /* "viur/datastore/transport.pyx":875
 * 	)
 * 	assert req.status_code == 200
 * 	assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1             # <<<<<<<<<<<<<<
 * 	element = parser.parse(data_ptr, pysize, 1)
 * 	res = []
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = PyBytes_AsStringAndSize(__pyx_t_4, (&__pyx_v_data_ptr), (&__pyx_v_pysize)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 875, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!((__pyx_t_11 != -1L) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 875, __pyx_L1_error)
    }
  }
  #endif

  /* "viur/datastore/transport.pyx":876
 * 	assert req.status_code == 200
 * 	assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 	element = parser.parse(data_ptr, pysize, 1)             # <<<<<<<<<<<<<<
 * 	res = []
 * 	if (element.at("keys").error() == SUCCESS):
 */
  try {
    __pyx_t_12 = __pyx_v_parser.parse(__pyx_v_data_ptr, __pyx_v_pysize, 1);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 876, __pyx_L1_error)
  }
  __pyx_v_element = __pyx_t_12;

  /* "viur/datastore/transport.pyx":877
 * 	assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 	element = parser.parse(data_ptr, pysize, 1)
 * 	res = []             # <<<<<<<<<<<<<<
 * 	if (element.at("keys").error() == SUCCESS):
 * 		arrayElem = element.at_key("keys").get_array()
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_res = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":878
 * 	element = parser.parse(data_ptr, pysize, 1)
 * 	res = []
 * 	if (element.at("keys").error() == SUCCESS):             # <<<<<<<<<<<<<<
 * 		arrayElem = element.at_key("keys").get_array()
 * 		arrayIt = arrayElem.begin()
 */
  __pyx_t_3 = ((__pyx_v_element.at(((char const *)"keys")).error() == simdjson::error_code::SUCCESS) != 0);
  if (likely(__pyx_t_3)) {

    /* "viur/datastore/transport.pyx":879
 * 	res = []
 * 	if (element.at("keys").error() == SUCCESS):
 * 		arrayElem = element.at_key("keys").get_array()             # <<<<<<<<<<<<<<
 * 		arrayIt = arrayElem.begin()
 * 		while arrayIt != arrayElem.end():
 */
    try {
      __pyx_t_12 = __pyx_v_element.at_key(((char const *)"keys"));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 879, __pyx_L1_error)
    }
    try {
      __pyx_t_13 = __pyx_t_12.get_array();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 879, __pyx_L1_error)
    }
    __pyx_v_arrayElem = __pyx_t_13;

    /* "viur/datastore/transport.pyx":880
 * 	if (element.at("keys").error() == SUCCESS):
 * 		arrayElem = element.at_key("keys").get_array()
 * 		arrayIt = arrayElem.begin()             # <<<<<<<<<<<<<<
 * 		while arrayIt != arrayElem.end():
 * 			innerArrayElem = dereference(arrayIt)
 */
    __pyx_v_arrayIt = __pyx_v_arrayElem.begin();

    /* "viur/datastore/transport.pyx":881
 * 		arrayElem = element.at_key("keys").get_array()
 * 		arrayIt = arrayElem.begin()
 * 		while arrayIt != arrayElem.end():             # <<<<<<<<<<<<<<
 * 			innerArrayElem = dereference(arrayIt)
 * 			res.append( parseKey(innerArrayElem))
 */
    while (1) {
      __pyx_t_3 = ((__pyx_v_arrayIt != __pyx_v_arrayElem.end()) != 0);
      if (!__pyx_t_3) break;

      /* "viur/datastore/transport.pyx":882
 * 		arrayIt = arrayElem.begin()
 * 		while arrayIt != arrayElem.end():
 * 			innerArrayElem = dereference(arrayIt)             # <<<<<<<<<<<<<<
 * 			res.append( parseKey(innerArrayElem))
 * 			preincrement(arrayIt)
 */
      __pyx_v_innerArrayElem = (*__pyx_v_arrayIt);

      /* "viur/datastore/transport.pyx":883
 * 		while arrayIt != arrayElem.end():
 * 			innerArrayElem = dereference(arrayIt)
 * 			res.append( parseKey(innerArrayElem))             # <<<<<<<<<<<<<<
 * 			preincrement(arrayIt)
 * 		if not res:
 */
      __pyx_t_4 = __pyx_f_4viur_9datastore_9transport_parseKey(__pyx_v_innerArrayElem); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_res, __pyx_t_4); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 883, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "viur/datastore/transport.pyx":884
 * 			innerArrayElem = dereference(arrayIt)
 * 			res.append( parseKey(innerArrayElem))
 * 			preincrement(arrayIt)             # <<<<<<<<<<<<<<
 * 		if not res:
 * 			raise ValueError("Empty response received from Datastore API")
 */
      (void)((++__pyx_v_arrayIt));
    }

    /* "viur/datastore/transport.pyx":885
 * 			res.append( parseKey(innerArrayElem))
 * 			preincrement(arrayIt)
 * 		if not res:             # <<<<<<<<<<<<<<
 * 			raise ValueError("Empty response received from Datastore API")
 * 		elif not isMulti:
 */
    __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_res) != 0);
    __pyx_t_2 = ((!__pyx_t_3) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "viur/datastore/transport.pyx":886
 * 			preincrement(arrayIt)
 * 		if not res:
 * 			raise ValueError("Empty response received from Datastore API")             # <<<<<<<<<<<<<<
 * 		elif not isMulti:
 * 			return res[0]
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(0, 886, __pyx_L1_error)

      /* "viur/datastore/transport.pyx":885
 * 			res.append( parseKey(innerArrayElem))
 * 			preincrement(arrayIt)
 * 		if not res:             # <<<<<<<<<<<<<<
 * 			raise ValueError("Empty response received from Datastore API")
 * 		elif not isMulti:
 */
    }

    /* "viur/datastore/transport.pyx":887
 * 		if not res:
 * 			raise ValueError("Empty response received from Datastore API")
 * 		elif not isMulti:             # <<<<<<<<<<<<<<
 * 			return res[0]
 * 		else:
 */
    __pyx_t_2 = ((!(__pyx_v_isMulti != 0)) != 0);
    if (__pyx_t_2) {

      /* "viur/datastore/transport.pyx":888
 * 			raise ValueError("Empty response received from Datastore API")
 * 		elif not isMulti:
 * 			return res[0]             # <<<<<<<<<<<<<<
 * 		else:
 * 			return res
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_res, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "viur/datastore/transport.pyx":887
 * 		if not res:
 * 			raise ValueError("Empty response received from Datastore API")
 * 		elif not isMulti:             # <<<<<<<<<<<<<<
 * 			return res[0]
 * 		else:
 */
    }

    /* "viur/datastore/transport.pyx":890
 * 			return res[0]
 * 		else:
 * 			return res             # <<<<<<<<<<<<<<
 * 	else:
 * 		logging.error("Invalid data received from Datastore API")
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_res);
      __pyx_r = __pyx_v_res;
      goto __pyx_L0;
    }

    /* "viur/datastore/transport.pyx":878
 * 	element = parser.parse(data_ptr, pysize, 1)
 * 	res = []
 * 	if (element.at("keys").error() == SUCCESS):             # <<<<<<<<<<<<<<
 * 		arrayElem = element.at_key("keys").get_array()
 * 		arrayIt = arrayElem.begin()
 */
  }

  /* "viur/datastore/transport.pyx":892
 * 			return res
 * 	else:
 * 		logging.error("Invalid data received from Datastore API")             # <<<<<<<<<<<<<<
 * 		logging.error(req.content)
 * 		raise ValueError("Invalid data received from Datastore API")
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_logging); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_kp_u_Invalid_data_received_from_Datas) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_u_Invalid_data_received_from_Datas);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "viur/datastore/transport.pyx":893
 * 	else:
 * 		logging.error("Invalid data received from Datastore API")
 * 		logging.error(req.content)             # <<<<<<<<<<<<<<
 * 		raise ValueError("Invalid data received from Datastore API")
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logging); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_req, __pyx_n_s_content); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __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;

    /* "viur/datastore/transport.pyx":894
 * 		logging.error("Invalid data received from Datastore API")
 * 		logging.error(req.content)
 * 		raise ValueError("Invalid data received from Datastore API")             # <<<<<<<<<<<<<<
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 894, __pyx_L1_error)
  }

  /* "viur/datastore/transport.pyx":841
 * 	)
 * 
 * def AllocateIDs(keys: Union[Key, List[Key]]) -> Union[Key, List[Key]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Allocates numeric IDs for the keys given.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("viur.datastore.transport.AllocateIDs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_keyList);
  __Pyx_XDECREF(__pyx_v_requestedKeys);
  __Pyx_XDECREF(__pyx_v_postData);
  __Pyx_XDECREF(__pyx_v_req);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_keys);
  __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_transport(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_transport},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "transport",
    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_n_u_AND, __pyx_k_AND, sizeof(__pyx_k_AND), 0, 1, 0, 1},
  {&__pyx_n_u_ASCENDING, __pyx_k_ASCENDING, sizeof(__pyx_k_ASCENDING), 0, 1, 0, 1},
  {&__pyx_n_u_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 1, 0, 1},
  {&__pyx_n_s_AllocateIDs, __pyx_k_AllocateIDs, sizeof(__pyx_k_AllocateIDs), 0, 0, 1, 1},
  {&__pyx_n_s_Any, __pyx_k_Any, sizeof(__pyx_k_Any), 0, 0, 1, 1},
  {&__pyx_n_s_AuthorizedSession, __pyx_k_AuthorizedSession, sizeof(__pyx_k_AuthorizedSession), 0, 0, 1, 1},
  {&__pyx_kp_u_Cannot_call_runInTransaction_whi, __pyx_k_Cannot_call_runInTransaction_whi, sizeof(__pyx_k_Cannot_call_runInTransaction_whi), 0, 1, 0, 0},
  {&__pyx_n_s_Collision, __pyx_k_Collision, sizeof(__pyx_k_Collision), 0, 0, 1, 1},
  {&__pyx_n_s_ConnectionError, __pyx_k_ConnectionError, sizeof(__pyx_k_ConnectionError), 0, 0, 1, 1},
  {&__pyx_n_u_DESCENDING, __pyx_k_DESCENDING, sizeof(__pyx_k_DESCENDING), 0, 1, 0, 1},
  {&__pyx_n_s_Delete, __pyx_k_Delete, sizeof(__pyx_k_Delete), 0, 0, 1, 1},
  {&__pyx_n_u_EQUAL, __pyx_k_EQUAL, sizeof(__pyx_k_EQUAL), 0, 1, 0, 1},
  {&__pyx_kp_u_Empty_response_received_from_Dat, __pyx_k_Empty_response_received_from_Dat, sizeof(__pyx_k_Empty_response_received_from_Dat), 0, 1, 0, 0},
  {&__pyx_n_s_Entity, __pyx_k_Entity, sizeof(__pyx_k_Entity), 0, 0, 1, 1},
  {&__pyx_n_u_GREATER_THAN, __pyx_k_GREATER_THAN, sizeof(__pyx_k_GREATER_THAN), 0, 1, 0, 1},
  {&__pyx_n_u_GREATER_THAN_OR_EQUAL, __pyx_k_GREATER_THAN_OR_EQUAL, sizeof(__pyx_k_GREATER_THAN_OR_EQUAL), 0, 1, 0, 1},
  {&__pyx_n_s_Get, __pyx_k_Get, sizeof(__pyx_k_Get), 0, 0, 1, 1},
  {&__pyx_kp_u_INVALID_RESPONSE_RECEIVED, __pyx_k_INVALID_RESPONSE_RECEIVED, sizeof(__pyx_k_INVALID_RESPONSE_RECEIVED), 0, 1, 0, 0},
  {&__pyx_kp_u_INVALID_STATUS_CODE_RECEIVED, __pyx_k_INVALID_STATUS_CODE_RECEIVED, sizeof(__pyx_k_INVALID_STATUS_CODE_RECEIVED), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_data_received_from_Datas, __pyx_k_Invalid_data_received_from_Datas, sizeof(__pyx_k_Invalid_data_received_from_Datas), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_key_in_entity_json_s, __pyx_k_Invalid_key_in_entity_json_s, sizeof(__pyx_k_Invalid_key_in_entity_json_s), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_number_of_mutation_resul, __pyx_k_Invalid_number_of_mutation_resul, sizeof(__pyx_k_Invalid_number_of_mutation_resul), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_op_s, __pyx_k_Invalid_op_s, sizeof(__pyx_k_Invalid_op_s), 0, 1, 0, 0},
  {&__pyx_kp_u_Invalid_status_code_received_fro, __pyx_k_Invalid_status_code_received_fro, sizeof(__pyx_k_Invalid_status_code_received_fro), 0, 1, 0, 0},
  {&__pyx_n_s_Key, __pyx_k_Key, sizeof(__pyx_k_Key), 0, 0, 1, 1},
  {&__pyx_n_u_LESS_THAN, __pyx_k_LESS_THAN, sizeof(__pyx_k_LESS_THAN), 0, 1, 0, 1},
  {&__pyx_n_u_LESS_THAN_OR_EQUAL, __pyx_k_LESS_THAN_OR_EQUAL, sizeof(__pyx_k_LESS_THAN_OR_EQUAL), 0, 1, 0, 1},
  {&__pyx_n_s_List, __pyx_k_List, sizeof(__pyx_k_List), 0, 0, 1, 1},
  {&__pyx_n_u_NON_TRANSACTIONAL, __pyx_k_NON_TRANSACTIONAL, sizeof(__pyx_k_NON_TRANSACTIONAL), 0, 1, 0, 1},
  {&__pyx_n_u_NOT_FINISHED, __pyx_k_NOT_FINISHED, sizeof(__pyx_k_NOT_FINISHED), 0, 1, 0, 1},
  {&__pyx_kp_u_No_mutation_results_received, __pyx_k_No_mutation_results_received, sizeof(__pyx_k_No_mutation_results_received), 0, 1, 0, 0},
  {&__pyx_n_s_Put, __pyx_k_Put, sizeof(__pyx_k_Put), 0, 0, 1, 1},
  {&__pyx_n_s_QueryDefinition, __pyx_k_QueryDefinition, sizeof(__pyx_k_QueryDefinition), 0, 0, 1, 1},
  {&__pyx_kp_u_Received_an_unexpected_key_updat, __pyx_k_Received_an_unexpected_key_updat, sizeof(__pyx_k_Received_an_unexpected_key_updat), 0, 1, 0, 0},
  {&__pyx_n_s_RecursionError, __pyx_k_RecursionError, sizeof(__pyx_k_RecursionError), 0, 0, 1, 1},
  {&__pyx_n_s_RequestsConnectionError, __pyx_k_RequestsConnectionError, sizeof(__pyx_k_RequestsConnectionError), 0, 0, 1, 1},
  {&__pyx_kp_u_Retrying_http_post_request_to_da, __pyx_k_Retrying_http_post_request_to_da, sizeof(__pyx_k_Retrying_http_post_request_to_da), 0, 1, 0, 0},
  {&__pyx_n_s_RunInTransaction, __pyx_k_RunInTransaction, sizeof(__pyx_k_RunInTransaction), 0, 0, 1, 1},
  {&__pyx_n_u_STRONG, __pyx_k_STRONG, sizeof(__pyx_k_STRONG), 0, 1, 0, 1},
  {&__pyx_n_u_TRANSACTIONAL, __pyx_k_TRANSACTIONAL, sizeof(__pyx_k_TRANSACTIONAL), 0, 1, 0, 1},
  {&__pyx_kp_u_Transaction_collision_retrying, __pyx_k_Transaction_collision_retrying, sizeof(__pyx_k_Transaction_collision_retrying), 0, 1, 0, 0},
  {&__pyx_kp_u_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 1, 0, 0},
  {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1},
  {&__pyx_kp_u_Unknown_type, __pyx_k_Unknown_type, sizeof(__pyx_k_Unknown_type), 0, 1, 0, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_u_Y_m_dT_H_M_S, __pyx_k_Y_m_dT_H_M_S, sizeof(__pyx_k_Y_m_dT_H_M_S), 0, 1, 0, 0},
  {&__pyx_kp_u_Y_m_dT_H_M_S_f, __pyx_k_Y_m_dT_H_M_S_f, sizeof(__pyx_k_Y_m_dT_H_M_S_f), 0, 1, 0, 0},
  {&__pyx_kp_u_Y_m_dT_H_M_S_fZ, __pyx_k_Y_m_dT_H_M_S_fZ, sizeof(__pyx_k_Y_m_dT_H_M_S_fZ), 0, 1, 0, 0},
  {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
  {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
  {&__pyx_n_s__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 1, 1},
  {&__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_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
  {&__pyx_n_u_affectedEntities, __pyx_k_affectedEntities, sizeof(__pyx_k_affectedEntities), 0, 1, 0, 1},
  {&__pyx_n_s_affectedEntity, __pyx_k_affectedEntity, sizeof(__pyx_k_affectedEntity), 0, 0, 1, 1},
  {&__pyx_n_u_allowOverriding, __pyx_k_allowOverriding, sizeof(__pyx_k_allowOverriding), 0, 1, 0, 1},
  {&__pyx_n_s_allowOverriding_2, __pyx_k_allowOverriding_2, sizeof(__pyx_k_allowOverriding_2), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_arrayElem, __pyx_k_arrayElem, sizeof(__pyx_k_arrayElem), 0, 0, 1, 1},
  {&__pyx_n_s_arrayIt, __pyx_k_arrayIt, sizeof(__pyx_k_arrayIt), 0, 0, 1, 1},
  {&__pyx_n_u_arrayValue, __pyx_k_arrayValue, sizeof(__pyx_k_arrayValue), 0, 1, 0, 1},
  {&__pyx_n_s_astimezone, __pyx_k_astimezone, sizeof(__pyx_k_astimezone), 0, 0, 1, 1},
  {&__pyx_n_s_auth, __pyx_k_auth, sizeof(__pyx_k_auth), 0, 0, 1, 1},
  {&__pyx_n_s_authenticatedRequest, __pyx_k_authenticatedRequest, sizeof(__pyx_k_authenticatedRequest), 0, 0, 1, 1},
  {&__pyx_n_s_b64decode, __pyx_k_b64decode, sizeof(__pyx_k_b64decode), 0, 0, 1, 1},
  {&__pyx_n_s_b64encode, __pyx_k_b64encode, sizeof(__pyx_k_b64encode), 0, 0, 1, 1},
  {&__pyx_n_s_base64, __pyx_k_base64, sizeof(__pyx_k_base64), 0, 0, 1, 1},
  {&__pyx_n_u_blobValue, __pyx_k_blobValue, sizeof(__pyx_k_blobValue), 0, 1, 0, 1},
  {&__pyx_n_u_booleanValue, __pyx_k_booleanValue, sizeof(__pyx_k_booleanValue), 0, 1, 0, 1},
  {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 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_u_compositeFilter, __pyx_k_compositeFilter, sizeof(__pyx_k_compositeFilter), 0, 1, 0, 1},
  {&__pyx_n_s_content, __pyx_k_content, sizeof(__pyx_k_content), 0, 0, 1, 1},
  {&__pyx_n_s_credentials, __pyx_k_credentials, sizeof(__pyx_k_credentials), 0, 0, 1, 1},
  {&__pyx_n_s_currentCursor, __pyx_k_currentCursor, sizeof(__pyx_k_currentCursor), 0, 0, 1, 1},
  {&__pyx_n_s_currentTransaction, __pyx_k_currentTransaction, sizeof(__pyx_k_currentTransaction), 0, 0, 1, 1},
  {&__pyx_n_s_currentTxn, __pyx_k_currentTxn, sizeof(__pyx_k_currentTxn), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_data_ptr, __pyx_k_data_ptr, sizeof(__pyx_k_data_ptr), 0, 0, 1, 1},
  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_debug, __pyx_k_debug, sizeof(__pyx_k_debug), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
  {&__pyx_n_u_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 1, 0, 1},
  {&__pyx_n_s_dictKey, __pyx_k_dictKey, sizeof(__pyx_k_dictKey), 0, 0, 1, 1},
  {&__pyx_n_s_dictValue, __pyx_k_dictValue, sizeof(__pyx_k_dictValue), 0, 0, 1, 1},
  {&__pyx_n_u_direction, __pyx_k_direction, sizeof(__pyx_k_direction), 0, 1, 0, 1},
  {&__pyx_n_s_distinct, __pyx_k_distinct, sizeof(__pyx_k_distinct), 0, 0, 1, 1},
  {&__pyx_n_s_distinctKey, __pyx_k_distinctKey, sizeof(__pyx_k_distinctKey), 0, 0, 1, 1},
  {&__pyx_n_u_distinctOn, __pyx_k_distinctOn, sizeof(__pyx_k_distinctOn), 0, 1, 0, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_u_doubleValue, __pyx_k_doubleValue, sizeof(__pyx_k_doubleValue), 0, 1, 0, 1},
  {&__pyx_n_s_dumps, __pyx_k_dumps, sizeof(__pyx_k_dumps), 0, 0, 1, 1},
  {&__pyx_n_s_element, __pyx_k_element, sizeof(__pyx_k_element), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_endCursor, __pyx_k_endCursor, sizeof(__pyx_k_endCursor), 0, 0, 1, 1},
  {&__pyx_n_u_endCursor, __pyx_k_endCursor, sizeof(__pyx_k_endCursor), 0, 1, 0, 1},
  {&__pyx_n_s_entities, __pyx_k_entities, sizeof(__pyx_k_entities), 0, 0, 1, 1},
  {&__pyx_n_u_entityValue, __pyx_k_entityValue, sizeof(__pyx_k_entityValue), 0, 1, 0, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_n_u_excludeFromIndexes, __pyx_k_excludeFromIndexes, sizeof(__pyx_k_excludeFromIndexes), 0, 1, 0, 1},
  {&__pyx_n_s_exclude_from_indexes, __pyx_k_exclude_from_indexes, sizeof(__pyx_k_exclude_from_indexes), 0, 0, 1, 1},
  {&__pyx_n_s_excludedProperties, __pyx_k_excludedProperties, sizeof(__pyx_k_excludedProperties), 0, 0, 1, 1},
  {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1},
  {&__pyx_n_u_filter, __pyx_k_filter, sizeof(__pyx_k_filter), 0, 1, 0, 1},
  {&__pyx_n_s_filterList, __pyx_k_filterList, sizeof(__pyx_k_filterList), 0, 0, 1, 1},
  {&__pyx_n_s_filters, __pyx_k_filters, sizeof(__pyx_k_filters), 0, 0, 1, 1},
  {&__pyx_n_u_filters, __pyx_k_filters, sizeof(__pyx_k_filters), 0, 1, 0, 1},
  {&__pyx_n_s_flipResults, __pyx_k_flipResults, sizeof(__pyx_k_flipResults), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_google, __pyx_k_google, sizeof(__pyx_k_google), 0, 0, 1, 1},
  {&__pyx_n_s_google_auth, __pyx_k_google_auth, sizeof(__pyx_k_google_auth), 0, 0, 1, 1},
  {&__pyx_n_s_http_internal, __pyx_k_http_internal, sizeof(__pyx_k_http_internal), 0, 0, 1, 1},
  {&__pyx_kp_u_https_datastore_googleapis_com_v, __pyx_k_https_datastore_googleapis_com_v, sizeof(__pyx_k_https_datastore_googleapis_com_v), 0, 1, 0, 0},
  {&__pyx_kp_u_https_datastore_googleapis_com_v_2, __pyx_k_https_datastore_googleapis_com_v_2, sizeof(__pyx_k_https_datastore_googleapis_com_v_2), 0, 1, 0, 0},
  {&__pyx_kp_u_https_datastore_googleapis_com_v_3, __pyx_k_https_datastore_googleapis_com_v_3, sizeof(__pyx_k_https_datastore_googleapis_com_v_3), 0, 1, 0, 0},
  {&__pyx_kp_u_https_datastore_googleapis_com_v_4, __pyx_k_https_datastore_googleapis_com_v_4, sizeof(__pyx_k_https_datastore_googleapis_com_v_4), 0, 1, 0, 0},
  {&__pyx_kp_u_https_datastore_googleapis_com_v_5, __pyx_k_https_datastore_googleapis_com_v_5, sizeof(__pyx_k_https_datastore_googleapis_com_v_5), 0, 1, 0, 0},
  {&__pyx_kp_u_https_datastore_googleapis_com_v_6, __pyx_k_https_datastore_googleapis_com_v_6, sizeof(__pyx_k_https_datastore_googleapis_com_v_6), 0, 1, 0, 0},
  {&__pyx_kp_u_https_www_googleapis_com_auth_da, __pyx_k_https_www_googleapis_com_auth_da, sizeof(__pyx_k_https_www_googleapis_com_auth_da), 0, 1, 0, 0},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_u_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 1, 0, 1},
  {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_innerArrayElem, __pyx_k_innerArrayElem, sizeof(__pyx_k_innerArrayElem), 0, 0, 1, 1},
  {&__pyx_n_u_integerValue, __pyx_k_integerValue, sizeof(__pyx_k_integerValue), 0, 1, 0, 1},
  {&__pyx_n_s_internalStartCursor, __pyx_k_internalStartCursor, sizeof(__pyx_k_internalStartCursor), 0, 0, 1, 1},
  {&__pyx_n_s_isMulti, __pyx_k_isMulti, sizeof(__pyx_k_isMulti), 0, 0, 1, 1},
  {&__pyx_kp_u_is_not_supported, __pyx_k_is_not_supported, sizeof(__pyx_k_is_not_supported), 0, 1, 0, 0},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_u_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 1, 0, 1},
  {&__pyx_n_s_keyList, __pyx_k_keyList, sizeof(__pyx_k_keyList), 0, 0, 1, 1},
  {&__pyx_n_s_keyToPath, __pyx_k_keyToPath, sizeof(__pyx_k_keyToPath), 0, 0, 1, 1},
  {&__pyx_n_u_keyValue, __pyx_k_keyValue, sizeof(__pyx_k_keyValue), 0, 1, 0, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_u_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 1, 0, 1},
  {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
  {&__pyx_n_u_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 1, 0, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1},
  {&__pyx_n_u_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 1, 0, 1},
  {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
  {&__pyx_n_s_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_u_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 1, 0, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_u_mutations, __pyx_k_mutations, sizeof(__pyx_k_mutations), 0, 1, 0, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_u_nullValue, __pyx_k_nullValue, sizeof(__pyx_k_nullValue), 0, 1, 0, 1},
  {&__pyx_n_s_oldTxn, __pyx_k_oldTxn, sizeof(__pyx_k_oldTxn), 0, 0, 1, 1},
  {&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1},
  {&__pyx_n_u_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 1, 0, 1},
  {&__pyx_n_u_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 1, 0, 1},
  {&__pyx_n_s_orders, __pyx_k_orders, sizeof(__pyx_k_orders), 0, 0, 1, 1},
  {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
  {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1},
  {&__pyx_n_u_partitionId, __pyx_k_partitionId, sizeof(__pyx_k_partitionId), 0, 1, 0, 1},
  {&__pyx_n_u_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 1, 0, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_post, __pyx_k_post, sizeof(__pyx_k_post), 0, 0, 1, 1},
  {&__pyx_n_s_postData, __pyx_k_postData, sizeof(__pyx_k_postData), 0, 0, 1, 1},
  {&__pyx_n_s_pprint, __pyx_k_pprint, sizeof(__pyx_k_pprint), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_u_previousTransaction, __pyx_k_previousTransaction, sizeof(__pyx_k_previousTransaction), 0, 1, 0, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_projectID, __pyx_k_projectID, sizeof(__pyx_k_projectID), 0, 0, 1, 1},
  {&__pyx_n_u_project_id, __pyx_k_project_id, sizeof(__pyx_k_project_id), 0, 1, 0, 1},
  {&__pyx_n_s_properties, __pyx_k_properties, sizeof(__pyx_k_properties), 0, 0, 1, 1},
  {&__pyx_n_u_properties, __pyx_k_properties, sizeof(__pyx_k_properties), 0, 1, 0, 1},
  {&__pyx_n_u_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 1, 0, 1},
  {&__pyx_n_u_propertyFilter, __pyx_k_propertyFilter, sizeof(__pyx_k_propertyFilter), 0, 1, 0, 1},
  {&__pyx_n_s_pysize, __pyx_k_pysize, sizeof(__pyx_k_pysize), 0, 0, 1, 1},
  {&__pyx_n_s_pythonPropToJson, __pyx_k_pythonPropToJson, sizeof(__pyx_k_pythonPropToJson), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_u_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 1, 0, 1},
  {&__pyx_n_s_queryDefinition, __pyx_k_queryDefinition, sizeof(__pyx_k_queryDefinition), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_u_readConsistency, __pyx_k_readConsistency, sizeof(__pyx_k_readConsistency), 0, 1, 0, 1},
  {&__pyx_n_s_readOptions, __pyx_k_readOptions, sizeof(__pyx_k_readOptions), 0, 0, 1, 1},
  {&__pyx_n_u_readOptions, __pyx_k_readOptions, sizeof(__pyx_k_readOptions), 0, 1, 0, 1},
  {&__pyx_n_u_readWrite, __pyx_k_readWrite, sizeof(__pyx_k_readWrite), 0, 1, 0, 1},
  {&__pyx_n_s_refresh_timeout, __pyx_k_refresh_timeout, sizeof(__pyx_k_refresh_timeout), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_s_req, __pyx_k_req, sizeof(__pyx_k_req), 0, 0, 1, 1},
  {&__pyx_n_s_requestedKeys, __pyx_k_requestedKeys, sizeof(__pyx_k_requestedKeys), 0, 0, 1, 1},
  {&__pyx_n_s_requests, __pyx_k_requests, sizeof(__pyx_k_requests), 0, 0, 1, 1},
  {&__pyx_n_s_requests_exceptions, __pyx_k_requests_exceptions, sizeof(__pyx_k_requests_exceptions), 0, 0, 1, 1},
  {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  {&__pyx_n_s_resDict, __pyx_k_resDict, sizeof(__pyx_k_resDict), 0, 0, 1, 1},
  {&__pyx_n_s_resList, __pyx_k_resList, sizeof(__pyx_k_resList), 0, 0, 1, 1},
  {&__pyx_n_s_rollbackTxn, __pyx_k_rollbackTxn, sizeof(__pyx_k_rollbackTxn), 0, 0, 1, 1},
  {&__pyx_n_s_runSingleFilter, __pyx_k_runSingleFilter, sizeof(__pyx_k_runSingleFilter), 0, 0, 1, 1},
  {&__pyx_n_s_scopes, __pyx_k_scopes, sizeof(__pyx_k_scopes), 0, 0, 1, 1},
  {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
  {&__pyx_n_s_singleValue, __pyx_k_singleValue, sizeof(__pyx_k_singleValue), 0, 0, 1, 1},
  {&__pyx_n_s_sortOrder, __pyx_k_sortOrder, sizeof(__pyx_k_sortOrder), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_kp_s_src_viur_datastore_transport_pyx, __pyx_k_src_viur_datastore_transport_pyx, sizeof(__pyx_k_src_viur_datastore_transport_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_startCursor, __pyx_k_startCursor, sizeof(__pyx_k_startCursor), 0, 0, 1, 1},
  {&__pyx_n_u_startCursor, __pyx_k_startCursor, sizeof(__pyx_k_startCursor), 0, 1, 0, 1},
  {&__pyx_n_s_status_code, __pyx_k_status_code, sizeof(__pyx_k_status_code), 0, 0, 1, 1},
  {&__pyx_n_s_strftime, __pyx_k_strftime, sizeof(__pyx_k_strftime), 0, 0, 1, 1},
  {&__pyx_n_u_stringValue, __pyx_k_stringValue, sizeof(__pyx_k_stringValue), 0, 1, 0, 1},
  {&__pyx_n_s_strptime, __pyx_k_strptime, sizeof(__pyx_k_strptime), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_u_timestampValue, __pyx_k_timestampValue, sizeof(__pyx_k_timestampValue), 0, 1, 0, 1},
  {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1},
  {&__pyx_n_u_transaction, __pyx_k_transaction, sizeof(__pyx_k_transaction), 0, 1, 0, 1},
  {&__pyx_n_u_transactionOptions, __pyx_k_transactionOptions, sizeof(__pyx_k_transactionOptions), 0, 1, 0, 1},
  {&__pyx_n_s_transport, __pyx_k_transport, sizeof(__pyx_k_transport), 0, 0, 1, 1},
  {&__pyx_n_s_txnKey, __pyx_k_txnKey, sizeof(__pyx_k_txnKey), 0, 0, 1, 1},
  {&__pyx_n_s_txnOptions, __pyx_k_txnOptions, sizeof(__pyx_k_txnOptions), 0, 0, 1, 1},
  {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
  {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_u_upsert, __pyx_k_upsert, sizeof(__pyx_k_upsert), 0, 1, 0, 1},
  {&__pyx_n_s_url, __pyx_k_url, sizeof(__pyx_k_url), 0, 0, 1, 1},
  {&__pyx_n_s_utc, __pyx_k_utc, sizeof(__pyx_k_utc), 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_u_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 1, 0, 1},
  {&__pyx_n_u_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 1, 0, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_viur_datastore_transport, __pyx_k_viur_datastore_transport, sizeof(__pyx_k_viur_datastore_transport), 0, 0, 1, 1},
  {&__pyx_n_s_viur_datastore_types, __pyx_k_viur_datastore_types, sizeof(__pyx_k_viur_datastore_types), 0, 0, 1, 1},
  {&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 112, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 370, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 531, __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);

  /* "viur/datastore/transport.pyx":355
 * 				return objIterStart.value().get_bool()
 * 			elif (strView.compare("timestampValue") == 0):
 * 				dateStr = toPyStr(objIterStart.value().get_string())[:-1]  # Strip "Z" at the end             # <<<<<<<<<<<<<<
 * 				if "." in dateStr:  # With milli-seconds
 * 					return datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%S.%f").replace(tzinfo=timezone.utc)
 */
  __pyx_slice__2 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__2);
  __Pyx_GIVEREF(__pyx_slice__2);

  /* "viur/datastore/transport.pyx":430
 * 		return v.get_bool()
 * 	else:
 * 		raise ValueError("Unknown type")             # <<<<<<<<<<<<<<
 * 
 * def runSingleFilter(queryDefinition: QueryDefinition, limit: int) -> List[Entity]:
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Unknown_type); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "viur/datastore/transport.pyx":531
 * 		)
 * 		if req.status_code != 200:
 * 			print("INVALID STATUS CODE RECEIVED")             # <<<<<<<<<<<<<<
 * 			print(req.content)
 * 			pprint.pprint(json.loads(req.content))
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_INVALID_STATUS_CODE_RECEIVED); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "viur/datastore/transport.pyx":534
 * 			print(req.content)
 * 			pprint.pprint(json.loads(req.content))
 * 			raise ValueError("Invalid status code received from Datastore API")             # <<<<<<<<<<<<<<
 * 		assert PyBytes_AsStringAndSize(req.content, &data_ptr, &pysize) != -1
 * 		element = parser.parse(data_ptr, pysize, 1)
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Invalid_status_code_received_fro); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "viur/datastore/transport.pyx":538
 * 		element = parser.parse(data_ptr, pysize, 1)
 * 		if element.at("batch").error() != SUCCESS:
 * 			print("INVALID RESPONSE RECEIVED")             # <<<<<<<<<<<<<<
 * 			pprint.pprint(json.loads(req.content))
 * 		#	res.update(toEntityStructure(element.at_key("batch"), isInitial=True))
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_INVALID_RESPONSE_RECEIVED); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "viur/datastore/transport.pyx":551
 * 	queryDefinition.currentCursor = internalStartCursor
 * 	if flipResults:
 * 		return res[::-1]             # <<<<<<<<<<<<<<
 * 	return res
 * 
 */
  __pyx_slice__14 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__14);
  __Pyx_GIVEREF(__pyx_slice__14);

  /* "viur/datastore/transport.pyx":584
 * 	res = {}
 * 	while keyList:
 * 		requestedKeys = keyList[:300]             # <<<<<<<<<<<<<<
 * 		postData = {
 * 			"readOptions": readOptions,
 */
  __pyx_slice__15 = PySlice_New(Py_None, __pyx_int_300, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__15);
  __Pyx_GIVEREF(__pyx_slice__15);

  /* "viur/datastore/transport.pyx":599
 * 			res.update(toEntityStructure(element.at_key("found"), isInitial=True))
 * 		if (element.at("deferred").error() == SUCCESS):
 * 			keyList = toPythonStructure(element.at_key("deferred")) + keyList[300:]             # <<<<<<<<<<<<<<
 * 		else:
 * 			keyList = keyList[300:]
 */
  __pyx_slice__16 = PySlice_New(__pyx_int_300, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__16);
  __Pyx_GIVEREF(__pyx_slice__16);

  /* "viur/datastore/transport.pyx":654
 * 		if (element.at("mutationResults").error() != SUCCESS):
 * 			print(req.content)
 * 			raise ValueError("No mutation-results received")             # <<<<<<<<<<<<<<
 * 		arrayElem = element.at_key("mutationResults").get_array()
 * 		if arrayElem.size() != len(keys):
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_No_mutation_results_received); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "viur/datastore/transport.pyx":658
 * 		if arrayElem.size() != len(keys):
 * 			print(req.content)
 * 			raise ValueError("Invalid number of mutation-results received")             # <<<<<<<<<<<<<<
 * 
 * def Put(entities: Union[Entity, List[Entity]]) -> Union[Entity, List[Entity]]:
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Invalid_number_of_mutation_resul); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "viur/datastore/transport.pyx":745
 * 			if oldTxn:
 * 				if not allowOverriding:
 * 					raise RecursionError("Cannot call runInTransaction while inside a transaction!")             # <<<<<<<<<<<<<<
 * 				txnOptions = {
 * 					"previousTransaction": oldTxn["key"]
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Cannot_call_runInTransaction_whi); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "viur/datastore/transport.pyx":810
 * 								if not affectedEntity:
 * 									print(req.content)
 * 									raise ValueError("Received an unexpected key-update")             # <<<<<<<<<<<<<<
 * 								affectedEntity.key = parseKey(innerArrayElem.at_key("key"))
 * 								affectedEntity.version = toPyStr(innerArrayElem.at_key("version").get_string())
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_Received_an_unexpected_key_updat); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "viur/datastore/transport.pyx":886
 * 			preincrement(arrayIt)
 * 		if not res:
 * 			raise ValueError("Empty response received from Datastore API")             # <<<<<<<<<<<<<<
 * 		elif not isMulti:
 * 			return res[0]
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_Empty_response_received_from_Dat); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "viur/datastore/transport.pyx":894
 * 		logging.error("Invalid data received from Datastore API")
 * 		logging.error(req.content)
 * 		raise ValueError("Invalid data received from Datastore API")             # <<<<<<<<<<<<<<
 * 
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_Invalid_data_received_from_Datas); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "viur/datastore/transport.pyx":103
 * )
 * 
 * def authenticatedRequest(url:str, data: bytes) -> requests.Response:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs one http request to the datastore rest api, authenticated with the current projects service account.
 */
  __pyx_tuple__23 = PyTuple_Pack(3, __pyx_n_s_url, __pyx_n_s_data, __pyx_n_s_i); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);
  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_viur_datastore_transport_pyx, __pyx_n_s_authenticatedRequest, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 103, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":124
 * 			continue
 * 
 * def keyToPath(key: Key) -> List[dict]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Converts a Key object to the PathElements expected by the rest API.
 */
  __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_res); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);
  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_viur_datastore_transport_pyx, __pyx_n_s_keyToPath, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 124, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":148
 * 	return res
 * 
 * def pythonPropToJson(v) -> dict:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Convert a python type to the object representation expected by the datastore rest API.
 */
  __pyx_tuple__27 = PyTuple_Pack(11, __pyx_n_s_v, __pyx_n_s_excludedProperties, __pyx_n_s_properties, __pyx_n_s_dictKey, __pyx_n_s_dictValue, __pyx_n_s_resList, __pyx_n_s_value, __pyx_n_s_resDict, __pyx_n_s_dictKey, __pyx_n_s_dictValue, __pyx_n_s_x); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);
  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_viur_datastore_transport_pyx, __pyx_n_s_pythonPropToJson, 148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 148, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":432
 * 		raise ValueError("Unknown type")
 * 
 * def runSingleFilter(queryDefinition: QueryDefinition, limit: int) -> List[Entity]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs a single Query as defined by queryDefinition. The limit of the queryDefinition is ignored and must
 */
  __pyx_tuple__29 = PyTuple_Pack(21, __pyx_n_s_queryDefinition, __pyx_n_s_limit, __pyx_n_s_parser, __pyx_n_s_pysize, __pyx_n_s_data_ptr, __pyx_n_s_element, __pyx_n_s_res, __pyx_n_s_internalStartCursor, __pyx_n_s_flipResults, __pyx_n_s_currentTxn, __pyx_n_s_readOptions, __pyx_n_s_postData, __pyx_n_s_filterList, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_key, __pyx_n_s_op, __pyx_n_s_singleValue, __pyx_n_s_req, __pyx_n_s_sortOrder, __pyx_n_s_distinctKey); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);
  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 21, 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_src_viur_datastore_transport_pyx, __pyx_n_s_runSingleFilter, 432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 432, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":554
 * 	return res
 * 
 * def Get(keys: Union[Key, List[Key]]) -> Union[None, Entity, List[Entity]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Fetches the entities determined by keys from the datastore. Returns or inserts None if a key is not found.
 */
  __pyx_tuple__31 = PyTuple_Pack(15, __pyx_n_s_keys, __pyx_n_s_parser, __pyx_n_s_pysize, __pyx_n_s_data_ptr, __pyx_n_s_element, __pyx_n_s_isMulti, __pyx_n_s_keyList, __pyx_n_s_currentTxn, __pyx_n_s_readOptions, __pyx_n_s_res, __pyx_n_s_requestedKeys, __pyx_n_s_postData, __pyx_n_s_req, __pyx_n_s_x, __pyx_n_s_x); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 15, 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_src_viur_datastore_transport_pyx, __pyx_n_s_Get, 554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 554, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":607
 * 		return [res.get(x) for x in keys]  # Sort by order of incoming keys
 * 
 * def Delete(keys: Union[Key, List[Key], Entity, List[Entity]]) -> None:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Deletes the entities stored under the given key(s).
 */
  __pyx_tuple__33 = PyTuple_Pack(11, __pyx_n_s_keys, __pyx_n_s_parser, __pyx_n_s_pysize, __pyx_n_s_data_ptr, __pyx_n_s_element, __pyx_n_s_arrayElem, __pyx_n_s_postData, __pyx_n_s_currentTxn, __pyx_n_s_req, __pyx_n_s_x, __pyx_n_s_x); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);
  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 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_src_viur_datastore_transport_pyx, __pyx_n_s_Delete, 607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 607, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":660
 * 			raise ValueError("Invalid number of mutation-results received")
 * 
 * def Put(entities: Union[Entity, List[Entity]]) -> Union[Entity, List[Entity]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Writes the given entities into the datastore. The entities can be from different kinds. If an entity has an
 */
  __pyx_tuple__35 = PyTuple_Pack(13, __pyx_n_s_entities, __pyx_n_s_parser, __pyx_n_s_pysize, __pyx_n_s_data_ptr, __pyx_n_s_element, __pyx_n_s_innerArrayElem, __pyx_n_s_arrayElem, __pyx_n_s_arrayIt, __pyx_n_s_postData, __pyx_n_s_currentTxn, __pyx_n_s_req, __pyx_n_s_idx, __pyx_n_s_x); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 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_src_viur_datastore_transport_pyx, __pyx_n_s_Put, 660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 660, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":724
 * 	pass
 * 
 * def RunInTransaction(callback: callable, *args, **kwargs) -> Any:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs the given function inside a AID transaction.
 */
  __pyx_tuple__38 = PyTuple_Pack(21, __pyx_n_s_callback, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_parser, __pyx_n_s_pysize, __pyx_n_s_data_ptr, __pyx_n_s_element, __pyx_n_s_innerArrayElem, __pyx_n_s_arrayElem, __pyx_n_s_arrayIt, __pyx_n_s__37, __pyx_n_s_oldTxn, __pyx_n_s_allowOverriding_2, __pyx_n_s_txnOptions, __pyx_n_s_postData, __pyx_n_s_req, __pyx_n_s_txnKey, __pyx_n_s_currentTxn, __pyx_n_s_res, __pyx_n_s_idx, __pyx_n_s_affectedEntity); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);
  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 21, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_viur_datastore_transport_pyx, __pyx_n_s_RunInTransaction, 724, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 724, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":825
 * 	raise Collision() # If we made it here, all tries are exhausted
 * 
 * def _rollbackTxn(txnKey: str):             # <<<<<<<<<<<<<<
 * 	"""
 * 		Internal helper that aborts the given transaction. It's important to abort pending transactions (instead
 */
  __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_txnKey, __pyx_n_s_postData, __pyx_n_s_req); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_viur_datastore_transport_pyx, __pyx_n_s_rollbackTxn, 825, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 825, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":841
 * 	)
 * 
 * def AllocateIDs(keys: Union[Key, List[Key]]) -> Union[Key, List[Key]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Allocates numeric IDs for the keys given.
 */
  __pyx_tuple__42 = PyTuple_Pack(15, __pyx_n_s_keys, __pyx_n_s_parser, __pyx_n_s_pysize, __pyx_n_s_data_ptr, __pyx_n_s_element, __pyx_n_s_isMulti, __pyx_n_s_keyList, __pyx_n_s_requestedKeys, __pyx_n_s_postData, __pyx_n_s_req, __pyx_n_s_res, __pyx_n_s_arrayElem, __pyx_n_s_arrayIt, __pyx_n_s_innerArrayElem, __pyx_n_s_x); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 15, 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_src_viur_datastore_transport_pyx, __pyx_n_s_AllocateIDs, 841, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __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_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_300 = PyInt_FromLong(300); if (unlikely(!__pyx_int_300)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_409 = PyInt_FromLong(409); if (unlikely(!__pyx_int_409)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC inittransport(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC inittransport(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_transport(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_transport(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_transport(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)(PyObject *);
  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 'transport' 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_transport(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("transport", __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_viur__datastore__transport) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "viur.datastore.transport")) {
      if (unlikely(PyDict_SetItemString(modules, "viur.datastore.transport", __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();
  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "viur/datastore/transport.pyx":4
 * # distutils: language = c++
 * # cython: language_level=3
 * import base64             # <<<<<<<<<<<<<<
 * 
 * import google.auth
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_base64, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_base64, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":6
 * import base64
 * 
 * import google.auth             # <<<<<<<<<<<<<<
 * import requests
 * from libcpp cimport bool as boolean_type
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_google_auth, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_google, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":7
 * 
 * import google.auth
 * import requests             # <<<<<<<<<<<<<<
 * from libcpp cimport bool as boolean_type
 * from viur.datastore.types import currentTransaction, Entity, Key, QueryDefinition
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_requests, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_requests, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":9
 * import requests
 * from libcpp cimport bool as boolean_type
 * from viur.datastore.types import currentTransaction, Entity, Key, QueryDefinition             # <<<<<<<<<<<<<<
 * from cython.operator cimport preincrement, dereference
 * from libc.stdint cimport int64_t, uint64_t
 */
  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_currentTransaction);
  __Pyx_GIVEREF(__pyx_n_s_currentTransaction);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_currentTransaction);
  __Pyx_INCREF(__pyx_n_s_Entity);
  __Pyx_GIVEREF(__pyx_n_s_Entity);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Entity);
  __Pyx_INCREF(__pyx_n_s_Key);
  __Pyx_GIVEREF(__pyx_n_s_Key);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_Key);
  __Pyx_INCREF(__pyx_n_s_QueryDefinition);
  __Pyx_GIVEREF(__pyx_n_s_QueryDefinition);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_QueryDefinition);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_viur_datastore_types, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __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_currentTransaction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_currentTransaction, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Entity, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Key, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_QueryDefinition); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueryDefinition, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "viur/datastore/transport.pyx":12
 * from cython.operator cimport preincrement, dereference
 * from libc.stdint cimport int64_t, uint64_t
 * from datetime import datetime, timezone             # <<<<<<<<<<<<<<
 * from cpython.bytes cimport PyBytes_AsStringAndSize
 * import pprint, json
 */
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_datetime);
  __Pyx_GIVEREF(__pyx_n_s_datetime);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_datetime);
  __Pyx_INCREF(__pyx_n_s_timezone);
  __Pyx_GIVEREF(__pyx_n_s_timezone);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_timezone);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __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_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_timezone); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_timezone, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":14
 * from datetime import datetime, timezone
 * from cpython.bytes cimport PyBytes_AsStringAndSize
 * import pprint, json             # <<<<<<<<<<<<<<
 * from base64 import b64decode, b64encode
 * from typing import Union, List, Any
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pprint, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pprint, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":15
 * from cpython.bytes cimport PyBytes_AsStringAndSize
 * import pprint, json
 * from base64 import b64decode, b64encode             # <<<<<<<<<<<<<<
 * from typing import Union, List, Any
 * from requests.exceptions import ConnectionError as RequestsConnectionError
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_b64decode);
  __Pyx_GIVEREF(__pyx_n_s_b64decode);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_b64decode);
  __Pyx_INCREF(__pyx_n_s_b64encode);
  __Pyx_GIVEREF(__pyx_n_s_b64encode);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_b64encode);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_base64, __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_b64decode); 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_b64decode, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_b64encode); 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_b64encode, __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;

  /* "viur/datastore/transport.pyx":16
 * import pprint, json
 * from base64 import b64decode, b64encode
 * from typing import Union, List, Any             # <<<<<<<<<<<<<<
 * from requests.exceptions import ConnectionError as RequestsConnectionError
 * import logging
 */
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_Union);
  __Pyx_GIVEREF(__pyx_n_s_Union);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Union);
  __Pyx_INCREF(__pyx_n_s_List);
  __Pyx_GIVEREF(__pyx_n_s_List);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_List);
  __Pyx_INCREF(__pyx_n_s_Any);
  __Pyx_GIVEREF(__pyx_n_s_Any);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_Any);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __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_Union); 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_Union, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_List); 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_List, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Any); 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_Any, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "viur/datastore/transport.pyx":17
 * from base64 import b64decode, b64encode
 * from typing import Union, List, Any
 * from requests.exceptions import ConnectionError as RequestsConnectionError             # <<<<<<<<<<<<<<
 * import logging
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ConnectionError);
  __Pyx_GIVEREF(__pyx_n_s_ConnectionError);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ConnectionError);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_requests_exceptions, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __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_ConnectionError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RequestsConnectionError, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "viur/datastore/transport.pyx":18
 * from typing import Union, List, Any
 * from requests.exceptions import ConnectionError as RequestsConnectionError
 * import logging             # <<<<<<<<<<<<<<
 * 
 * ## Start of CPP-Imports required for the simdjson->python bridge
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_logging, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "viur/datastore/transport.pyx":97
 * 
 * 
 * credentials, projectID = google.auth.default(scopes=["https://www.googleapis.com/auth/datastore"])             # <<<<<<<<<<<<<<
 * _http_internal = google.auth.transport.requests.AuthorizedSession(
 * 	credentials,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_google); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_auth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __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_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_kp_u_https_www_googleapis_com_auth_da);
  __Pyx_GIVEREF(__pyx_kp_u_https_www_googleapis_com_auth_da);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_https_www_googleapis_com_auth_da);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_scopes, __pyx_t_3) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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, 97, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L2_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L2_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3_unpacking_done;
    __pyx_L2_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 97, __pyx_L1_error)
    __pyx_L3_unpacking_done:;
  }
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_credentials, __pyx_t_1) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_projectID, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "viur/datastore/transport.pyx":98
 * 
 * credentials, projectID = google.auth.default(scopes=["https://www.googleapis.com/auth/datastore"])
 * _http_internal = google.auth.transport.requests.AuthorizedSession(             # <<<<<<<<<<<<<<
 * 	credentials,
 * 	refresh_timeout=300,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_google); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_auth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_transport); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __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_requests); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AuthorizedSession); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "viur/datastore/transport.pyx":99
 * credentials, projectID = google.auth.default(scopes=["https://www.googleapis.com/auth/datastore"])
 * _http_internal = google.auth.transport.requests.AuthorizedSession(
 * 	credentials,             # <<<<<<<<<<<<<<
 * 	refresh_timeout=300,
 * )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_credentials); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "viur/datastore/transport.pyx":98
 * 
 * credentials, projectID = google.auth.default(scopes=["https://www.googleapis.com/auth/datastore"])
 * _http_internal = google.auth.transport.requests.AuthorizedSession(             # <<<<<<<<<<<<<<
 * 	credentials,
 * 	refresh_timeout=300,
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "viur/datastore/transport.pyx":100
 * _http_internal = google.auth.transport.requests.AuthorizedSession(
 * 	credentials,
 * 	refresh_timeout=300,             # <<<<<<<<<<<<<<
 * )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_refresh_timeout, __pyx_int_300) < 0) __PYX_ERR(0, 100, __pyx_L1_error)

  /* "viur/datastore/transport.pyx":98
 * 
 * credentials, projectID = google.auth.default(scopes=["https://www.googleapis.com/auth/datastore"])
 * _http_internal = google.auth.transport.requests.AuthorizedSession(             # <<<<<<<<<<<<<<
 * 	credentials,
 * 	refresh_timeout=300,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_http_internal, __pyx_t_4) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":103
 * )
 * 
 * def authenticatedRequest(url:str, data: bytes) -> requests.Response:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs one http request to the datastore rest api, authenticated with the current projects service account.
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_4viur_9datastore_9transport_1authenticatedRequest, NULL, __pyx_n_s_viur_datastore_transport); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_authenticatedRequest, __pyx_t_4) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":124
 * 			continue
 * 
 * def keyToPath(key: Key) -> List[dict]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Converts a Key object to the PathElements expected by the rest API.
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_4viur_9datastore_9transport_3keyToPath, NULL, __pyx_n_s_viur_datastore_transport); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_keyToPath, __pyx_t_4) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":148
 * 	return res
 * 
 * def pythonPropToJson(v) -> dict:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Convert a python type to the object representation expected by the datastore rest API.
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_4viur_9datastore_9transport_5pythonPropToJson, NULL, __pyx_n_s_viur_datastore_transport); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pythonPropToJson, __pyx_t_4) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":432
 * 		raise ValueError("Unknown type")
 * 
 * def runSingleFilter(queryDefinition: QueryDefinition, limit: int) -> List[Entity]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs a single Query as defined by queryDefinition. The limit of the queryDefinition is ignored and must
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_4viur_9datastore_9transport_7runSingleFilter, NULL, __pyx_n_s_viur_datastore_transport); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_runSingleFilter, __pyx_t_4) < 0) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":554
 * 	return res
 * 
 * def Get(keys: Union[Key, List[Key]]) -> Union[None, Entity, List[Entity]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Fetches the entities determined by keys from the datastore. Returns or inserts None if a key is not found.
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_4viur_9datastore_9transport_9Get, NULL, __pyx_n_s_viur_datastore_transport); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Get, __pyx_t_4) < 0) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":607
 * 		return [res.get(x) for x in keys]  # Sort by order of incoming keys
 * 
 * def Delete(keys: Union[Key, List[Key], Entity, List[Entity]]) -> None:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Deletes the entities stored under the given key(s).
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_4viur_9datastore_9transport_11Delete, NULL, __pyx_n_s_viur_datastore_transport); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Delete, __pyx_t_4) < 0) __PYX_ERR(0, 607, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":660
 * 			raise ValueError("Invalid number of mutation-results received")
 * 
 * def Put(entities: Union[Entity, List[Entity]]) -> Union[Entity, List[Entity]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Writes the given entities into the datastore. The entities can be from different kinds. If an entity has an
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_4viur_9datastore_9transport_13Put, NULL, __pyx_n_s_viur_datastore_transport); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Put, __pyx_t_4) < 0) __PYX_ERR(0, 660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":721
 * 	return entities
 * 
 * class Collision(Exception):             # <<<<<<<<<<<<<<
 * 	pass
 * 
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_4, __pyx_n_s_Collision, __pyx_n_s_Collision, (PyObject *) NULL, __pyx_n_s_viur_datastore_transport, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Collision, __pyx_t_4, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Collision, __pyx_t_3) < 0) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":724
 * 	pass
 * 
 * def RunInTransaction(callback: callable, *args, **kwargs) -> Any:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Runs the given function inside a AID transaction.
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_4viur_9datastore_9transport_15RunInTransaction, NULL, __pyx_n_s_viur_datastore_transport); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RunInTransaction, __pyx_t_4) < 0) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":825
 * 	raise Collision() # If we made it here, all tries are exhausted
 * 
 * def _rollbackTxn(txnKey: str):             # <<<<<<<<<<<<<<
 * 	"""
 * 		Internal helper that aborts the given transaction. It's important to abort pending transactions (instead
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_4viur_9datastore_9transport_17_rollbackTxn, NULL, __pyx_n_s_viur_datastore_transport); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_rollbackTxn, __pyx_t_4) < 0) __PYX_ERR(0, 825, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":841
 * 	)
 * 
 * def AllocateIDs(keys: Union[Key, List[Key]]) -> Union[Key, List[Key]]:             # <<<<<<<<<<<<<<
 * 	"""
 * 		Allocates numeric IDs for the keys given.
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_4viur_9datastore_9transport_19AllocateIDs, NULL, __pyx_n_s_viur_datastore_transport); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_AllocateIDs, __pyx_t_4) < 0) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "viur/datastore/transport.pyx":1
 * # distutils: sources = src/viur/datastore/simdjson.cpp             # <<<<<<<<<<<<<<
 * # distutils: language = c++
 * # cython: language_level=3
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init viur.datastore.transport", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init viur.datastore.transport");
  }
  __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;
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

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

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

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

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

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

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

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

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

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

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

/* pyfrozenset_new */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
    if (it) {
        PyObject* result;
#if CYTHON_COMPILING_IN_PYPY
        PyObject* args;
        args = PyTuple_Pack(1, it);
        if (unlikely(!args))
            return NULL;
        result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
        Py_DECREF(args);
        return result;
#else
        if (PyFrozenSet_CheckExact(it)) {
            Py_INCREF(it);
            return it;
        }
        result = PyFrozenSet_New(it);
        if (unlikely(!result))
            return NULL;
        if ((PY_VERSION_HEX >= 0x031000A1) || likely(PySet_GET_SIZE(result)))
            return result;
        Py_DECREF(result);
#endif
    }
#if CYTHON_USE_TYPE_SLOTS
    return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#else
    return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#endif
}

/* PySetContains */
static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
    int result = -1;
    if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
        PyObject *tmpkey;
        PyErr_Clear();
        tmpkey = __Pyx_PyFrozenSet_New(key);
        if (tmpkey != NULL) {
            result = PySet_Contains(set, tmpkey);
            Py_DECREF(tmpkey);
        }
    }
    return result;
}
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
    int result = PySet_Contains(set, key);
    if (unlikely(result < 0)) {
        result = __Pyx_PySet_ContainsUnhashable(set, key);
    }
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

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

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyString_CheckExact(s))) {
        PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
        Py_DECREF(s);
        return result;
    }
    #endif
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      CYTHON_UNUSED Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind;
    Py_ssize_t i, char_pos;
    void *result_udata;
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely(char_pos + ulength < 0))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    result_ulength++;
    value_count++;
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

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

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

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

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

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

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

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

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
    if (op1 == op2) {
        Py_RETURN_FALSE;
    }
    #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_TRUE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_TRUE;
        }
        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_NE));
}

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

/* UnpackUnboundCMethod */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
            if (PY_VERSION_HEX >= 0x030700A0) {
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

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

/* py_dict_pop */
static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3
    if ((1)) {
        return _PyDict_Pop(d, key, default_value);
    } else
#endif
    if (default_value) {
        return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value);
    } else {
        return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key);
    }
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* SliceTupleAndList */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
    Py_ssize_t start = *_start, stop = *_stop, length = *_length;
    if (start < 0) {
        start += length;
        if (start < 0)
            start = 0;
    }
    if (stop < 0)
        stop += length;
    else if (stop > length)
        stop = length;
    *_length = stop - start;
    *_start = start;
    *_stop = stop;
}
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyList_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyList_New(0);
    dest = PyList_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyListObject*)src)->ob_item + start,
        ((PyListObject*)dest)->ob_item,
        length);
    return dest;
}
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyTuple_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyTuple_New(0);
    dest = PyTuple_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyTupleObject*)src)->ob_item + start,
        ((PyTupleObject*)dest)->ob_item,
        length);
    return dest;
}
#endif

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
    size_t size, enum __Pyx_ImportType_CheckSize check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    result = PyObject_GetAttrString(module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if ((size_t)basicsize < size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd from PyObject",
            module_name, class_name, size, basicsize);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

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

/* 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;
        (void) 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 = NULL;
    PyObject *py_funcname = NULL;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_srcfile = NULL;
    py_srcfile = PyString_FromString(filename);
    if (!py_srcfile) goto bad;
    #endif
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        if (!py_funcname) goto bad;
        #endif
    }
    #if PY_MAJOR_VERSION < 3
    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);
    #else
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    #endif
    Py_XDECREF(py_funcname);  // XDECREF since it's only set on Py3 if cline
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_srcfile);
    #endif
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
                                     little, !is_unsigned);
    }
}

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

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

/* 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 Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(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 */
